28 #ifndef ANTIOCH_THREEBODY_REACTION_H
29 #define ANTIOCH_THREEBODY_REACTION_H
64 template <
typename CoeffType=
double>
65 class ThreeBodyReaction:
public Reaction<CoeffType>
78 template <
typename StateType,
typename VectorStateType>
80 const KineticsConditions<StateType,VectorStateType>& conditions )
const;
83 template <
typename StateType,
typename VectorStateType>
85 const KineticsConditions<StateType,VectorStateType>& conditions,
88 VectorStateType& dkfwd_dX)
const;
93 template <
typename CoeffType>
96 const std::string &equation ,
97 const bool &reversible,
106 template <
typename CoeffType>
115 template <
typename CoeffType>
116 template<
typename StateType,
typename VectorStateType>
122 StateType kfwd = (this->efficiency(0) * molar_densities[0] );
124 for (
unsigned int s=1; s<this->n_species(); s++)
126 kfwd += ( this->efficiency(s) * molar_densities[s] );
130 return (kfwd * (*this->_forward_rate[0])(conditions));
134 template <
typename CoeffType>
135 template<
typename StateType,
typename VectorStateType>
141 VectorStateType& dkfwd_dX)
const
147 this->_forward_rate[0]->compute_rate_and_derivative(conditions,kfwd,dkfwd_dT);
150 StateType coef = (this->efficiency(0) * molar_densities[0]);
152 for (
unsigned int s=1; s<this->n_species(); s++)
154 coef += ( this->efficiency(s) * molar_densities[s] );
161 for (
unsigned int s=0; s<this->n_species(); s++)
163 dkfwd_dX[s] *= this->efficiency(s);
171 #endif // ANTIOCH_ELEMENTARY_REACTION_H
A single reaction mechanism.
const std::string & equation() const
#define antioch_assert_equal_to(expr1, expr2)
unsigned int n_species() const
ThreeBodyReaction(const unsigned int n_species, const std::string &equation, const bool &reversible=true, const KineticsModel::KineticsModel kin=KineticsModel::KOOIJ)
Construct a single reaction mechanism.
void compute_forward_rate_coefficient_and_derivatives(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions, StateType &kfwd, StateType &dkfwd_dT, VectorStateType &dkfwd_dX) const
The parameters are reduced parameters.
StateType compute_forward_rate_coefficient(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions) const
This class contains the conditions of the chemistry.