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

Berthelot Hercourt-Essen rate equation. More...

#include <berthelothercourtessen_rate.h>

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

Public Member Functions

 BerthelotHercourtEssenRate (const CoeffType Cf=0., const CoeffType eta=0., const CoeffType D=0., const CoeffType Tref=1.)
 
 ~BerthelotHercourtEssenRate ()
 
void set_Cf (const CoeffType Cf)
 
void set_eta (const CoeffType eta)
 
void set_D (const CoeffType D)
 
void set_Tref (const CoeffType Tref)
 
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 D () const
 
CoeffType Tref () const
 
template<typename StateType >
 rate (const StateType &T) const ANTIOCH_AUTOFUNC(StateType
 
_Cfant_pow (T, _eta)*ant_exp(_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+_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)*(_eta/T+_D)) 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)*(_eta/T.T()+_D)) 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 _D
 
CoeffType _Tref
 

Detailed Description

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

Berthelot Hercourt-Essen rate equation.

The Berthelot Hercourt Essen kinetics model is of the form:

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

thus

\[ \frac{\partial \alpha(T)}{\partial T} = \alpha(T) \left(\frac{\beta}{T} + D\right) \]

Internally, we use the reduced temperature $t = \frac{T}{\mathrm{T_\text{ref}}}$.

Definition at line 57 of file berthelothercourtessen_rate.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::BerthelotHercourtEssenRate< CoeffType >::BerthelotHercourtEssenRate ( const CoeffType  Cf = 0.,
const CoeffType  eta = 0.,
const CoeffType  D = 0.,
const CoeffType  Tref = 1. 
)
template<typename CoeffType >
Antioch::BerthelotHercourtEssenRate< CoeffType >::~BerthelotHercourtEssenRate ( )

Definition at line 175 of file berthelothercourtessen_rate.h.

176  {
177  return;
178  }

Member Function Documentation

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

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

template<typename CoeffType >
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::Cf ( ) const
inline
template<typename CoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::compute_cf ( )
inlineprivate
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::BerthelotHercourtEssenRate< CoeffType >::D ( ) const
inline
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const StateType &  conditions) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType VectorStateType Antioch::BerthelotHercourtEssenRate< CoeffType >::derivative ( const KineticsConditions< StateType, VectorStateType > &  T) const

Referenced by test_values(), and vectester().

template<typename CoeffType >
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::eta ( ) const
inline
template<typename CoeffType >
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::get_parameter ( KineticsModel::Parameters  parameter) const
inline

get one parameter, characterized by enum

Definition at line 277 of file berthelothercourtessen_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::KineticsModel::B, Antioch::BerthelotHercourtEssenRate< CoeffType >::Cf(), Antioch::KineticsModel::D, Antioch::BerthelotHercourtEssenRate< CoeffType >::D(), Antioch::BerthelotHercourtEssenRate< CoeffType >::eta(), Antioch::KineticsModel::T_REF, and Antioch::BerthelotHercourtEssenRate< CoeffType >::Tref().

278  {
279  switch(parameter)
280  {
282  {
283  return this->Cf();
284  }
285  break;
287  {
288  return this->eta();
289  }
290  break;
292  {
293  return this->D();
294  }
295  break;
297  {
298  return this->Tref();
299  }
300  break;
301  default:
302  {
303  antioch_error();
304  }
305  break;
306  }
307  return 0;
308  }
#define antioch_error()
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::BerthelotHercourtEssenRate< CoeffType >::numeric ( ) const
virtual

print equation

Implements Antioch::KineticsType< CoeffType >.

Definition at line 181 of file berthelothercourtessen_rate.h.

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

