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

Berthelot rate equation. More...

#include <berthelot_rate.h>

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

Public Member Functions

 BerthelotRate (const CoeffType Cf=0., const CoeffType D=0.)
 
 ~BerthelotRate ()
 
void set_Cf (const CoeffType Cf)
 
void set_D (const CoeffType D)
 
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...
 
void scale_D (const CoeffType scale)
 
CoeffType Cf () const
 
CoeffType D () const
 
template<typename StateType >
 rate (const StateType &T) const ANTIOCH_AUTOFUNC(StateType
 
_Cfant_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 (_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) 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) 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 Attributes

CoeffType _Cf
 
CoeffType _D
 

Detailed Description

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

Berthelot rate equation.

The Berthelot kinetics model is of the form:

\[ \alpha(T) = A \exp\left(D T\right) \]

thus

\[ \frac{\partial\alpha(T)}{\partial T} = \alpha(T) D \]

Definition at line 55 of file berthelot_rate.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::BerthelotRate< CoeffType >::BerthelotRate ( const CoeffType  Cf = 0.,
const CoeffType  D = 0. 
)

Definition at line 147 of file berthelot_rate.h.

148  : KineticsType<CoeffType>(KineticsModel::BERTHELOT),
149  _Cf(Cf),
150  _D(D)
151  {
152  return;
153  }
CoeffType D() const
CoeffType Cf() const
template<typename CoeffType >
Antioch::BerthelotRate< CoeffType >::~BerthelotRate ( )

Definition at line 156 of file berthelot_rate.h.

157  {
158  return;
159  }

Member Function Documentation

template<typename CoeffType = double>
_Cf* Antioch::BerthelotRate< CoeffType >::ant_exp ( _D T) const
Returns
the rate evaluated at T.
the derivative with respect to temperature evaluated at T.
template<typename CoeffType = double>
_Cf* Antioch::BerthelotRate< CoeffType >::ant_exp ( _D *T.  T())
Returns
the rate evaluated at T.
template<typename CoeffType >
CoeffType Antioch::BerthelotRate< CoeffType >::Cf ( ) const
inline
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::BerthelotRate< CoeffType >::D ( ) const
inline
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::derivative ( const StateType &  conditions) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType VectorStateType Antioch::BerthelotRate< CoeffType >::derivative ( const KineticsConditions< StateType, VectorStateType > &  T) const

Referenced by test_values(), and vectester().

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

get one parameter, characterized by enum

Definition at line 224 of file berthelot_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::BerthelotRate< CoeffType >::Cf(), Antioch::KineticsModel::D, and Antioch::BerthelotRate< CoeffType >::D().

225  {
226  switch(parameter)
227  {
229  {
230  return this->Cf();
231  }
232  break;
234  {
235  return this->D();
236  }
237  break;
238  default:
239  {
240  antioch_error();
241  }
242  break;
243  }
244  return 0;
245  }
CoeffType D() const
#define antioch_error()
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::BerthelotRate< CoeffType >::numeric ( ) const
virtual

print equation

Implements Antioch::KineticsType< CoeffType >.

Definition at line 162 of file berthelot_rate.h.

References Antioch::BerthelotRate< CoeffType >::_Cf.

163  {
164  std::stringstream os;
165  os << _Cf;
166  os << "*exp(" << _D << "*T)";
167 
168  return os.str();
169  }
StateType Antioch::KineticsType< CoeffType, VectorCoeffType >::operator() ( const StateType &  temp) const
inherited
template<typename CoeffType = double>
_Cf VectorStateType Antioch::BerthelotRate< 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::BerthelotRate< CoeffType >::rate ( const StateType &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType = double>
template<typename StateType , typename VectorStateType >
Antioch::BerthelotRate< CoeffType >::rate ( const KineticsConditions< StateType, VectorStateType > &  T) const
Returns
the rate evaluated at T.
template<typename CoeffType >
template<typename VectorCoeffType >
void Antioch::BerthelotRate< CoeffType >::reset_coefs ( const VectorCoeffType &  coefficients)
inline

reset the coeffs

You require exactly two parameters, the order assumed is Cf, D

Definition at line 191 of file berthelot_rate.h.

References antioch_assert_equal_to, Antioch::BerthelotRate< CoeffType >::set_Cf(), and Antioch::BerthelotRate< CoeffType >::set_D().

Referenced by tester().

192  {
193  antioch_assert_equal_to(coefficients.size(),2);
194  this->set_Cf(coefficients[0]);
195  this->set_D(coefficients[1]);
196  }
#define antioch_assert_equal_to(expr1, expr2)
void set_D(const CoeffType D)
void set_Cf(const CoeffType Cf)
template<typename CoeffType >
void Antioch::BerthelotRate< CoeffType >::scale_D ( const CoeffType  scale)
inline

Definition at line 249 of file berthelot_rate.h.

250  {
251  _D *= scale;
252  return;
253  }
template<typename CoeffType >
void Antioch::BerthelotRate< CoeffType >::set_Cf ( const CoeffType  Cf)
inline
template<typename CoeffType >
void Antioch::BerthelotRate< CoeffType >::set_D ( const CoeffType  D)
inline
void Antioch::KineticsType< CoeffType, VectorCoeffType >::set_index ( unsigned int  nr)
inherited
template<typename CoeffType >
void Antioch::BerthelotRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
CoeffType  new_value 
)
inline

set one parameter, characterized by enum

Definition at line 200 of file berthelot_rate.h.

References Antioch::KineticsModel::A, antioch_error, Antioch::KineticsModel::D, Antioch::BerthelotRate< CoeffType >::set_Cf(), and Antioch::BerthelotRate< CoeffType >::set_D().

201  {
202  switch(parameter)
203  {
205  {
206  this->set_Cf(new_value);
207  }
208  break;
210  {
211  this->set_D(new_value);
212  }
213  break;
214  default:
215  {
216  antioch_error();
217  }
218  break;
219  }
220  }
#define antioch_error()
void set_D(const CoeffType D)
void set_Cf(const CoeffType Cf)
template<typename CoeffType = double>
template<typename VectorCoeffType >
void Antioch::BerthelotRate< CoeffType >::set_parameter ( KineticsModel::Parameters  parameter,
VectorCoeffType  new_value 
)
inline

for compatibility purpose with photochemistry (particle flux reactions)

Definition at line 81 of file berthelot_rate.h.

References antioch_error.

81 {antioch_error();}
#define antioch_error()
KineticsModel::KineticsModel Antioch::KineticsType< CoeffType, VectorCoeffType >::type ( ) const
inherited

Member Data Documentation

template<typename CoeffType = double>
CoeffType Antioch::BerthelotRate< CoeffType >::_Cf
private
template<typename CoeffType = double>
CoeffType Antioch::BerthelotRate< CoeffType >::_D
private

Definition at line 61 of file berthelot_rate.h.

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

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

Definition at line 116 of file berthelot_rate.h.

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

Definition at line 116 of file berthelot_rate.h.

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

Definition at line 140 of file berthelot_rate.h.

Referenced by test_values(), and vectester().

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

Simultaneously evaluate the rate and its derivative at T.

Definition at line 112 of file berthelot_rate.h.

template<typename CoeffType = double>
_Cf VectorStateType VectorStateType(* Antioch::BerthelotRate< CoeffType >::this)(T)*_D)template< typename StateType

Simultaneously evaluate the rate and its derivative at T.

Definition at line 136 of file berthelot_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