Cantera 2.6.0
|
A class template handling ReactionRate specializations. More...
#include <MultiRate.h>
Public Member Functions | |
virtual std::string | type () override |
Identifier of reaction rate type. More... | |
virtual void | add (size_t rxn_index, ReactionRate &rate) override |
Add reaction rate object to the evaluator. More... | |
virtual bool | replace (size_t rxn_index, ReactionRate &rate) override |
Replace reaction rate object handled by the evaluator. More... | |
virtual void | resize (size_t nSpecies, size_t nReactions, size_t nPhases) override |
Update number of species and reactions. More... | |
virtual void | getRateConstants (double *kf) override |
Evaluate all rate constants handled by the evaluator. More... | |
virtual void | processRateConstants_ddT (double *rop, const double *kf, double deltaT) override |
Evaluate all rate constant temperature derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables. More... | |
virtual void | processRateConstants_ddP (double *rop, const double *kf, double deltaP) override |
Evaluate all rate constant pressure derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables. More... | |
virtual void | processRateConstants_ddM (double *rop, const double *kf, double deltaM, bool overwrite=true) override |
Evaluate all rate constant third-body derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables. More... | |
virtual void | update (double T) override |
Update common reaction rate data based on temperature. More... | |
virtual void | update (double T, double extra) override |
Update common reaction rate data based on temperature and extra parameter. More... | |
virtual void | update (double T, const vector_fp &extra) override |
Update common reaction rate data based on temperature and extra parameter. More... | |
virtual bool | update (const ThermoPhase &phase, const Kinetics &kin) override |
Update data common to reaction rates of a specific type. More... | |
virtual double | evalSingle (ReactionRate &rate) override |
Get the rate for a single reaction. More... | |
Protected Member Functions | |
template<typename T = RateType, typename std::enable_if< has_update< T >::value, bool >::type = true> | |
void | _update () |
Helper function to process updates for rate types that implement the updateFromStruct method. More... | |
template<typename T = RateType, typename std::enable_if<!has_update< T >::value, bool >::type = true> | |
void | _update () |
Helper function for rate types that do not implement updateFromStruct . More... | |
template<typename T = RateType, typename std::enable_if< has_update< T >::value, bool >::type = true> | |
void | _updateRate (RateType &rate) |
Helper function to update a single rate that has an updateFromStruct method`. More... | |
template<typename T = RateType, typename std::enable_if<!has_update< T >::value, bool >::type = true> | |
void | _updateRate (RateType &rate) |
Helper function for single rate that does not implement updateFromStruct . More... | |
template<typename T = RateType, typename std::enable_if< has_ddT< T >::value, bool >::type = true> | |
void | _process_ddT (double *rop, const double *kf, double deltaT) |
Helper function to process temperature derivatives for rate types that implement the ddTScaledFromStruct method. More... | |
template<typename T = RateType, typename std::enable_if<!has_ddT< T >::value, bool >::type = true> | |
void | _process_ddT (double *rop, const double *kf, double deltaT) |
Helper function for rate types that do not implement ddTScaledFromStruct More... | |
template<typename T = RateType, typename D = DataType, typename std::enable_if< has_ddM< D >::value, bool >::type = true> | |
void | _process_ddM (double *rop, const double *kf, double deltaM, bool overwrite) |
Helper function to process third-body derivatives for rate data that implement the perturbThirdBodies method. More... | |
template<typename T = RateType, typename D = DataType, typename std::enable_if<!has_ddM< D >::value, bool >::type = true> | |
void | _process_ddM (double *rop, const double *kf, double deltaM, bool overwrite) |
Helper function for rate data that do not implement perturbThirdBodies More... | |
template<typename T = RateType, typename D = DataType, typename std::enable_if< has_ddP< D >::value, bool >::type = true> | |
void | _process_ddP (double *rop, const double *kf, double deltaP) |
Helper function to process pressure derivatives for rate data that implement the perturbPressure method. More... | |
template<typename T = RateType, typename D = DataType, typename std::enable_if<!has_ddP< D >::value, bool >::type = true> | |
void | _process_ddP (double *rop, const double *kf, double deltaP) |
Helper function for rate data that do not implement perturbPressure More... | |
Protected Attributes | |
std::vector< std::pair< size_t, RateType > > | m_rxn_rates |
Vector of pairs of reaction rates indices and reaction rates. More... | |
std::map< size_t, size_t > | m_indices |
DataType | m_shared |
Mapping of indices. More... | |
A class template handling ReactionRate specializations.
Definition at line 20 of file MultiRate.h.
|
inlineoverridevirtual |
Identifier of reaction rate type.
Implements MultiRateBase.
Definition at line 28 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates.
Referenced by MultiRate< RateType, DataType >::replace().
|
inlineoverridevirtual |
Add reaction rate object to the evaluator.
rxn_index | index of reaction |
rate | reaction rate object |
Implements MultiRateBase.
Definition at line 36 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
|
inlineoverridevirtual |
Replace reaction rate object handled by the evaluator.
rxn_index | index of reaction |
rate | reaction rate object |
Implements MultiRateBase.
Definition at line 42 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates, MultiRate< RateType, DataType >::m_shared, ReactionRate::type(), and MultiRate< RateType, DataType >::type().
|
inlineoverridevirtual |
Update number of species and reactions.
nSpecies | number of species |
nReactions | number of reactions |
nPhases | number of phases |
Implements MultiRateBase.
Definition at line 62 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_shared.
|
inlineoverridevirtual |
Evaluate all rate constants handled by the evaluator.
kf | array of rate constants |
Implements MultiRateBase.
Definition at line 67 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
|
inlineoverridevirtual |
Evaluate all rate constant temperature derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
Depending on the implementation of a rate object, either an exact derivative or a numerical approximation may be used.
[in,out] | rop | array of rop, which is modified by the method; contains rop on input, and d(rop)/dT on output |
kf | array of forward rate constants (numerical derivative only) | |
deltaT | relative temperature perturbation (numerical derivative only) |
Implements MultiRateBase.
Definition at line 73 of file MultiRate.h.
References MultiRate< RateType, DataType >::_process_ddT().
|
inlineoverridevirtual |
Evaluate all rate constant pressure derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
[in,out] | rop | array of rop, which is modified by the method; contains rop on input, and d(rop)/dP on output |
kf | array of forward rate constants | |
deltaP | relative pressure perturbation |
Implements MultiRateBase.
Definition at line 82 of file MultiRate.h.
References MultiRate< RateType, DataType >::_process_ddP().
|
inlineoverridevirtual |
Evaluate all rate constant third-body derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
[in,out] | rop | array of rop, which is modified by the method; contains rop on input, and d(rop)/dM on output |
kf | array of forward rate constants | |
deltaM | relative perturbation of third-body concentrations | |
overwrite | if true , rop entries not affected by M are set to zero |
Implements MultiRateBase.
Definition at line 91 of file MultiRate.h.
References MultiRate< RateType, DataType >::_process_ddM().
|
inlineoverridevirtual |
Update common reaction rate data based on temperature.
Only used in conjunction with evalSingle and ReactionRate::eval
T | temperature [K] |
Implements MultiRateBase.
Definition at line 101 of file MultiRate.h.
|
inlineoverridevirtual |
Update common reaction rate data based on temperature and extra parameter.
Only used in conjunction with evalSingle and ReactionRate::eval
T | temperature [K] |
extra | extra parameter (depends on parameterization) |
Implements MultiRateBase.
Definition at line 106 of file MultiRate.h.
|
inlineoverridevirtual |
Update common reaction rate data based on temperature and extra parameter.
Only used in conjunction with evalSingle and ReactionRate::eval
T | temperature [K] |
extra | extra vector parameter (depends on parameterization) |
Implements MultiRateBase.
Definition at line 111 of file MultiRate.h.
|
inlineoverridevirtual |
Update data common to reaction rates of a specific type.
This update mechanism is used by Kinetics reaction rate evaluators.
phase | object representing reacting phase |
kin | object representing kinetics |
Implements MultiRateBase.
Definition at line 116 of file MultiRate.h.
References MultiRate< RateType, DataType >::_update(), and MultiRate< RateType, DataType >::m_shared.
|
inlineoverridevirtual |
Get the rate for a single reaction.
Used to implement ReactionRate::eval, which allows for the evaluation of a reaction rate expression outside of Kinetics reaction rate evaluators. Mainly used for testing purposes.
Implements MultiRateBase.
Definition at line 126 of file MultiRate.h.
|
inlineprotected |
Helper function to process updates for rate types that implement the updateFromStruct
method.
Definition at line 137 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
Referenced by MultiRate< RateType, DataType >::_process_ddM(), MultiRate< RateType, DataType >::_process_ddP(), MultiRate< RateType, DataType >::_process_ddT(), and MultiRate< RateType, DataType >::update().
|
inlineprotected |
Helper function for rate types that do not implement updateFromStruct
.
Does nothing, but exists to allow generic implementations of update().
Definition at line 147 of file MultiRate.h.
|
inlineprotected |
Helper function to update a single rate that has an updateFromStruct
method`.
Definition at line 153 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_shared.
|
inlineprotected |
Helper function for single rate that does not implement updateFromStruct
.
Exists to allow generic implementations of evalSingle
and ddTSingle
.
Definition at line 161 of file MultiRate.h.
|
inlineprotected |
Helper function to process temperature derivatives for rate types that implement the ddTScaledFromStruct
method.
Definition at line 168 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
Referenced by MultiRate< RateType, DataType >::processRateConstants_ddT().
|
inlineprotected |
Helper function for rate types that do not implement ddTScaledFromStruct
Definition at line 177 of file MultiRate.h.
References MultiRate< RateType, DataType >::_update(), MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
|
inlineprotected |
Helper function to process third-body derivatives for rate data that implement the perturbThirdBodies
method.
Definition at line 201 of file MultiRate.h.
References MultiRate< RateType, DataType >::_update(), MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
Referenced by MultiRate< RateType, DataType >::processRateConstants_ddM().
|
inlineprotected |
Helper function for rate data that do not implement perturbThirdBodies
Definition at line 224 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates.
|
inlineprotected |
Helper function to process pressure derivatives for rate data that implement the perturbPressure
method.
Definition at line 238 of file MultiRate.h.
References MultiRate< RateType, DataType >::_update(), MultiRate< RateType, DataType >::m_rxn_rates, and MultiRate< RateType, DataType >::m_shared.
Referenced by MultiRate< RateType, DataType >::processRateConstants_ddP().
|
inlineprotected |
Helper function for rate data that do not implement perturbPressure
Definition at line 258 of file MultiRate.h.
References MultiRate< RateType, DataType >::m_rxn_rates.
|
protected |
Vector of pairs of reaction rates indices and reaction rates.
Definition at line 265 of file MultiRate.h.
Referenced by MultiRate< RateType, DataType >::_process_ddM(), MultiRate< RateType, DataType >::_process_ddP(), MultiRate< RateType, DataType >::_process_ddT(), MultiRate< RateType, DataType >::_update(), MultiRate< RateType, DataType >::add(), MultiRate< RateType, DataType >::getRateConstants(), MultiRate< RateType, DataType >::replace(), and MultiRate< RateType, DataType >::type().
|
protected |
Definition at line 266 of file MultiRate.h.
|
protected |
Mapping of indices.
Definition at line 267 of file MultiRate.h.
Referenced by MultiRate< RateType, DataType >::_process_ddM(), MultiRate< RateType, DataType >::_process_ddP(), MultiRate< RateType, DataType >::_process_ddT(), MultiRate< RateType, DataType >::_update(), MultiRate< RateType, DataType >::_updateRate(), MultiRate< RateType, DataType >::add(), MultiRate< RateType, DataType >::getRateConstants(), MultiRate< RateType, DataType >::replace(), MultiRate< RateType, DataType >::resize(), and MultiRate< RateType, DataType >::update().