antioch-0.4.0
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Antioch::KooijRate< CoeffType > Class Template Reference

Kooij rate equation. More...

#include <kinetics_type.h>

Inheritance diagram for Antioch::KooijRate< CoeffType >:
Antioch::KineticsType< CoeffType >

Public Member Functions

 KooijRate (const CoeffType Cf=0., const CoeffType eta=0., const CoeffType Ea=0., const CoeffType Tref=1., const CoeffType rscale=Constants::R_universal< CoeffType >())
 
 ~KooijRate ()
 
void set_Cf (const CoeffType Cf)
 
void set_eta (const CoeffType eta)
 
void set_Ea (const CoeffType Ea)
 set _raw_Ea, unit is known (cal.mol-1, J.mol-1, whatever), _Ea is computed More...
 
void reset_Ea (const CoeffType Ea)
 set _Ea, unit is K, _raw_Ea is computed More...
 
void set_Tref (const CoeffType Tref)
 
void set_rscale (const CoeffType scale)
 
void set_parameter (KineticsModel::Parameters parameter, CoeffType new_value)
 set one parameter, characterized by enum More...
 
CoeffType get_parameter (KineticsModel::Parameters parameter) const
 get one parameter, characterized by enum More...
 
template<typename VectorCoeffType >
void set_parameter (KineticsModel::Parameters parameter, VectorCoeffType new_value)
 for compatibility purpose with photochemistry (particle flux reactions) More...
 
template<typename VectorCoeffType >
void reset_coefs (const VectorCoeffType &coefficients)
 reset the coeffs More...
 
CoeffType Cf () const
 
CoeffType eta () const
 
CoeffType Ea () const
 
CoeffType Ea_K () const
 
CoeffType Tref () const
 
CoeffType rscale () const
 
template<typename StateType >
 rate (const StateType &T) const ANTIOCH_AUTOFUNC(StateType
 
_Cfant_exp (_eta *ant_log(T)-_Ea/T))) template< typename StateType > operator()(const StateType &T) const template< typename StateType > derivative(const StateType &T) const ANTIOCH_AUTOFUNC(StateType
 
template<typename StateType , typename VectorStateType >
 rate (const KineticsConditions< StateType, VectorStateType > &T) const ANTIOCH_AUTOFUNC(StateType
 
_Cfant_exp (_eta *T.temp_cache().lnT-_Ea/T.T())) template< typename StateType
 
_Cf VectorStateType operator() (const KineticsConditions< StateType, VectorStateType > &T) const template< typename StateType
 
_Cf VectorStateType VectorStateType derivative (const KineticsConditions< StateType, VectorStateType > &T) const ANTIOCH_AUTOFUNC(StateType
 
const std::string numeric () const
 print equation More...
 
KineticsModel::KineticsModel type () const
 
StateType operator() (const StateType &temp) const
 
StateType derivative (const StateType &conditions) const
 
CoeffType get_parameter (KineticsModel::Parameters parameter, int l) const
 get one parameter, characterized by enum, for vectorized parameter More...
 
void compute_rate_and_derivative (const KineticsConditions< StateType, VectorStateType > &conditions, StateType &rate, StateType &drate_dT) const
 
void compute_rate_and_derivative (const StateType &temp, StateType &rate, StateType &drate_dT) const
 
void set_index (unsigned int nr)
 
void print (std::ostream &os=std::cout) const
 Formatted print, by default to std::cout. More...
 

Public Attributes

_Cf(* this )(T)/T *(_eta+_Ea/T)) template< typename StateType > void rate_and_derivative(const StateType &T
 Simultaneously evaluate the rate and its derivative at T. More...
 
_Cf(*) StateType rate )
 
_Cf(*) StateType StateType &drate_d const )
 
_Cf VectorStateType
VectorStateType(* 
this )(T)/T.T()*(_eta+_Ea/T.T())) template< typename StateType
 Simultaneously evaluate the rate and its derivative at T. More...
 
_Cf VectorStateType
VectorStateType(*)
VectorStateType voi 
rate_and_derivative )(const KineticsConditions< StateType, VectorStateType > &T, StateType &rate, StateType &drate_dT) const
 

Private Member Functions

