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

Van't Hoff rate equation. More...

#include <kinetics_type.h>

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

Public Member Functions

 VantHoffRate (const CoeffType Cf=0., const CoeffType eta=0., const CoeffType Ea=0., const CoeffType D=0., const CoeffType Tref=1., const CoeffType rscale=Constants::R_universal< CoeffType >())
 
 ~VantHoffRate ()
 
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_D (const CoeffType D)
 
void set_Tref (const CoeffType Tref)
 
void set_rscale (const CoeffType rscale)
 
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 D () const
 
CoeffType Tref () const
 
CoeffType rscale () const
 
template<typename StateType >
 rate (const StateType &T) const ANTIOCH_AUTOFUNC(StateType
 
_Cfant_pow (T, _eta)*ant_exp(-_Ea/T+_D *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()+_D *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)*(_D+_eta/T+_Ea/(T *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)*(_D+_eta/T.T()+_Ea/(T.temp_cache().T2))) 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 _D
 
CoeffType _Tref
 
CoeffType _rscale
 

Detailed Description

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

Van't Hoff rate equation.

The Van't Hoff 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} + D T\right) \]

thus

\[ \frac{\partial\alpha(T)}{\partial T} = \alpha(T)\left(D + \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 62 of file kinetics_type.h.

Constructor & Destructor Documentation

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

Definition at line 180 of file vanthoff_rate.h.

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

181  : KineticsType<CoeffType>(KineticsModel::VANTHOFF),
182  _raw_Cf(Cf),
183  _eta(eta),
184  _raw_Ea(Ea),
185  _D(D),
186  _Tref(Tref),
187  _rscale(rscale)
188  {
189  _Ea = _raw_Ea / _rscale;
190  this->compute_cf();
191 
192  return;
193  }
CoeffType D() const
CoeffType rscale() const
CoeffType Ea() const
CoeffType Tref() const
CoeffType eta() const
CoeffType Cf() const
template<typename CoeffType >
Antioch::VantHoffRate< CoeffType >::~VantHoffRate ( )

Definition at line 196 of file vanthoff_rate.h.

197  {
198  return;
199  }

Member Function Documentation

template<typename CoeffType = double>
_Cf* Antioch::VantHoffRate< CoeffType >::ant_exp ( _eta *T.  temp_cache).lnT-_Ea/T.T()+_D *T.T()
Returns
the rate evaluated at T.
template<typename CoeffType = double>
_Cf* Antioch::VantHoffRate< CoeffType >::ant_pow ( ,
_eta   
) const
Returns
the rate evaluated at T.
the derivative with respect to temperature evaluated at T.

Referenced by Antioch::VantHoffRate< CoeffType >::compute_cf().

template<typename CoeffType >
CoeffType Antioch::VantHoffRate< CoeffType >::Cf ( ) const
inline
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::compute_cf ( )
inlineprivate

Definition at line 449 of file vanthoff_rate.h.

References Antioch::VantHoffRate< CoeffType >::ant_pow().

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

450  {
451  _Cf = _raw_Cf * ant_pow(KineticsModel::Tref<CoeffType>()/_Tref,_eta);
452  return;
453  }
_Cf * ant_pow(T, _eta)*ant_exp(-_Ea/T+_D *T))) template< typename StateType > operator()(const StateType &T) const template< typename StateType > derivative(const StateType &T) const ANTIOCH_AUTOFUNC(StateType
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
template<typename CoeffType >
CoeffType Antioch::VantHoffRate< CoeffType >::D ( ) const
inline
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const StateType &  conditions) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType VectorStateType Antioch::VantHoffRate< CoeffType >::derivative ( const KineticsConditions< StateType, VectorStateType > &  T) const

Referenced by test_values(), and vectester().

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

Definition at line 405 of file vanthoff_rate.h.

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

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

get one parameter, characterized by enum

Definition at line 344 of file vanthoff_rate.h.

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

345  {
346  switch(parameter)
347  {
349  {
350  return this->rscale();
351  }
352  break;
354  {
355  return this->Tref();
356  }
357  break;
359  {
360  return this->Cf();
361  }
362  break;
364  {
365  return this->eta();
366  }
367  break;
369  {
370  return this->Ea();
371  }
372  break;
374  {
375  return this->D();
376  }
377  break;
378  default:
379  {
380  antioch_error();
381  }
382  break;
383  }
384 
385  return 0;
386  }
CoeffType D() const
CoeffType rscale() const
#define antioch_error()
CoeffType Ea() const
CoeffType Tref() const
CoeffType eta() const
CoeffType Cf() const
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::VantHoffRate< CoeffType >::numeric ( ) const
virtual

print equation

Implements Antioch::KineticsType< CoeffType >.

Definition at line 202 of file vanthoff_rate.h.

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

203  {
204  std::stringstream os;
205  os << _raw_Cf;
206  if (_eta != 0.) os << "*(T/" << _Tref << ")^" << _eta;
207  os << "*exp(-" << _raw_Ea << "/(R*T) + " << _D << "*T)";
208 
209  return os.str();
210  }
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const StateType &  temp) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType Antioch::VantHoffRate< 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::VantHoffRate< CoeffType >::rate ( const StateType &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType = double>
template<typename StateType , typename VectorStateType >
Antioch::VantHoffRate< CoeffType >::rate ( const KineticsConditions< StateType, VectorStateType > &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType >
template<typename VectorCoeffType >
void Antioch::VantHoffRate< 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 six parameters, the order assumed is Cf, eta, Ea, D, Tref, rscale
  • you just change the value, thus Tref and rscale are not modified. You require exactly four parameters, the order assumed is Cf, eta, Ea, D

Definition at line 280 of file vanthoff_rate.h.

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

Referenced by tester().

281  {
282  // 4 or 6
283  antioch_assert_greater(coefficients.size(),3);
284  antioch_assert_less(coefficients.size(),7);
285  antioch_assert_not_equal_to(coefficients.size(),5);
286 
287  if(coefficients.size() == 6)
288  {
289  this->set_rscale(coefficients[5]);
290  this->set_Tref(coefficients[4]);
291  }
292  this->set_Cf(coefficients[0]);
293  this->set_eta(coefficients[1]);
294  this->set_Ea(coefficients[2]);
295  this->set_D(coefficients[3]);
296  }
#define antioch_assert_greater(expr1, expr2)
#define antioch_assert_not_equal_to(expr1, expr2)
#define antioch_assert_less(expr1, expr2)
void set_Cf(const CoeffType Cf)
void set_D(const CoeffType D)
void set_Tref(const CoeffType Tref)
void set_rscale(const CoeffType rscale)
void set_Ea(const CoeffType Ea)
set _raw_Ea, unit is known (cal.mol-1, J.mol-1, whatever), _Ea is computed
void set_eta(const CoeffType eta)
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::reset_Ea ( const CoeffType  Ea)
inline

set _Ea, unit is K, _raw_Ea is computed

Definition at line 253 of file vanthoff_rate.h.

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

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

254  {
255  _Ea = Ea;
256  _raw_Ea = _Ea * _rscale;
257  return;
258  }
CoeffType Ea() const
template<typename CoeffType >
CoeffType Antioch::VantHoffRate< CoeffType >::rscale ( ) const
inline
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_Cf ( const CoeffType  Cf)
inline
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_D ( const CoeffType  D)
inline
template<typename CoeffType >
void Antioch::VantHoffRate< 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 244 of file vanthoff_rate.h.

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

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

245  {
246  _raw_Ea = Ea;
247  _Ea = _raw_Ea / _rscale;
248  return;
249  }
CoeffType Ea() const
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_eta ( const CoeffType  eta)
inline
void Antioch::KineticsType< CoeffType, VectorCoeffType >::set_index ( unsigned int  nr)
inherited
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
CoeffType  new_value 
)
inline

set one parameter, characterized by enum

Definition at line 300 of file vanthoff_rate.h.

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

301  {
302  switch(parameter)
303  {
305  {
306  this->set_rscale(new_value);
307  }
308  break;
310  {
311  this->set_Tref(new_value);
312  }
313  break;
315  {
316  this->set_Cf(new_value);
317  }
318  break;
320  {
321  this->set_eta(new_value);
322  }
323  break;
325  {
326  this->reset_Ea(new_value);
327  }
328  break;
330  {
331  this->set_D(new_value);
332  }
333  break;
334  default:
335  {
336  antioch_error();
337  }
338  break;
339  }
340  }
#define antioch_error()
void reset_Ea(const CoeffType Ea)
set _Ea, unit is K, _raw_Ea is computed
void set_Cf(const CoeffType Cf)
void set_D(const CoeffType D)
void set_Tref(const CoeffType Tref)
void set_rscale(const CoeffType rscale)
void set_eta(const CoeffType eta)
template<typename CoeffType = double>
template<typename VectorCoeffType >
void Antioch::VantHoffRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
VectorCoeffType  new_value 
)
inline

