27 #ifndef ANTIOCH_FALLOFF_REACTION_H
28 #define ANTIOCH_FALLOFF_REACTION_H
97 template<
typename CoeffType=
double,
typename FalloffType = LindemannFalloff<CoeffType> >
112 template <
typename StateType,
typename VectorStateType>
117 template <
typename StateType,
typename VectorStateType>
122 VectorStateType& dkfkwd_dX)
const;
126 const FalloffType &
F()
const;
137 template<
typename CoeffType,
typename FalloffType>
140 const std::string &equation,
141 const bool &reversible,
144 :
Reaction<CoeffType>(n_species,equation,reversible,falloffType,kin),
150 template<
typename CoeffType,
typename FalloffType>
157 template<
typename CoeffType,
typename FalloffType>
164 template<
typename CoeffType,
typename FalloffType>
171 template<
typename CoeffType,
typename FalloffType>
172 template<
typename StateType,
typename VectorStateType>
179 for(
unsigned int i = 0; i < molar_densities.size(); i++)
181 M += molar_densities[i];
184 const StateType k0 = (*this->_forward_rate[0])(conditions);
185 const StateType kinf = (*this->_forward_rate[1])(conditions);
187 return k0 / (ant_pow(M,-1) + k0 / kinf) * _F(conditions.
T(),M,k0,kinf);
190 template<
typename CoeffType,
typename FalloffType>
191 template<
typename StateType,
typename VectorStateType>
197 VectorStateType& dkfwd_dX)
const
205 this->_forward_rate[0]->compute_rate_and_derivative(conditions,k0,dk0_dT);
206 this->_forward_rate[1]->compute_rate_and_derivative(conditions,kinf,dkinf_dT);
209 for(
unsigned int i = 0; i < molar_densities.size(); i++)
211 M += molar_densities[i];
218 _F.F_and_derivatives(conditions.
T(),M,k0,dk0_dT,kinf,dkinf_dT,f,df_dT,df_dX);
221 kfwd = k0 / (ant_pow(M,-1) + k0/kinf);
223 StateType temp = (kinf/M + k0);
227 dkfwd_dT = f * kfwd * (dk0_dT/k0 - dk0_dT/temp + dkinf_dT * k0/(kinf * temp))
230 dkfwd_dX.resize(this->n_species(), kfwd);
233 StateType tmp = f * kfwd / (M + ant_pow(M,2) * k0/kinf);
234 for(
unsigned int ic = 0; ic < this->n_species(); ic++)
236 dkfwd_dX[ic] = tmp + df_dX[ic] * kfwd;
246 #endif // ANTIOCH_FALLOFF_REACTION_H
A single reaction mechanism.
const std::string & equation() const
unsigned int n_species() const
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
virtual ~FalloffReaction()
Base class for falloff processes.
FalloffReaction(const unsigned int n_species, const std::string &equation, const bool &reversible=true, const ReactionType::ReactionType &falloffType=ReactionType::LINDEMANN_FALLOFF, const KineticsModel::KineticsModel kin=KineticsModel::KOOIJ)
Construct a single reaction mechanism.
const FalloffType & F() const
Return const reference to the falloff object.
StateType compute_forward_rate_coefficient(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions) const
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.