void compute_cf ()
 

Private Attributes

CoeffType _raw_Cf
 
CoeffType _Cf
 
CoeffType _eta
 
CoeffType _raw_Ea
 
CoeffType _Ea
 
CoeffType _Tref
 
CoeffType _rscale
 

Detailed Description

template<typename CoeffType = double>
class Antioch::KooijRate< CoeffType >

Kooij rate equation.

The Kooij kinetics model is of the form:

\[ \alpha(T) = A \left(\frac{T}{\mathrm{T_\text{ref}}}\right)^\beta \exp\left(-\frac{E_a}{\mathrm{R}T}\right) \]

thus

\[ \frac{\partial\alpha(T)}{\partial T} = \alpha(T) \left(\frac{\beta}{T} + \frac{E_a}{\mathrm{R}T^2}\right) \]

Internally, we use the reduced pre-exponential parameter $a = \frac{A}{\mathrm{T_\text{ref}}^\beta}$ and the reduced activation energy $e = \frac{E_a}{\mathrm{R}}$

Definition at line 59 of file kinetics_type.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::KooijRate< CoeffType >::KooijRate ( const CoeffType  Cf = 0.,
const CoeffType  eta = 0.,
const CoeffType  Ea = 0.,
const CoeffType  Tref = 1.,
const CoeffType  rscale = Constants::R_universal<CoeffType>() 
)

Definition at line 175 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::_rscale, and Antioch::KooijRate< CoeffType >::compute_cf().

176  : KineticsType<CoeffType>(KineticsModel::KOOIJ),
177  _raw_Cf(Cf),
178  _eta(eta),
179  _raw_Ea(Ea),
180  _Tref(Tref),
181  _rscale(rscale)
182  {
183 
184  _Ea = _raw_Ea / _rscale;
185  this->compute_cf();
186 
187  return;
188  }
CoeffType Cf() const
Definition: kooij_rate.h:366
CoeffType _raw_Cf
Definition: kooij_rate.h:64
CoeffType _eta
Definition: kooij_rate.h:66
CoeffType Ea() const
Definition: kooij_rate.h:376
CoeffType _Tref
Definition: kooij_rate.h:69
CoeffType eta() const
Definition: kooij_rate.h:371
CoeffType Tref() const
Definition: kooij_rate.h:386
CoeffType _rscale
Definition: kooij_rate.h:70
CoeffType _raw_Ea
Definition: kooij_rate.h:67
CoeffType rscale() const
Definition: kooij_rate.h:391
template<typename CoeffType >
Antioch::KooijRate< CoeffType >::~KooijRate ( )

Definition at line 191 of file kooij_rate.h.

192  {
193  return;
194  }

Member Function Documentation

template<typename CoeffType = double>
_Cf* Antioch::KooijRate< CoeffType >::ant_exp ( _eta *ant_log(T)-_Ea T) const
Returns
the rate evaluated at T.
the derivative with respect to temperature evaluated at T.
template<typename CoeffType = double>
_Cf* Antioch::KooijRate< CoeffType >::ant_exp ( _eta *T.  temp_cache).lnT-_Ea/T.T()
Returns
the rate evaluated at T.
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::Cf ( ) const
inline
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::compute_cf ( )
inlineprivate

Definition at line 422 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::KooijRate(), Antioch::KooijRate< CoeffType >::set_Cf(), Antioch::KooijRate< CoeffType >::set_eta(), and Antioch::KooijRate< CoeffType >::set_Tref().

423  {
424  _Cf = _raw_Cf * ant_pow(KineticsModel::Tref<CoeffType>()/_Tref,_eta);
425  return;
426  }
CoeffType _raw_Cf
Definition: kooij_rate.h:64
CoeffType _eta
Definition: kooij_rate.h:66
CoeffType _Tref
Definition: kooij_rate.h:69
void Antioch::KineticsType< CoeffType, VectorCoeffType >::compute_rate_and_derivative ( const KineticsConditions< StateType, VectorStateType > &  conditions,
StateType &  rate,
StateType &  drate_dT 
) const
inherited
void Antioch::KineticsType< CoeffType, VectorCoeffType >::compute_rate_and_derivative ( const StateType &  temp,
StateType &  rate,
StateType &  drate_dT 
) const
inherited
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const StateType &  conditions) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType VectorStateType Antioch::KooijRate< CoeffType >::derivative ( const KineticsConditions< StateType, VectorStateType > &  T) const

