27 #ifndef ANTIOCH_TROE_FALLOFF_H
28 #define ANTIOCH_TROE_FALLOFF_H
109 template <
typename CoeffType =
double>
113 TroeFalloff(
const unsigned int nspec,
const CoeffType alpha=0,
114 const CoeffType T3 = 0,
const CoeffType T1 = 0,
115 const CoeffType T2 = 1e50);
120 void set_T1(
const CoeffType &T);
121 void set_T2(
const CoeffType &T);
122 void set_T3(
const CoeffType &T);
129 template <
typename StateType>
133 const StateType &kinf)
const;
135 template <
typename StateType,
typename VectorStateType>
139 const StateType &dk0_dT,
140 const StateType &kinf,
141 const StateType &dkinf_dT,
144 VectorStateType &dF_dX)
const;
162 template <
typename StateType>
163 StateType
Fcent(
const StateType &T)
const;
165 template <
typename StateType>
168 StateType &dFc_dT )
const;
172 template<
typename CoeffType>
180 template<
typename CoeffType>
188 template<
typename CoeffType>
196 template<
typename CoeffType>
204 template<
typename CoeffType>
211 template<
typename CoeffType>
218 template<
typename CoeffType>
225 template<
typename CoeffType>
233 template<
typename CoeffType>
234 template<
typename StateType>
239 const StateType &kinf)
const
243 StateType logFcent = ant_log(this->Fcent(T));
249 StateType c = - CoeffType(0.4L) - _c_coeff * logFcent;
253 ANTIOCH_AUTO(StateType) n = CoeffType(0.75L) - _n_coeff * logFcent;
256 StateType log10Pr = Constants::log10_to_log<CoeffType>() * ant_log(Pr);
261 logFcent/(1 + ant_pow(((log10Pr + c)/(n - d*(log10Pr + c) )),2) );
263 return ant_exp(logF);
267 template <
typename CoeffType>
268 template <
typename StateType>
274 StateType Fc = (1 - _alpha) * ant_exp(-T/_T3) + _alpha * ant_exp(-T/_T1);
276 if(_T2 != 1e50)Fc += ant_exp(-_T2/T);
281 template <
typename CoeffType>
282 template <
typename StateType>
288 Fc = (1 - _alpha) * ant_exp(-T/_T3) + _alpha * ant_exp(-T/_T1);
289 dFc_dT = (_alpha - 1)/_T3 * ant_exp(-T/_T3) - _alpha/_T1 * ant_exp(-T/_T1);
293 Fc += ant_exp(-_T2/T);
294 dFc_dT += _T2/(T*T) * ant_exp(-_T2/T);
300 template <
typename CoeffType>
301 template <
typename StateType,
typename VectorStateType>
306 const StateType &dk0_dT,
307 const StateType &kinf,
308 const StateType &dkinf_dT,
311 VectorStateType &dF_dX)
const
318 StateType Pr = M * k0/kinf;
319 StateType dPr_dT = Pr * (dk0_dT/k0 - dkinf_dT/kinf);
320 StateType log10Pr = Constants::log10_to_log<CoeffType>() * ant_log(Pr);
321 StateType dlog10Pr_dT = Constants::log10_to_log<CoeffType>()*dPr_dT/Pr;
323 for(
unsigned int ip = 0; ip < dlog10Pr_dX.size(); ip++)
325 dlog10Pr_dX[ip] = Constants::log10_to_log<CoeffType>()/M;
330 this->Fcent_and_derivatives(T,Fcent,dFcent_dT);
331 StateType dlog10Fcent_dT = Constants::log10_to_log<CoeffType>()*dFcent_dT/Fcent;
333 StateType logFcent = ant_log(Fcent);
336 StateType c = - CoeffType(0.4L) - _c_coeff * logFcent;
337 StateType n = CoeffType(0.75L) - _n_coeff * logFcent;
338 StateType dc_dT = - _c_coeff * dFcent_dT/Fcent;
339 ANTIOCH_AUTO(StateType) dn_dT = - _n_coeff * dFcent_dT/Fcent;
342 StateType logF = logFcent/(1 + ant_pow(((log10Pr + c)/(n - d*(log10Pr + c) )),2));
343 StateType dlogF_dT = logF * (dlog10Fcent_dT / Fcent
344 - 2 * ant_pow((log10Pr + c)/(n - d * (log10Pr + c)),2)
345 * ((dlog10Pr_dT + dc_dT)/(log10Pr + c) -
346 (dn_dT - d * (dlog10Pr_dT + dc_dT))/(n - d * (log10Pr + c))
348 / (1 + ant_pow((log10Pr + c)/(n - d * (log10Pr + c)),2))
351 for(
unsigned int ip = 0; ip < dlog10Pr_dX.size(); ip++)
353 dlogF_dX[ip] = - ant_pow(logF,2)/logFcent * dlog10Pr_dX[ip] *(1 - 1/(n - d * (log10Pr + c))) * (log10Pr + c);
357 dF_dT = F * dlogF_dT;
358 for(
unsigned int ip = 0; ip < dlog10Pr_dX.size(); ip++)
360 dF_dX[ip] = F * dlogF_dX[ip];
367 template<
typename CoeffType>
370 const CoeffType T3,
const CoeffType T1,
const CoeffType T2):
376 _c_coeff( CoeffType(0.67L) * Constants::
log10_to_log<CoeffType>() ),
377 _n_coeff( CoeffType(1.27L) * Constants::
log10_to_log<CoeffType>() )
382 template<
typename CoeffType>
391 #endif // ANTIOCH_TROE_FALLOFF_H
StateType Fcent(const StateType &T) const
void set_T1(const CoeffType &T)
TroeFalloff(const unsigned int nspec, const CoeffType alpha=0, const CoeffType T3=0, const CoeffType T1=0, const CoeffType T2=1e50)
CoeffType log10_to_log()
1/ln(10)
#define antioch_assert_equal_to(expr1, expr2)
Scalar F(const Scalar &x)
void set_alpha(const CoeffType &al)
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > constant_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex, const Scalar &value)
CoeffType _n_coeff
Precompute coefficient for log conversion.
CoeffType _c_coeff
Precompute coefficient for log conversion.
CoeffType get_alpha() const
StateType operator()(const StateType &T, const StateType &M, const StateType &k0, const StateType &kinf) const
const ANTIOCH_AUTO(StateType) KineticsTheoryThermalConductivity< ThermoEvaluator
void set_T2(const CoeffType &T)
The parameters are reduced parameters.
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
void Fcent_and_derivatives(const StateType &T, StateType &Fc, StateType &dFc_dT) const
void set_T3(const CoeffType &T)
void F_and_derivatives(const StateType &T, const StateType &M, const StateType &k0, const StateType &dk0_dT, const StateType &kinf, const StateType &dkinf_dT, StateType &F, StateType &dF_dT, VectorStateType &dF_dX) const