28 #ifndef ANTIOCH_REACTION_H
29 #define ANTIOCH_REACTION_H
57 template <
typename CoeffType>
58 class ElementaryReaction;
60 template <
typename CoeffType>
61 class DuplicateReaction;
63 template <
typename CoeffType>
66 template <
typename CoeffType,
typename FalloffType>
69 template <
typename CoeffType,
typename FalloffType>
72 template <
typename CoeffType>
75 template <
typename CoeffType>
107 template<
typename CoeffType=
double,
typename VectorCoeffType = std::vector<CoeffType> >
123 const std::string &
equation()
const;
126 const std::string &
id()
const;
129 void set_id(
const std::string &
id);
183 const std::string&
reactant_name(
const unsigned int r)
const;
186 const std::string&
product_name(
const unsigned int p)
const;
189 unsigned int reactant_id(
const unsigned int r)
const;
192 unsigned int product_id(
const unsigned int p)
const;
208 const unsigned int r_id,
209 const unsigned int stoichiometric_coeff,
210 const CoeffType partial_order = std::numeric_limits<CoeffType>::infinity());
214 const unsigned int p_id,
215 const unsigned int stoichiometric_coeff,
216 const CoeffType partial_order = std::numeric_limits<CoeffType>::infinity());
226 const unsigned int s,
233 CoeffType
efficiency(
const unsigned int s)
const;
242 template <
typename StateType,
typename VectorStateType>
244 const VectorStateType& h_RT_minus_s_R )
const;
247 template <
typename StateType,
typename VectorStateType>
249 const StateType& P0_RT,
250 const VectorStateType& h_RT_minus_s_R,
251 const VectorStateType& ddT_h_RT_minus_s_R,
253 StateType& dkeq_dT)
const;
256 template <
typename StateType,
typename VectorStateType>
261 template <
typename StateType,
typename VectorStateType>
263 const StateType& temp)
268 template <
typename StateType,
typename VectorStateType>
273 VectorStateType& dkfwd_dX)
const;
276 template <
typename StateType,
typename VectorStateType>
282 VectorStateType& dkfwd_dX)
const;
285 template <
typename StateType,
typename VectorStateType>
288 const StateType& P0_RT,
289 const VectorStateType& h_RT_minus_s_R)
const;
292 template <
typename StateType,
typename VectorStateType>
294 const StateType& temp,
295 const StateType& P0_RT,
296 const VectorStateType& h_RT_minus_s_R)
const;
298 template <
typename StateType,
typename VectorStateType>
302 const StateType &P0_RT,
303 const VectorStateType &h_RT_minus_s_R,
304 const VectorStateType &dh_RT_minus_s_R_dT,
305 StateType& net_reaction_rate,
306 StateType& dnet_rate_dT,
307 VectorStateType& dnet_rate_dX_s )
const;
310 template <
typename StateType,
typename VectorStateType>
313 const StateType& temp,
314 const StateType &P0_RT,
315 const VectorStateType &h_RT_minus_s_R,
316 const VectorStateType &dh_RT_minus_s_R_dT,
317 StateType& net_reaction_rate,
318 StateType& dnet_rate_dT,
319 VectorStateType& dnet_rate_dX_s )
const;
331 template <
typename FalloffType>
344 void print(std::ostream& os = std::cout)
const;
387 template<
typename CoeffType,
typename VectorCoeffType>
394 template<
typename CoeffType,
typename VectorCoeffType>
401 template<
typename CoeffType,
typename VectorCoeffType>
408 template<
typename CoeffType,
typename VectorCoeffType>
415 template<
typename CoeffType,
typename VectorCoeffType>
422 template<
typename CoeffType,
typename VectorCoeffType>
430 template<
typename CoeffType,
typename VectorCoeffType>
434 _reversible = reversible;
438 template<
typename CoeffType,
typename VectorCoeffType>
445 template<
typename CoeffType,
typename VectorCoeffType>
453 template<
typename CoeffType,
typename VectorCoeffType>
460 template<
typename CoeffType,
typename VectorCoeffType>
467 template<
typename CoeffType,
typename VectorCoeffType>
471 _forward_rate.push_back(rate);
475 template<
typename CoeffType,
typename VectorCoeffType>
479 return _forward_rate.size();
482 template<
typename CoeffType,
typename VectorCoeffType>
490 _forward_rate[jrate] = _forward_rate[irate];
491 _forward_rate[irate] = rate_tmp;
496 template<
typename CoeffType,
typename VectorCoeffType>
503 return _reactant_ids.size();
506 template<
typename CoeffType,
typename VectorCoeffType>
513 return _product_ids.size();
516 template<
typename CoeffType,
typename VectorCoeffType>
521 return _reactant_names[r];
524 template<
typename CoeffType,
typename VectorCoeffType>
529 return _product_names[p];
532 template<
typename CoeffType,
typename VectorCoeffType>
538 return _reactant_ids[r];
541 template<
typename CoeffType,
typename VectorCoeffType>
547 return _product_ids[p];
550 template<
typename CoeffType,
typename VectorCoeffType>
556 return _reactant_stoichiometry[r];
559 template<
typename CoeffType,
typename VectorCoeffType>
565 return _product_stoichiometry[p];
568 template<
typename CoeffType,
typename VectorCoeffType>
574 return _species_reactant_partial_order[r];
577 template<
typename CoeffType,
typename VectorCoeffType>
583 return _species_product_partial_order[p];
586 template<
typename CoeffType,
typename VectorCoeffType>
589 const unsigned int r_id,
590 const unsigned int stoichiometric_coeff,
591 const CoeffType partial_order)
594 _reactant_names.push_back(name);
595 _reactant_ids.push_back(r_id);
596 _reactant_stoichiometry.push_back(stoichiometric_coeff);
598 CoeffType order = (partial_order == std::numeric_limits<CoeffType>::infinity() )?static_cast<CoeffType>(stoichiometric_coeff):partial_order;
599 _species_reactant_partial_order.push_back(order);
603 template<
typename CoeffType,
typename VectorCoeffType>
606 const unsigned int p_id,
607 const unsigned int stoichiometric_coeff,
608 const CoeffType partial_order)
611 _product_names.push_back(name);
612 _product_ids.push_back(p_id);
613 _product_stoichiometry.push_back(stoichiometric_coeff);
615 CoeffType order = (partial_order == std::numeric_limits<CoeffType>::infinity() )?static_cast<CoeffType>(stoichiometric_coeff):partial_order;
616 _species_product_partial_order.push_back(order);
620 template<
typename CoeffType,
typename VectorCoeffType>
624 _reactant_names.clear();
625 _reactant_ids.clear();
626 _reactant_stoichiometry.clear();
629 template<
typename CoeffType,
typename VectorCoeffType>
633 _product_names.clear();
634 _product_ids.clear();
635 _product_stoichiometry.clear();
638 template<
typename CoeffType,
typename VectorCoeffType>
641 const unsigned int s,
642 const CoeffType efficiency)
645 _efficiencies[s] = efficiency;
648 template<
typename CoeffType,
typename VectorCoeffType>
653 return _efficiencies[s];
656 template<
typename CoeffType,
typename VectorCoeffType>
662 return _efficiencies[s];
665 template<
typename CoeffType,
typename VectorCoeffType>
672 template<
typename CoeffType,
typename VectorCoeffType>
677 return *_forward_rate[ir];
680 template<
typename CoeffType,
typename VectorCoeffType>
685 return *_forward_rate[ir];
689 template<
typename CoeffType,
typename VectorCoeffType>
692 const std::string &equation,
693 const bool &reversible,
696 : _n_species(n_species),
700 _reversible(reversible),
708 template<
typename CoeffType,
typename VectorCoeffType>
712 for(
unsigned int ir = 0; ir < _forward_rate.size(); ir++)
714 delete _forward_rate[ir];
721 template<
typename CoeffType,
typename VectorCoeffType>
726 for (
unsigned int r=0; r< this->n_reactants(); r++)
728 _gamma -= this->reactant_stoichiometric_coefficient(r);
731 for (
unsigned int p=0; p < this->n_products(); p++)
733 _gamma += this->product_stoichiometric_coefficient(p);
738 it != _forward_rate.end(); it++)
740 (*it)->set_index(index);
748 template<
typename CoeffType,
typename VectorCoeffType>
749 template<
typename StateType,
typename VectorStateType>
752 const VectorStateType& h_RT_minus_s_R )
const
764 StateType exppower = (
static_cast<CoeffType
>(_reactant_stoichiometry[0])*
765 h_RT_minus_s_R[_reactant_ids[0]] );
767 for (
unsigned int s=1; s < this->n_reactants(); s++)
769 exppower += (
static_cast<CoeffType
>(_reactant_stoichiometry[s])*
770 h_RT_minus_s_R[_reactant_ids[s]] );
773 for (
unsigned int s=0; s < this->n_products(); s++)
775 exppower -= (
static_cast<CoeffType
>(_product_stoichiometry[s])*
776 h_RT_minus_s_R[_product_ids[s]] );
778 return ant_pow( P0_RT, static_cast<CoeffType>(this->gamma()) ) * ant_exp(exppower);
782 template<
typename CoeffType,
typename VectorCoeffType>
783 template<
typename StateType,
typename VectorStateType>
786 const StateType& P0_RT,
787 const VectorStateType& h_RT_minus_s_R,
788 const VectorStateType& ddT_h_RT_minus_s_R,
790 StateType& dkeq_dT)
const
802 keq = this->equilibrium_constant( P0_RT, h_RT_minus_s_R );
804 StateType ddT_exppower = (
static_cast<CoeffType
>(_reactant_stoichiometry[0])*
805 ddT_h_RT_minus_s_R[_reactant_ids[0]] );
807 for (
unsigned int s=1; s<this->n_reactants(); s++)
808 ddT_exppower += ( static_cast<CoeffType>(_reactant_stoichiometry[s])*
809 ddT_h_RT_minus_s_R[_reactant_ids[s]] );
811 for (
unsigned int s=0; s<this->n_products(); s++)
812 ddT_exppower -= ( static_cast<CoeffType>(_product_stoichiometry[s])*
813 ddT_h_RT_minus_s_R[_product_ids[s]] );
816 dkeq_dT = keq*(-
static_cast<CoeffType
>(this->gamma())/T + ddT_exppower);
822 template<
typename CoeffType,
typename VectorCoeffType>
826 os <<
"# Gas-Phase Reaction \"" << _equation <<
"\":\n";
827 if (this->n_species())
829 os <<
"# reactants: ";
830 for (
unsigned int r=0; r<this->n_reactants(); r++)
831 os << this->reactant_name(r) <<
":"
832 << this->reactant_stoichiometric_coefficient(r) <<
","
833 << this->reactant_partial_order(r) <<
" ";
836 for (
unsigned int p=0; p<this->n_products(); p++)
837 os << this->product_name(p) <<
":"
838 << this->product_stoichiometric_coefficient(p) <<
","
839 << this->product_partial_order(p) <<
" ";
841 os <<
"\n# Chemical process: " << _type;
842 os <<
"\n# Kinetics model: " << _kintype;
843 (_reversible)?os <<
"\n# reversible":
844 os <<
"\n# irreversible";
845 for(
unsigned int ir = 0; ir < _forward_rate.size(); ir++)
847 os <<
"\n# forward rate eqn: " << *_forward_rate[ir];
854 os <<
"\n# efficiencies: ";
855 for (
unsigned int s=0; s<this->n_species(); s++)
856 os << s <<
":" << this->efficiency(s) <<
" ";
863 template<
typename CoeffType,
typename VectorCoeffType>
864 template <
typename StateType,
typename VectorStateType>
923 template<
typename CoeffType,
typename VectorCoeffType>
924 template <
typename StateType,
typename VectorStateType>
927 (
const VectorStateType& molar_densities,
928 const StateType& temp)
const
931 return compute_forward_rate_coefficient
936 template<
typename CoeffType,
typename VectorCoeffType>
937 template <
typename StateType,
typename VectorStateType>
943 VectorStateType& dkfwd_dX)
const
949 (
static_cast<const ElementaryReaction<CoeffType>*
>(
this))->compute_forward_rate_coefficient_and_derivatives(molar_densities,conditions,kfwd,dkfwd_dT,dkfwd_dX);
955 (
static_cast<const DuplicateReaction<CoeffType>*
>(
this))->compute_forward_rate_coefficient_and_derivatives(molar_densities,conditions,kfwd,dkfwd_dT,dkfwd_dX);
961 (
static_cast<const ThreeBodyReaction<CoeffType>*
>(
this))->compute_forward_rate_coefficient_and_derivatives(molar_densities,conditions,kfwd,dkfwd_dT,dkfwd_dX);
998 template<
typename CoeffType,
typename VectorCoeffType>
999 template <
typename StateType,
typename VectorStateType>
1003 (
const VectorStateType& molar_densities,
1004 const StateType& temp,
1006 StateType& dkfwd_dT,
1007 VectorStateType& dkfwd_dX)
const
1010 return compute_forward_rate_coefficient_and_derivatives
1013 kfwd, dkfwd_dT, dkfwd_dX);
1017 template<
typename CoeffType,
typename VectorCoeffType>
1018 template <
typename StateType,
typename VectorStateType>
1022 const StateType& P0_RT,
1023 const VectorStateType& h_RT_minus_s_R)
const
1025 StateType kfwd = this->compute_forward_rate_coefficient(molar_densities,conditions);
1026 StateType kfwd_times_reactants = kfwd;
1029 for (
unsigned int ro=0; ro < this->n_reactants(); ro++)
1031 kfwd_times_reactants *=
1032 ant_pow( molar_densities[this->reactant_id(ro)],
1033 this->reactant_partial_order(ro));
1040 StateType Keq = this->equilibrium_constant( P0_RT, h_RT_minus_s_R );
1041 kbkwd_times_products = kfwd/Keq;
1044 for (
unsigned int po=0; po< this->n_products(); po++)
1046 kbkwd_times_products *=
1047 ant_pow( molar_densities[this->product_id(po)],
1048 this->product_partial_order(po));
1053 return kfwd_times_reactants - kbkwd_times_products;
1057 template<
typename CoeffType,
typename VectorCoeffType>
1058 template <
typename StateType,
typename VectorStateType>
1061 const StateType& temp,
1062 const StateType& P0_RT,
1063 const VectorStateType& h_RT_minus_s_R)
const
1066 return compute_rate_of_progress
1069 P0_RT, h_RT_minus_s_R);
1072 template<
typename CoeffType,
typename VectorCoeffType>
1073 template <
typename StateType,
typename VectorStateType>
1078 const StateType &P0_RT,
1079 const VectorStateType &h_RT_minus_s_R,
1080 const VectorStateType &dh_RT_minus_s_R_dT,
1081 StateType& net_reaction_rate,
1082 StateType& dnet_rate_dT,
1083 VectorStateType& dnet_rate_dX_s )
const
1094 this->compute_forward_rate_coefficient_and_derivatives(molar_densities, conditions, kfwd, dkfwd_dT ,dkfwd_dX_s);
1105 VectorStateType dRfwd_dX_s(this->n_species(), kfwd);
1110 for (
unsigned int r=0; r< this->n_reactants(); r++)
1112 dRfwd_dX_s[this->reactant_id(r)] = kfwd;
1117 dRfwd_dT = dkfwd_dT;
1120 for (
unsigned int ro=0; ro < this->n_reactants(); ro++)
1122 const StateType val =
1123 ant_pow( molar_densities[this->reactant_id(ro)],
1124 this->reactant_partial_order(ro));
1126 const StateType dval =
1127 (
static_cast<CoeffType
>(this->reactant_stoichiometric_coefficient(ro))*
1128 ant_pow( molar_densities[this->reactant_id(ro)],
1129 this->reactant_partial_order(ro) - 1)
1135 for (
unsigned int ri=0; ri<this->n_reactants(); ri++)
1137 dRfwd_dX_s[this->reactant_id(ri)] *= (ri == ro) ? dval : val;
1141 for (
unsigned int s = 0; s < this->n_species(); s++)
1143 dRfwd_dX_s[s] += facfwd * dkfwd_dX_s[s];
1146 net_reaction_rate = facfwd * kfwd;
1148 dnet_rate_dT = dRfwd_dT;
1150 for (
unsigned int s = 0; s < this->n_species(); s++)
1152 dnet_rate_dX_s[s] = dRfwd_dX_s[s];
1163 equilibrium_constant_and_derivative( conditions.
T(), P0_RT, h_RT_minus_s_R,
1167 const StateType kbkwd = kfwd/keq;
1168 const StateType dkbkwd_dT = (dkfwd_dT - kbkwd*dkeq_dT)/keq;
1169 for(
unsigned int s = 0; s < this->n_species(); s++)
1171 dkbkwd_dX_s[s] = dkfwd_dX_s[s]/keq;
1183 VectorStateType dRbkwd_dX_s(this->n_species(), kbkwd);
1188 for (
unsigned int p=0; p < this->n_products(); p++)
1190 dRbkwd_dX_s[this->product_id(p)] = kbkwd;
1195 dRbkwd_dT = dkbkwd_dT;
1198 for (
unsigned int po=0; po< this->n_products(); po++)
1200 const StateType val =
1201 ant_pow( molar_densities[this->product_id(po)],
1202 this->product_partial_order(po));
1204 const StateType dval =
1205 (
static_cast<CoeffType
>(this->product_stoichiometric_coefficient(po))*
1206 ant_pow( molar_densities[this->product_id(po)],
1207 this->product_partial_order(po) - 1)
1213 for (
unsigned int pi=0;
pi<this->n_products();
pi++)
1215 dRbkwd_dX_s[this->product_id(
pi)] *= (
pi == po) ? dval : val;
1220 for (
unsigned int s = 0; s < this->n_species(); s++)
1222 dRbkwd_dX_s[s] += facbkwd * dkbkwd_dX_s[s];
1225 net_reaction_rate -= facbkwd * kbkwd;
1227 dnet_rate_dT -= dRbkwd_dT;
1229 for (
unsigned int s = 0; s < this->n_species(); s++)
1231 dnet_rate_dX_s[s] -= dRbkwd_dX_s[s];
1239 template<
typename CoeffType,
typename VectorCoeffType>
1240 template <
typename StateType,
typename VectorStateType>
1244 const StateType& temp,
1245 const StateType &P0_RT,
1246 const VectorStateType &h_RT_minus_s_R,
1247 const VectorStateType &dh_RT_minus_s_R_dT,
1248 StateType& net_reaction_rate,
1249 StateType& dnet_rate_dT,
1250 VectorStateType& dnet_rate_dX_s )
const
1253 return compute_rate_of_progress_and_derivatives
1254 (molar_densities, chem_mixture,
1256 P0_RT, h_RT_minus_s_R, dh_RT_minus_s_R_dT, net_reaction_rate,
1257 dnet_rate_dT, dnet_rate_dX_s);
1260 template<
typename CoeffType,
typename VectorCoeffType>
1261 template <
typename FalloffType>
1293 std::cerr <<
"You are trying to retrieve a Falloff object in a reaction that is not a falloff.\n"
1294 <<
"The reaction is " << *
this << std::endl;
1302 template<
typename CoeffType,
typename VectorCoeffType>
1310 template<
typename CoeffType,
typename VectorCoeffType>
1318 template<
typename CoeffType,
typename VectorCoeffType>
1323 return _forward_rate[n_reaction]->get_parameter(parameter);
1326 template<
typename CoeffType,
typename VectorCoeffType>
1331 return _forward_rate[n_reaction]->get_parameter(parameter,l);
1334 template<
typename CoeffType,
typename VectorCoeffType>
1342 this->set_efficiency(std::string(),species,new_value);
1413 template<
typename CoeffType,
typename VectorCoeffType>
1422 value = this->get_efficiency(species);
1497 #endif // ANTIOCH_REACTION_H
#define antioch_assert(asserted)
StateType equilibrium_constant(const StateType &P0_RT, const VectorStateType &h_RT_minus_s_R) 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())
FalloffType & falloff()
Return writeable reference to the falloff object, test type.
StateType compute_forward_rate_coefficient(const VectorStateType &molar_densities, const KineticsConditions< StateType, VectorStateType > &conditions) const
A single reaction mechanism.
Simplest falloff model ( )
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
void initialize(unsigned int index=0)
Computes derived quantities.
std::vector< unsigned int > _product_ids
const std::string & equation() const
base class for kinetics models
#define antioch_assert_equal_to(expr1, expr2)
ReactionType::ReactionType _type
unsigned int n_species() const
#define antioch_assert_greater(expr1, expr2)
Base class for falloff processes coupled with efficiencies.
KineticsModel::KineticsModel _kintype
void reset_parameter_of_rate(KineticsType< CoeffType, VectorCoeffType > &rate, KineticsModel::Parameters parameter, const CoeffType new_value, const std::string &unit="SI")
The rate constant models derived from the Arrhenius model have an activation energy which is stored a...
void set_type(const ReactionType::ReactionType type)
Set the type of reaction.
std::vector< unsigned int > _product_stoichiometry
void set_id(const std::string &id)
set the reaction id.
#define antioch_assert_less(expr1, expr2)
const std::string & id() const
std::vector< CoeffType > _species_reactant_partial_order
CoeffType get_efficiency(const unsigned int s) 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
std::vector< int > _species_delta_stoichiometry
const std::string & reactant_name(const unsigned int r) const
A single reaction mechanism.
std::vector< unsigned int > _reactant_stoichiometry
unsigned int product_stoichiometric_coefficient(const unsigned int p) const
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
Base class for falloff processes.
void set_reversibility(const bool reversible)
Set the reversibility of reaction.
unsigned int reactant_id(const unsigned int r) const
CoeffType product_partial_order(const unsigned int p) const
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > constant_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex, const Scalar &value)
max(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
unsigned int n_rate_constants() const
Return the number of rate constant objects.
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
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
std::vector< std::string > _product_names
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
void add_forward_rate(KineticsType< CoeffType, VectorCoeffType > *rate)
Add a forward rate object.
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
std::vector< KineticsType< CoeffType, VectorCoeffType > * > _forward_rate
The forward reaction rate modified Arrhenius form.
std::vector< CoeffType > _species_product_partial_order
#define antioch_deprecated()
A single reaction mechanism.
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())
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
const KineticsType< CoeffType, VectorCoeffType > & forward_rate(unsigned int ir=0) const
Return const reference to the forward rate object.
unsigned int n_products() const
void set_zero(_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a)
std::vector< std::string > _reactant_names
std::vector< unsigned int > _species_reactant_stoichiometry
void set_kinetics_model(const KineticsModel::KineticsModel kin)
Set the model of kinetics.
A single reaction mechanism.
Class storing chemical mixture properties.
std::vector< unsigned int > _reactant_ids
ReactionType::ReactionType type() const
Type of reaction.
The parameters are reduced parameters.
std::vector< unsigned int > _species_product_stoichiometry
unsigned int product_id(const unsigned int p) const
KineticsModel::KineticsModel kinetics_model() const
Model of kinetics.
unsigned int reactant_stoichiometric_coefficient(const unsigned int r) const
CoeffType reactant_partial_order(const unsigned int r) const
void set_efficiency(const std::string &, const unsigned int s, const CoeffType efficiency)
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
const StateType & T() const
const std::string & product_name(const unsigned int p) const
void print(std::ostream &os=std::cout) const
Formatted print, by default to std::cout.
void swap_forward_rates(unsigned int irate, unsigned int jrate)
Swap two forward rates object.
CoeffType efficiency(const unsigned int s) const
unsigned int n_reactants() const
This class contains the conditions of the chemistry.
The Troe falloff model is defined by: with The derivatives are therefore: .
friend std::ostream & operator<<(std::ostream &os, const Reaction &rxn)
Formatted print.
std::vector< CoeffType > _efficiencies
efficiencies for three body reactions