Referenced by test_values(), and vectester().

template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::Ea ( ) const
inline
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::Ea_K ( ) const
inline

Definition at line 381 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::_Ea.

382  { return _Ea; }
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::eta ( ) const
inline
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::get_parameter ( KineticsModel::Parameters  parameter) const
inline

get one parameter, characterized by enum

Definition at line 325 of file kooij_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::KineticsModel::B, Antioch::KooijRate< CoeffType >::Cf(), Antioch::KineticsModel::E, Antioch::KooijRate< CoeffType >::Ea(), Antioch::KooijRate< CoeffType >::eta(), Antioch::KineticsModel::R_SCALE, Antioch::KooijRate< CoeffType >::rscale(), Antioch::KineticsModel::T_REF, and Antioch::KooijRate< CoeffType >::Tref().

326  {
327  switch(parameter)
328  {
330  {
331  return this->rscale();
332  }
333  break;
335  {
336  return this->Tref();
337  }
338  break;
340  {
341  return this->Cf();
342  }
343  break;
345  {
346  return this->eta();
347  }
348  break;
350  {
351  return this->Ea();
352  }
353  break;
354  default:
355  {
356  antioch_error();
357  }
358  break;
359  }
360 
361  return 0;
362  }
CoeffType Cf() const
Definition: kooij_rate.h:366
CoeffType Ea() const
Definition: kooij_rate.h:376
#define antioch_error()
CoeffType eta() const
Definition: kooij_rate.h:371
CoeffType Tref() const
Definition: kooij_rate.h:386
CoeffType rscale() const
Definition: kooij_rate.h:391
CoeffType Antioch::KineticsType< CoeffType, VectorCoeffType >::get_parameter ( KineticsModel::Parameters  parameter,
int  l 
) const
inherited

get one parameter, characterized by enum, for vectorized parameter

template<typename CoeffType >
const std::string Antioch::KooijRate< CoeffType >::numeric ( ) const
virtual

print equation

Implements Antioch::KineticsType< CoeffType >.

Definition at line 197 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::_eta, and Antioch::KooijRate< CoeffType >::_raw_Cf.

198  {
199  std::stringstream os;
200  os << _raw_Cf;
201  if (_eta != 0.) os << "*(T/" << _Tref << ")^" << _eta;
202  os << "*exp(-" << _raw_Ea << "/(R*T))";
203 
204  return os.str();
205  }
CoeffType _raw_Cf
Definition: kooij_rate.h:64
CoeffType _eta
Definition: kooij_rate.h:66
CoeffType _Tref
Definition: kooij_rate.h:69
CoeffType _raw_Ea
Definition: kooij_rate.h:67
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const StateType &  temp) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType Antioch::KooijRate< CoeffType >::operator() ( const KineticsConditions< StateType, VectorStateType > &  T) const
Returns
the derivative with respect to temperature evaluated at T.
void Antioch::KineticsType< CoeffType, VectorCoeffType >::print ( std::ostream &  os = std::cout) const
inherited

Formatted print, by default to std::cout.