182  {
183  std::stringstream os;
184  os << _raw_Cf;
185  if (_eta != 0.) os << "*(T/" << _Tref << ")^" << _eta;
186  os << "*exp(" << _D << "*T)";
187 
188  return os.str();
189  }
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const StateType &  temp) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType Antioch::BerthelotHercourtEssenRate< 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::BerthelotHercourtEssenRate< CoeffType >::rate ( const StateType &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType = double>
template<typename StateType , typename VectorStateType >
Antioch::BerthelotHercourtEssenRate< CoeffType >::rate ( const KineticsConditions< StateType, VectorStateType > &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType >
template<typename VectorCoeffType >
void Antioch::BerthelotHercourtEssenRate< 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 four parameters, the order assumed is Cf, eta, D, Tref
  • you just change the value, thus Tref is not modified. You require exactly three parameters, the order assumed is Cf, eta, D

Definition at line 230 of file berthelothercourtessen_rate.h.

References antioch_assert_greater, antioch_assert_less, Antioch::BerthelotHercourtEssenRate< CoeffType >::set_Cf(), Antioch::BerthelotHercourtEssenRate< CoeffType >::set_D(), Antioch::BerthelotHercourtEssenRate< CoeffType >::set_eta(), and Antioch::BerthelotHercourtEssenRate< CoeffType >::set_Tref().

Referenced by tester().

231  {
232  antioch_assert_greater(coefficients.size(),2);
233  antioch_assert_less(coefficients.size(),5);
234 
235  if(coefficients.size() == 4)this->set_Tref(coefficients[3]);
236  this->set_Cf(coefficients[0]);
237  this->set_eta(coefficients[1]);
238  this->set_D(coefficients[2]);
239  }
#define antioch_assert_greater(expr1, expr2)
#define antioch_assert_less(expr1, expr2)
template<typename CoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::set_Cf ( const CoeffType  Cf)
inline
template<typename CoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::set_D ( const CoeffType  D)
inline
template<typename CoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::set_eta ( const CoeffType  eta)
inline
void Antioch::KineticsType< CoeffType, VectorCoeffType >::set_index ( unsigned int  nr)
inherited
template<typename CoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
CoeffType  new_value 
)
inline

set one parameter, characterized by enum

Definition at line 243 of file berthelothercourtessen_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::KineticsModel::B, Antioch::KineticsModel::D, Antioch::BerthelotHercourtEssenRate< CoeffType >::set_Cf(), Antioch::BerthelotHercourtEssenRate< CoeffType >::set_D(), Antioch::BerthelotHercourtEssenRate< CoeffType >::set_eta(), Antioch::BerthelotHercourtEssenRate< CoeffType >::set_Tref(), and Antioch::KineticsModel::T_REF.

244  {
245  switch(parameter)
246  {
248  {
249  this->set_Cf(new_value);
250  }
251  break;
253  {
254  this->set_eta(new_value);
255  }
256  break;
258  {
259  this->set_D(new_value);
260  }
261  break;
263  {
264  this->set_Tref(new_value);
265  }
266  break;
267  default:
268  {
269  antioch_error();
270  }
271  break;
272  }
273  }
#define antioch_error()
template<typename CoeffType = double>
template<typename VectorCoeffType >
void Antioch::BerthelotHercourtEssenRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
VectorCoeffType  new_value 
)
inline

for compatibility purpose with photochemistry (particle flux reactions)

Definition at line 88 of file berthelothercourtessen_rate.h.

References antioch_error.

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

Member Data Documentation

template<typename CoeffType = double>
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::_Cf
private
template<typename CoeffType = double>
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::_D
private
template<typename CoeffType = double>
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::_eta
private
template<typename CoeffType = double>
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::_raw_Cf
private
template<typename CoeffType = double>
CoeffType Antioch::BerthelotHercourtEssenRate< CoeffType >::_Tref
private
template<typename CoeffType = double>
_Cf(*) StateType StateType& drate_d Antioch::BerthelotHercourtEssenRate< CoeffType >::const)

Definition at line 128 of file berthelothercourtessen_rate.h.

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

Definition at line 128 of file berthelothercourtessen_rate.h.

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

Definition at line 152 of file berthelothercourtessen_rate.h.

Referenced by test_values(), and vectester().

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

Simultaneously evaluate the rate and its derivative at T.

Definition at line 124 of file berthelothercourtessen_rate.h.

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

Simultaneously evaluate the rate and its derivative at T.

Definition at line 148 of file berthelothercourtessen_rate.h.


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

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