27 #ifndef ANTIOCH_FALLOFF_THREE_BODY_REACTION_H
28 #define ANTIOCH_FALLOFF_THREE_BODY_REACTION_H
101 template<
typename CoeffType=
double,
typename FalloffType = LindemannFalloff<CoeffType> >
116 template <
typename StateType,
typename VectorStateType>
121 template <
typename StateType,
typename VectorStateType>
126 VectorStateType& dkfkwd_dX)
const;
130 const FalloffType &
F()
const;
142 template<
typename CoeffType,
typename FalloffType>
145 const std::string &equation,
146 const bool &reversible,
149 :
Reaction<CoeffType>(n_species,equation,reversible,falloffType,kin),
158 template<
typename CoeffType,
typename FalloffType>
165 template<
typename CoeffType,
typename FalloffType>
172 template<
typename CoeffType,
typename FalloffType>
179 template<
typename CoeffType,
typename FalloffType>
180 template<
typename StateType,
typename VectorStateType>
187 for(
unsigned int s = 0; s < molar_densities.size(); s++)
189 M += this->efficiency(s) * molar_densities[s];
192 const StateType k0 = (*this->_forward_rate[0])(conditions);
193 const StateType kinf = (*this->_forward_rate[1])(conditions);
195 return k0 / (ant_pow(M,-1) + k0 / kinf) * _F(conditions.
T(),M,k0,kinf);
198 template<
typename CoeffType,
typename FalloffType>
199 template<
typename StateType,
typename VectorStateType>
205 VectorStateType& dkfwd_dX)
const
213 this->_forward_rate[0]->compute_rate_and_derivative(conditions,k0,dk0_dT);
214 this->_forward_rate[1]->compute_rate_and_derivative(conditions,kinf,dkinf_dT);
217 for(
unsigned int s = 0; s < molar_densities.size(); s++)
219 M += this->efficiency(s) * molar_densities[s];
226 _F.F_and_derivatives(conditions.
T(),M,k0,dk0_dT,kinf,dkinf_dT,f,df_dT,df_dX);
229 kfwd = k0 / (ant_pow(M,-1) + k0/kinf);
234 StateType temp = (kinf/M + k0);
235 dkfwd_dT = f * kfwd * (dk0_dT/k0 - dk0_dT/temp + dkinf_dT * k0/(kinf * temp))
238 dkfwd_dX.resize(this->n_species(), kfwd);
240 StateType tmp = f * kfwd / (M + ant_pow(M,2) * k0/kinf);
243 for(
unsigned int ic = 0; ic < this->n_species(); ic++)
245 dkfwd_dX[ic] = this->efficiency(ic) * ( tmp + df_dX[ic] * kfwd );
255 #endif // ANTIOCH_FALLOFF_REACTION_H
A single reaction mechanism.
~FalloffThreeBodyReaction()
const std::string & equation() const
unsigned int n_species() const
Base class for falloff processes coupled with efficiencies.
const FalloffType & F() const
Return const reference to the falloff object.
void compute_forward_rate_coefficient_and_derivatives(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions, StateType &kfwd, StateType &dkfwd_dT, VectorStateType &dkfkwd_dX) const
StateType compute_forward_rate_coefficient(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions) const
FalloffThreeBodyReaction(const unsigned int n_species, const std::string &equation, const bool &reversible=true, const ReactionType::ReactionType &falloffType=ReactionType::LINDEMANN_FALLOFF_THREE_BODY, const KineticsModel::KineticsModel kin=KineticsModel::KOOIJ)
Construct a single reaction mechanism.
The parameters are reduced parameters.
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
const StateType & T() const
This class contains the conditions of the chemistry.