for compatibility purpose with photochemistry (particle flux reactions)

Definition at line 101 of file vanthoff_rate.h.

References antioch_error.

101 {antioch_error();}
#define antioch_error()
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_rscale ( const CoeffType  rscale)
inline
template<typename CoeffType >
void Antioch::VantHoffRate< CoeffType >::set_Tref ( const CoeffType  Tref)
inline
template<typename CoeffType >
CoeffType Antioch::VantHoffRate< CoeffType >::Tref ( ) const
inline
KineticsModel::KineticsModel Antioch::KineticsType< CoeffType, VectorCoeffType >::type ( ) const
inherited

Member Data Documentation

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

Definition at line 65 of file vanthoff_rate.h.

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

template<typename CoeffType = double>
CoeffType Antioch::VantHoffRate< CoeffType >::_D
private

Definition at line 69 of file vanthoff_rate.h.

Referenced by Antioch::VantHoffRate< CoeffType >::D().

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

Definition at line 68 of file vanthoff_rate.h.

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

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

Definition at line 64 of file vanthoff_rate.h.

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

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

Definition at line 67 of file vanthoff_rate.h.

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

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

Definition at line 70 of file vanthoff_rate.h.

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

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

Definition at line 144 of file vanthoff_rate.h.

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

Definition at line 144 of file vanthoff_rate.h.

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

Definition at line 168 of file vanthoff_rate.h.

Referenced by test_values(), and vectester().

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

Simultaneously evaluate the rate and its derivative at T.

Definition at line 140 of file vanthoff_rate.h.

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

Simultaneously evaluate the rate and its derivative at T.

Definition at line 164 of file vanthoff_rate.h.


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

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