template<typename CoeffType = double>
template<typename StateType >
Antioch::KooijRate< CoeffType >::rate ( const StateType &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType = double>
template<typename StateType , typename VectorStateType >
Antioch::KooijRate< CoeffType >::rate ( const KineticsConditions< StateType, VectorStateType > &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType >
template<typename VectorCoeffType >
void Antioch::KooijRate< CoeffType >::reset_coefs ( const VectorCoeffType &  coefficients)
inline

reset the coeffs

Two ways of modifying your rate:

  • you change totally the rate, thus you require exactly five parameters, the order assumed is Cf, eta, Ea, Tref, rscale
  • you just change the value, thus Tref and rscale are not modified. You require exactly three parameters, the order assumed is Cf, eta, Ea

Definition at line 267 of file kooij_rate.h.

References antioch_assert_greater, antioch_assert_less, antioch_assert_not_equal_to, Antioch::KooijRate< CoeffType >::set_Cf(), Antioch::KooijRate< CoeffType >::set_Ea(), Antioch::KooijRate< CoeffType >::set_eta(), Antioch::KooijRate< CoeffType >::set_rscale(), and Antioch::KooijRate< CoeffType >::set_Tref().

Referenced by tester().

268  {
269  // 3 or 5
270  antioch_assert_greater(coefficients.size(),2);
271  antioch_assert_less(coefficients.size(),6);
272  antioch_assert_not_equal_to(coefficients.size(),4);
273 
274  if(coefficients.size() == 5)
275  {
276  this->set_rscale(coefficients[4]);
277  this->set_Tref(coefficients[3]);
278  }
279  this->set_Cf(coefficients[0]);
280  this->set_eta(coefficients[1]);
281  this->set_Ea(coefficients[2]);
282  }
void set_Tref(const CoeffType Tref)
Definition: kooij_rate.h:220
void set_Ea(const CoeffType Ea)
set _raw_Ea, unit is known (cal.mol-1, J.mol-1, whatever), _Ea is computed
Definition: kooij_rate.h:239
#define antioch_assert_greater(expr1, expr2)
#define antioch_assert_not_equal_to(expr1, expr2)
#define antioch_assert_less(expr1, expr2)
void set_rscale(const CoeffType scale)
Definition: kooij_rate.h:257
void set_Cf(const CoeffType Cf)
Definition: kooij_rate.h:210
void set_eta(const CoeffType eta)
Definition: kooij_rate.h:230
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::reset_Ea ( const CoeffType  Ea)
inline

set _Ea, unit is K, _raw_Ea is computed

Definition at line 248 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::_rscale, and Antioch::KooijRate< CoeffType >::Ea().

Referenced by Antioch::KooijRate< CoeffType >::set_parameter().

249  {
250  _Ea = Ea;
251  _raw_Ea = _Ea * _rscale;
252  return;
253  }
CoeffType Ea() const
Definition: kooij_rate.h:376
CoeffType _rscale
Definition: kooij_rate.h:70
CoeffType _raw_Ea
Definition: kooij_rate.h:67
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::rscale ( ) const
inline
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_Cf ( const CoeffType  Cf)
inline

Definition at line 210 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::Cf(), and Antioch::KooijRate< CoeffType >::compute_cf().

Referenced by Antioch::KooijRate< CoeffType >::reset_coefs(), Antioch::KooijRate< CoeffType >::set_parameter(), and tester().

211  {
212  _raw_Cf = Cf;
213  this->compute_cf();
214 
215  return;
216  }
CoeffType Cf() const
Definition: kooij_rate.h:366
CoeffType _raw_Cf
Definition: kooij_rate.h:64
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_Ea ( const CoeffType  Ea)
inline

set _raw_Ea, unit is known (cal.mol-1, J.mol-1, whatever), _Ea is computed

Definition at line 239 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::_rscale, and Antioch::KooijRate< CoeffType >::Ea().

Referenced by Antioch::KooijRate< CoeffType >::reset_coefs(), and tester().

240  {
241  _raw_Ea = Ea;
242  _Ea = _raw_Ea / _rscale;
243  return;
244  }
CoeffType Ea() const
Definition: kooij_rate.h:376
CoeffType _rscale
Definition: kooij_rate.h:70
CoeffType _raw_Ea
Definition: kooij_rate.h:67
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_eta ( const CoeffType  eta)
inline
void Antioch::KineticsType< CoeffType, VectorCoeffType >::set_index ( unsigned int  nr)
inherited
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
CoeffType  new_value 
)
inline

set one parameter, characterized by enum

Definition at line 286 of file kooij_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::KineticsModel::B, Antioch::KineticsModel::E, Antioch::KineticsModel::R_SCALE, Antioch::KooijRate< CoeffType >::reset_Ea(), Antioch::KooijRate< CoeffType >::set_Cf(), Antioch::KooijRate< CoeffType >::set_eta(), Antioch::KooijRate< CoeffType >::set_rscale(), Antioch::KooijRate< CoeffType >::set_Tref(), and Antioch::KineticsModel::T_REF.

287  {
288  switch(parameter)
289  {
291  {
292  this->set_rscale(new_value);
293  }
294  break;
296  {
297  this->set_Tref(new_value);
298  }
299  break;
301  {
302  this->set_Cf(new_value);
303  }
304  break;
306  {
307  this->set_eta(new_value);
308  }
309  break;
311  {
312  this->reset_Ea(new_value);
313  }
314  break;
315  default:
316  {
317  antioch_error();
318  }
319  break;
320  }
321  }
void set_Tref(const CoeffType Tref)
Definition: kooij_rate.h:220
void set_rscale(const CoeffType scale)
Definition: kooij_rate.h:257
#define antioch_error()
void set_Cf(const CoeffType Cf)
Definition: kooij_rate.h:210
void reset_Ea(const CoeffType Ea)
set _Ea, unit is K, _raw_Ea is computed
Definition: kooij_rate.h:248
void set_eta(const CoeffType eta)
Definition: kooij_rate.h:230
template<typename CoeffType = double>
template<typename VectorCoeffType >
void Antioch::KooijRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
VectorCoeffType  new_value 
)
inline

