antioch-0.4.0
|
A single reaction mechanism. More...
#include <reaction.h>
Public Member Functions | |
Reaction (const unsigned int n_species, const std::string &equation, const bool &reversible=true, const ReactionType::ReactionType type=ReactionType::ELEMENTARY, const KineticsModel::KineticsModel kin=KineticsModel::KOOIJ) | |
Construct a single reaction mechanism. More... | |
virtual | ~Reaction () |
unsigned int | n_species () const |
const std::string & | equation () const |
const std::string & | id () const |
void | set_id (const std::string &id) |
set the reaction id. More... | |
ReactionType::ReactionType | type () const |
Type of reaction. More... | |
void | set_type (const ReactionType::ReactionType type) |
Set the type of reaction. More... | |
void | set_reversibility (const bool reversible) |
Set the reversibility of reaction. More... | |
KineticsModel::KineticsModel | kinetics_model () const |
Model of kinetics. More... | |
void | set_kinetics_model (const KineticsModel::KineticsModel kin) |
Set the model of kinetics. More... | |
bool | initialized () const |
void | set_parameter_of_rate (KineticsModel::Parameters parameter, CoeffType new_value, unsigned int n_reaction=0, const std::string &unit="SI") |
reset a parameter from the rate constant More... | |
void | set_parameter_of_rate (KineticsModel::Parameters parameter, CoeffType new_value, unsigned int n_reaction, int l, const std::string &unit="SI") |
reset a parameter from the rate constant, vector parameters More... | |
CoeffType | get_parameter_of_rate (KineticsModel::Parameters parameter, unsigned int n_reaction=0, const std::string &unit="SI") const |
get a parameter from the rate constant More... | |
CoeffType | get_parameter_of_rate (KineticsModel::Parameters parameter, unsigned int n_reaction, const std::string &unit, int l) const |
get a parameter from the rate constant, vectorized version More... | |
void | set_parameter_of_chemical_process (ReactionType::Parameters parameter, CoeffType new_value, unsigned int species=std::numeric_limits< unsigned int >::max()) |
reset a parameter from the chemical process More... | |
CoeffType | get_parameter_of_chemical_process (ReactionType::Parameters parameter, unsigned int species=std::numeric_limits< unsigned int >::max()) const |
get a parameter from the chemical process More... | |
bool | reversible () const |
unsigned int | n_reactants () const |
unsigned int | n_products () const |
const std::string & | reactant_name (const unsigned int r) const |
const std::string & | product_name (const unsigned int p) const |
unsigned int | reactant_id (const unsigned int r) const |
unsigned int | product_id (const unsigned int p) const |
unsigned int | reactant_stoichiometric_coefficient (const unsigned int r) const |
unsigned int | product_stoichiometric_coefficient (const unsigned int p) const |
CoeffType | reactant_partial_order (const unsigned int r) const |
CoeffType | product_partial_order (const unsigned int p) const |
void | add_reactant (const std::string &name, const unsigned int r_id, const unsigned int stoichiometric_coeff, const CoeffType partial_order=std::numeric_limits< CoeffType >::infinity()) |
void | add_product (const std::string &name, const unsigned int p_id, const unsigned int stoichiometric_coeff, const CoeffType partial_order=std::numeric_limits< CoeffType >::infinity()) |
void | clear_reactant () |
void | clear_product () |
void | set_efficiency (const std::string &, const unsigned int s, const CoeffType efficiency) |
CoeffType | get_efficiency (const unsigned int s) const |
CoeffType | efficiency (const unsigned int s) const |
void | initialize (unsigned int index=0) |
Computes derived quantities. More... | |
int | gamma () const |
template<typename StateType , typename VectorStateType > | |
StateType | equilibrium_constant (const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R) const |
template<typename StateType , typename VectorStateType > | |
void | equilibrium_constant_and_derivative (const StateType &T, const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R, const VectorStateType &ddT_h_RT_minus_s_R, StateType &keq, StateType &dkeq_dT) const |
template<typename StateType , typename VectorStateType > | |
StateType | compute_forward_rate_coefficient (const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions) const |
template<typename StateType , typename VectorStateType > | |
StateType | compute_forward_rate_coefficient (const VectorStateType &molar_densities, const StateType &temp) const |
template<typename StateType , typename VectorStateType > | |
void | compute_forward_rate_coefficient_and_derivatives (const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions, StateType &kfwd, StateType &dkfwd_dT, VectorStateType &dkfwd_dX) const |
template<typename StateType , typename VectorStateType > | |
void | compute_forward_rate_coefficient_and_derivatives (const VectorStateType &molar_densities, const StateType &temp, StateType &kfwd, StateType &dkfwd_dT, VectorStateType &dkfwd_dX) const |
template<typename StateType , typename VectorStateType > | |
StateType | compute_rate_of_progress (const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions, const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R) const |
template<typename StateType , typename VectorStateType > | |
StateType | compute_rate_of_progress (const VectorStateType &molar_densities, const StateType &temp, const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R) const |
template<typename StateType , typename VectorStateType > | |
void | compute_rate_of_progress_and_derivatives (const VectorStateType &molar_densities, const ChemicalMixture< CoeffType > &, const KineticsConditions< StateType, VectorStateType > &conditions, const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R, const VectorStateType &dh_RT_minus_s_R_dT, StateType &net_reaction_rate, StateType &dnet_rate_dT, VectorStateType &dnet_rate_dX_s) const |
template<typename StateType , typename VectorStateType > | |
void | compute_rate_of_progress_and_derivatives (const VectorStateType &molar_densities, const ChemicalMixture< CoeffType > &chem_mixture, const StateType &temp, const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R, const VectorStateType &dh_RT_minus_s_R_dT, StateType &net_reaction_rate, StateType &dnet_rate_dT, VectorStateType &dnet_rate_dX_s) const |
const KineticsType< CoeffType, VectorCoeffType > & | forward_rate (unsigned int ir=0) const |
Return const reference to the forward rate object. More... | |
KineticsType< CoeffType, VectorCoeffType > & | forward_rate (unsigned int ir=0) |
Return writeable reference to the forward rate object. More... | |
template<typename FalloffType > | |
FalloffType & | falloff () |
Return writeable reference to the falloff object, test type. More... | |
void | add_forward_rate (KineticsType< CoeffType, VectorCoeffType > *rate) |
Add a forward rate object. More... | |
void | swap_forward_rates (unsigned int irate, unsigned int jrate) |
Swap two forward rates object. More... | |
unsigned int | n_rate_constants () const |
Return the number of rate constant objects. More... | |
void | print (std::ostream &os=std::cout) const |
Formatted print, by default to std::cout . More... | |
Protected Attributes | |
unsigned int | _n_species |
std::string | _id |
std::string | _equation |
std::vector< std::string > | _reactant_names |
std::vector< std::string > | _product_names |
std::vector< unsigned int > | _reactant_ids |
std::vector< unsigned int > | _product_ids |
std::vector< unsigned int > | _reactant_stoichiometry |
std::vector< unsigned int > | _product_stoichiometry |
std::vector< unsigned int > | _species_reactant_stoichiometry |
std::vector< unsigned int > | _species_product_stoichiometry |
std::vector< CoeffType > | _species_reactant_partial_order |
std::vector< CoeffType > | _species_product_partial_order |
std::vector< int > | _species_delta_stoichiometry |
int | _gamma |
bool | _initialized |
bool | _reversible |
ReactionType::ReactionType | _type |
KineticsModel::KineticsModel | _kintype |
std::vector< KineticsType < CoeffType, VectorCoeffType > * > | _forward_rate |
The forward reaction rate modified Arrhenius form. More... | |
std::vector< CoeffType > | _efficiencies |
efficiencies for three body reactions More... | |
Private Member Functions | |
Reaction () | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Reaction &rxn) |
Formatted print. More... | |
A single reaction mechanism.
A reaction is characterized by the rate constant , which can be decomposed into a chemical process and a kinetics model:
with the chemical process and the kinetics model.
This virtual base is derived for the following processes:
This class encapsulates a kinetics model. The choosable kinetics models are
By default, we choose a reversible ElementaryReaction with a KooijRate kinetics model.
Definition at line 108 of file reaction.h.
|
inline |
Construct a single reaction mechanism.
Definition at line 691 of file reaction.h.
|
inlinevirtual |
Definition at line 710 of file reaction.h.
|
private |
|
inline |
Add a forward rate object.
Definition at line 469 of file reaction.h.
Referenced by Antioch::read_reaction_set_data(), and tester().
|
inline |
Definition at line 605 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::read_reaction_set_data(), and tester().
|
inline |
Definition at line 588 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::read_reaction_set_data(), and tester().
|
inline |
Definition at line 631 of file reaction.h.
|
inline |
Definition at line 622 of file reaction.h.
|
inline |
Definition at line 866 of file reaction.h.
References antioch_error, Antioch::ReactionType::DUPLICATE, Antioch::ReactionType::ELEMENTARY, Antioch::ReactionType::LINDEMANN_FALLOFF, Antioch::ReactionType::LINDEMANN_FALLOFF_THREE_BODY, Antioch::KineticsConditions< StateType, VectorStateType >::T(), Antioch::ReactionType::THREE_BODY, Antioch::ReactionType::TROE_FALLOFF, Antioch::ReactionType::TROE_FALLOFF_THREE_BODY, and Antioch::zero_clone().
Referenced by Antioch::ReactionSet< CoeffType >::get_reactive_scheme(), and tester().
|
inline |
Definition at line 927 of file reaction.h.
References antioch_deprecated.
|
inline |
Definition at line 939 of file reaction.h.
References antioch_error, Antioch::ReactionType::DUPLICATE, Antioch::ReactionType::ELEMENTARY, Antioch::ReactionType::LINDEMANN_FALLOFF, Antioch::ReactionType::LINDEMANN_FALLOFF_THREE_BODY, Antioch::ReactionType::THREE_BODY, Antioch::ReactionType::TROE_FALLOFF, and Antioch::ReactionType::TROE_FALLOFF_THREE_BODY.
|
inline |
Definition at line 1003 of file reaction.h.
References antioch_deprecated.
|
inline |
Definition at line 1020 of file reaction.h.
References Antioch::zero_clone().
Referenced by tester().
|
inline |
Definition at line 1060 of file reaction.h.
References antioch_deprecated.
|
inline |
Definition at line 1075 of file reaction.h.
References antioch_assert_equal_to, Antioch::constant_clone(), Antioch::Constants::pi(), Antioch::set_zero(), Antioch::KineticsConditions< StateType, VectorStateType >::T(), and Antioch::zero_clone().
|
inline |
Definition at line 1242 of file reaction.h.
References antioch_deprecated.
|
inline |
Definition at line 658 of file reaction.h.
References antioch_assert.
|
inline |
Definition at line 410 of file reaction.h.
Referenced by Antioch::read_reaction_set_data().
|
inline |
Definition at line 751 of file reaction.h.
References antioch_assert, antioch_assert_equal_to, and antioch_assert_greater.
Referenced by Antioch::ReactionSet< CoeffType >::get_reactive_scheme().
|
inline |
Definition at line 785 of file reaction.h.
References antioch_assert, antioch_assert_equal_to, and antioch_assert_greater.
|
inline |
Return writeable reference to the falloff object, test type.
Definition at line 1263 of file reaction.h.
References antioch_error, Antioch::ReactionType::LINDEMANN_FALLOFF, Antioch::ReactionType::LINDEMANN_FALLOFF_THREE_BODY, Antioch::ReactionType::TROE_FALLOFF, and Antioch::ReactionType::TROE_FALLOFF_THREE_BODY.
|
inline |
Return const reference to the forward rate object.
Definition at line 674 of file reaction.h.
References antioch_assert_less.
|
inline |
Return writeable reference to the forward rate object.
Definition at line 682 of file reaction.h.
References antioch_assert_less.
|
inline |
Definition at line 667 of file reaction.h.
|
inline |
Definition at line 650 of file reaction.h.
References antioch_assert_less.
|
inline |
get a parameter from the chemical process
Definition at line 1415 of file reaction.h.
References antioch_error, Antioch::ReactionType::EFFICIENCIES, Antioch::ReactionType::TROE_ALPHA, Antioch::ReactionType::TROE_FALLOFF, Antioch::ReactionType::TROE_FALLOFF_THREE_BODY, Antioch::ReactionType::TROE_T1, Antioch::ReactionType::TROE_T2, and Antioch::ReactionType::TROE_T3.
|
inline |
get a parameter from the rate constant
Definition at line 1320 of file reaction.h.
References antioch_assert_less.
|
inline |
get a parameter from the rate constant, vectorized version
Definition at line 1328 of file reaction.h.
References antioch_assert_less.
|
inline |
Definition at line 396 of file reaction.h.
|
inline |
Computes derived quantities.
Definition at line 723 of file reaction.h.
Referenced by tester().
|
inline |
Definition at line 455 of file reaction.h.
|
inline |
|
inline |
Definition at line 508 of file reaction.h.
References antioch_assert_equal_to, and antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), Antioch::ReactionSet< CoeffType >::get_reactive_scheme(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
Return the number of rate constant objects.
Definition at line 477 of file reaction.h.
Referenced by Antioch::read_reaction_set_data().
|
inline |
Definition at line 498 of file reaction.h.
References antioch_assert_equal_to, and antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), Antioch::ReactionSet< CoeffType >::get_reactive_scheme(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
Definition at line 389 of file reaction.h.
|
inline |
Formatted print, by default to std::cout
.
Definition at line 824 of file reaction.h.
References Antioch::ReactionType::LINDEMANN_FALLOFF_THREE_BODY, Antioch::ReactionType::THREE_BODY, and Antioch::ReactionType::TROE_FALLOFF_THREE_BODY.
Referenced by tester().
|
inline |
Definition at line 543 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), Antioch::ReactionSet< CoeffType >::get_reactive_scheme(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
p
th product. Definition at line 526 of file reaction.h.
References antioch_assert_less.
|
inline |
Definition at line 579 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::ReactionSet< CoeffType >::get_reactive_scheme().
|
inline |
Definition at line 561 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
Definition at line 534 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), Antioch::ReactionSet< CoeffType >::get_reactive_scheme(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
r
th reactant. Definition at line 518 of file reaction.h.
References antioch_assert_less.
|
inline |
Definition at line 570 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::ReactionSet< CoeffType >::get_reactive_scheme().
|
inline |
Definition at line 552 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources(), Antioch::KineticsEvaluator< CoeffType, StateType >::compute_mole_sources_and_derivs(), and Antioch::ReactionSet< CoeffType >::print_chemical_scheme().
|
inline |
Definition at line 462 of file reaction.h.
Referenced by Antioch::ReactionSet< CoeffType >::get_reactive_scheme().
|
inline |
Definition at line 640 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::read_reaction_set_data().
|
inline |
set the reaction id.
Definition at line 403 of file reaction.h.
Referenced by Antioch::read_reaction_set_data().
|
inline |
|
inline |
reset a parameter from the chemical process
Definition at line 1336 of file reaction.h.
References antioch_error, Antioch::ReactionType::EFFICIENCIES, Antioch::ReactionType::TROE_ALPHA, Antioch::ReactionType::TROE_FALLOFF, Antioch::ReactionType::TROE_FALLOFF_THREE_BODY, Antioch::ReactionType::TROE_T1, Antioch::ReactionType::TROE_T2, and Antioch::ReactionType::TROE_T3.
|
inline |
reset a parameter from the rate constant
Definition at line 1304 of file reaction.h.
References antioch_assert_less, and Antioch::reset_parameter_of_rate().
|
inline |
reset a parameter from the rate constant, vector parameters
Definition at line 1312 of file reaction.h.
References antioch_assert_less, and Antioch::reset_parameter_of_rate().
|
inline |
Set the reversibility of reaction.
Definition at line 432 of file reaction.h.
Referenced by tester().
|
inline |
Set the type of reaction.
reversible reactions are considered.
Definition at line 424 of file reaction.h.
|
inline |
Swap two forward rates object.
Definition at line 484 of file reaction.h.
References antioch_assert_less.
Referenced by Antioch::read_reaction_set_data().
|
inline |
Type of reaction.
reversible reactions are considered.
Definition at line 417 of file reaction.h.
Referenced by Antioch::read_reaction_set_data().
|
friend |
Formatted print.
Definition at line 347 of file reaction.h.
|
protected |
efficiencies for three body reactions
Definition at line 379 of file reaction.h.
|
protected |
Definition at line 357 of file reaction.h.
|
protected |
The forward reaction rate modified Arrhenius form.
Definition at line 376 of file reaction.h.
|
protected |
Definition at line 369 of file reaction.h.
|
protected |
Definition at line 356 of file reaction.h.
|
protected |
Definition at line 370 of file reaction.h.
|
protected |
Definition at line 373 of file reaction.h.
|
protected |
Definition at line 355 of file reaction.h.
|
protected |
Definition at line 361 of file reaction.h.
|
protected |
Definition at line 359 of file reaction.h.
|
protected |
Definition at line 363 of file reaction.h.
|
protected |
Definition at line 360 of file reaction.h.
|
protected |
Definition at line 358 of file reaction.h.
|
protected |
Definition at line 362 of file reaction.h.
|
protected |
Definition at line 371 of file reaction.h.
|
protected |
Definition at line 368 of file reaction.h.
|
protected |
Definition at line 367 of file reaction.h.
|
protected |
Definition at line 365 of file reaction.h.
|
protected |
Definition at line 366 of file reaction.h.
|
protected |
Definition at line 364 of file reaction.h.
|
protected |
Definition at line 372 of file reaction.h.