|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#include "common/macros.hpp" |
| 4 | + |
| 5 | +/** @file MixedEquilibriumKineticReactions.hpp |
| 6 | + * @brief Header file for the MixedEquilibriumKineticReactions class. |
| 7 | + * @author HPC-REACT Team |
| 8 | + * @date 2025 |
| 9 | + */ |
| 10 | + |
| 11 | +namespace hpcReact |
| 12 | +{ |
| 13 | +namespace bulkGeneric |
| 14 | +{ |
| 15 | + |
| 16 | +/** |
| 17 | + * @brief Class for computing reaction rates and species rates for a given set of reactions. |
| 18 | + * @tparam REAL_TYPE The type of the real numbers used in the class. |
| 19 | + * @tparam INT_TYPE The type of the integer numbers used in the class. |
| 20 | + * @tparam INDEX_TYPE The type of the index used in the class. |
| 21 | + * @tparam LOGE_CONCENTRATION Whether to use logarithm of concentration for the calculations. |
| 22 | + * @details |
| 23 | + * This class provides the ablity to compute kinetic reactions. |
| 24 | + */ |
| 25 | +template< typename REAL_TYPE, |
| 26 | + typename INT_TYPE, |
| 27 | + typename INDEX_TYPE, |
| 28 | + bool LOGE_CONCENTRATION > |
| 29 | +class MixedEquilibriumKineticReactions |
| 30 | +{ |
| 31 | +public: |
| 32 | + |
| 33 | + /// Type alias for the real type used in the class. |
| 34 | + using RealType = REAL_TYPE; |
| 35 | + |
| 36 | + /// Type alias for the integer type used in the class. |
| 37 | + using IntType = INT_TYPE; |
| 38 | + |
| 39 | + /// Type alias for the index type used in the class. |
| 40 | + using IndexType = INDEX_TYPE; |
| 41 | + |
| 42 | + using kineticReactions = KineticReactions< REAL_TYPE, INT_TYPE, INDEX_TYPE, LOGE_CONCENTRATION >; |
| 43 | + |
| 44 | + template< typename PARAMS_DATA, |
| 45 | + typename ARRAY_1D_TO_CONST, |
| 46 | + typename ARRAY_1D, |
| 47 | + typename ARRAY_2D > |
| 48 | + static HPCREACT_HOST_DEVICE inline void |
| 49 | + updateMixedSystem( RealType const & temperature, |
| 50 | + PARAMS_DATA const & params, |
| 51 | + ARRAY_1D_TO_CONST const & logPrimarySpeciesConcentrations, |
| 52 | + ARRAY_1D & logSecondarySpeciesConcentrations, |
| 53 | + ARRAY_1D & aggregatePrimarySpeciesConcentrations, |
| 54 | + ARRAY_2D & dAggregatePrimarySpeciesConcentrationsDerivatives_dLogPrimarySpeciesConcentrations, |
| 55 | + ARRAY_1D & reactionRates, |
| 56 | + ARRAY_2D & reactionRatesDerivatives ) |
| 57 | + { |
| 58 | + constexpr int numSpecies = PARAMS_DATA::numSpecies; |
| 59 | + constexpr int numSecondarySpecies = PARAMS_DATA::numReactions; |
| 60 | + constexpr int numPrimarySpecies = numSpecies - numSecondarySpecies; |
| 61 | + |
| 62 | + // 1. Compute new aggregate species from primary species |
| 63 | + calculateAggregatePrimaryConcentrationsWrtLogC< REAL_TYPE, |
| 64 | + INT_TYPE, |
| 65 | + INDEX_TYPE >( params, |
| 66 | + logPrimarySpeciesConcentrations, |
| 67 | + logSecondarySpeciesConcentrations, |
| 68 | + aggregatePrimarySpeciesConcentrations, |
| 69 | + dAggregatePrimarySpeciesConcentrationsDerivatives_dLogPrimarySpeciesConcentrations ) |
| 70 | + |
| 71 | + // 2. Compute the reaction rates for all kinetic reactions |
| 72 | + kineticReactions::computeReactionRates( temperature, |
| 73 | + params, |
| 74 | + speciesConcentration, |
| 75 | + reactionRates, |
| 76 | + reactionRatesDerivatives ); |
| 77 | + |
| 78 | + // 3. Compute aggregate species rates |
| 79 | + |
| 80 | + |
| 81 | + } |
| 82 | + |
| 83 | +private: |
| 84 | + |
| 85 | +}; |
| 86 | + |
| 87 | +} // namespace bulkGeneric |
| 88 | +} // namespace hpcReact |
| 89 | + |
| 90 | +#include "MixedEquilibriumKineticReactions_impl.hpp" |
| 91 | +#include "common/macrosCleanup.hpp" |
0 commit comments