for compatibility purpose with photochemistry (particle flux reactions)

Definition at line 97 of file kooij_rate.h.

References antioch_error.

97 {antioch_error();}
#define antioch_error()
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_rscale ( const CoeffType  scale)
inline
template<typename CoeffType >
void Antioch::KooijRate< CoeffType >::set_Tref ( const CoeffType  Tref)
inline

Definition at line 220 of file kooij_rate.h.

References Antioch::KooijRate< CoeffType >::compute_cf(), and Antioch::KooijRate< CoeffType >::Tref().

Referenced by Antioch::KooijRate< CoeffType >::reset_coefs(), Antioch::KooijRate< CoeffType >::set_parameter(), and tester().

221  {
222  _Tref = Tref;
223  this->compute_cf();
224 
225  return;
226  }
CoeffType _Tref
Definition: kooij_rate.h:69
CoeffType Tref() const
Definition: kooij_rate.h:386
template<typename CoeffType >
CoeffType Antioch::KooijRate< CoeffType >::Tref ( ) const
inline
KineticsModel::KineticsModel Antioch::KineticsType< CoeffType, VectorCoeffType >::type ( ) const
inherited

Member Data Documentation

template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_Cf
private

Definition at line 65 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::Cf().

template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_Ea
private

Definition at line 68 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::Ea_K().

template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_eta
private
template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_raw_Cf
private

Definition at line 64 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::numeric().

template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_raw_Ea
private

Definition at line 67 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::Ea().

template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_rscale
private
template<typename CoeffType = double>
CoeffType Antioch::KooijRate< CoeffType >::_Tref
private

Definition at line 69 of file kooij_rate.h.

Referenced by Antioch::KooijRate< CoeffType >::Tref().

template<typename CoeffType = double>
_Cf(*) StateType StateType& drate_d Antioch::KooijRate< CoeffType >::const)

Definition at line 139 of file kooij_rate.h.

template<typename CoeffType = double>
_Cf(*) StateType Antioch::KooijRate< CoeffType >::rate)

Definition at line 139 of file kooij_rate.h.

template<typename CoeffType = double>
void Antioch::KooijRate< CoeffType >::rate_and_derivative
inline

Definition at line 163 of file kooij_rate.h.

Referenced by test_values(), and vectester().

template<typename CoeffType = double>
_Cf(* Antioch::KooijRate< CoeffType >::this)(T)/T *(_eta+_Ea/T))template< typename StateType > void rate_and_derivative(const StateType &T

Simultaneously evaluate the rate and its derivative at T.

Definition at line 135 of file kooij_rate.h.

template<typename CoeffType = double>
_Cf VectorStateType VectorStateType(* Antioch::KooijRate< CoeffType >::this)(T)/T.T()*(_eta+_Ea/T.T()))template< typename StateType

Simultaneously evaluate the rate and its derivative at T.

Definition at line 159 of file kooij_rate.h.


The documentation for this class was generated from the following files:

Generated on Thu Jul 7 2016 11:09:49 for antioch-0.4.0 by  doxygen 1.8.8