33 template <
typename Scalar>
35 const Scalar & rate,
const Scalar & derive,
const Scalar & T)
37 const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 2;
39 if( abs( (rate - rate_exact)/rate_exact ) > tol )
41 std::cout << std::scientific << std::setprecision(16)
42 <<
"Error: Mismatch in rate values." << std::endl
43 <<
"T = " << T <<
" K" << std::endl
44 <<
"rate(T) = " << rate << std::endl
45 <<
"rate_exact = " << rate_exact << std::endl
46 <<
"relative difference = " << abs( (rate - rate_exact)/rate_exact ) << std::endl
47 <<
"tolerance = " << tol << std::endl;
51 if( abs( (derive - derive_exact)/derive_exact ) > tol )
53 std::cout << std::scientific << std::setprecision(16)
54 <<
"Error: Mismatch in rate derivative values." << std::endl
55 <<
"T = " << T <<
" K" << std::endl
56 <<
"drate_dT(T) = " << derive << std::endl
57 <<
"derive_exact = " << derive_exact << std::endl
58 <<
"relative difference = " << abs( (derive - derive_exact)/derive_exact ) << std::endl
59 <<
"tolerance = " << tol << std::endl;
67 template <
typename Scalar>
74 for(Scalar T = 300.1L; T <= 2500.1L; T += 10.L)
76 const Scalar rate_exact = Cf *
pow(T/Tref,eta);
77 const Scalar derive_exact = Cf * eta *
pow(T/Tref,eta)/T;
82 Scalar rate = hercourtessen_rate(cond);
83 Scalar deriveRate = hercourtessen_rate.
derivative(cond);
92 rate = hercourtessen_rate(T);
105 template <
typename Scalar>
115 int return_flag =
test_values(Cf,eta,Tref,hercourtessen_rate);
119 hercourtessen_rate.
set_Cf(Cf);
120 hercourtessen_rate.
set_eta(eta);
122 return_flag =
test_values(Cf,eta,Tref,hercourtessen_rate) || return_flag;
126 std::vector<Scalar> values(2);
130 return_flag =
test_values(Cf,eta,Tref,hercourtessen_rate) || return_flag;
138 return_flag =
test_values(Cf,eta,Tref,hercourtessen_rate) || return_flag;
145 return (tester<double>() ||
146 tester<long double>() ||
int check_rate_and_derivative(const Scalar &rate_exact, const Scalar &derive_exact, const Scalar &rate, const Scalar &derive, const Scalar &T)
_Cf VectorStateType VectorStateType derivative(const KineticsConditions< StateType, VectorStateType > &T) const ANTIOCH_AUTOFUNC(StateType
void set_Tref(const CoeffType Tref)
Antioch::enable_if_c< Antioch::is_valarray< T >::value, typename Antioch::state_type< T >::type >::type pow(const T &in, const T2 &n)
void reset_coefs(const VectorCoeffType &coefficients)
reset the coeffs
void set_eta(const CoeffType eta)
Hercourt-Essen rate equation.
void set_Cf(const CoeffType Cf)
int test_values(const Scalar &Cf, const Scalar &eta, const Scalar &Tref, const Antioch::HercourtEssenRate< Scalar > &hercourtessen_rate)
This class contains the conditions of the chemistry.
_Cf VectorStateType VectorStateType(*) VectorStateType voi rate_and_derivative)(const KineticsConditions< StateType, VectorStateType > &T, StateType &rate, StateType &drate_dT) const