Cantera  3.1.0
Loading...
Searching...
No Matches
MultiRate< RateType, DataType > Class Template Referencefinal

A class template handling ReactionRate specializations. More...

#include <MultiRate.h>

Inheritance diagram for MultiRate< RateType, DataType >:
[legend]

Detailed Description

template<class RateType, class DataType>
class Cantera::MultiRate< RateType, DataType >

A class template handling ReactionRate specializations.

Definition at line 21 of file MultiRate.h.

Public Member Functions

string type () override
 Identifier of reaction rate type.
 
void add (size_t rxn_index, ReactionRate &rate) override
 Add reaction rate object to the evaluator.
 
bool replace (size_t rxn_index, ReactionRate &rate) override
 Replace reaction rate object handled by the evaluator.
 
void resize (size_t nSpecies, size_t nReactions, size_t nPhases) override
 Update number of species and reactions.
 
void getRateConstants (double *kf) override
 Evaluate all rate constants handled by the evaluator.
 
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.
 
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.
 
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.
 
void update (double T) override
 Update common reaction rate data based on temperature.
 
void update (double T, double extra) override
 Update common reaction rate data based on temperature and extra parameter.
 
void update (double T, const vector< double > &extra) override
 Update common reaction rate data based on temperature and extra parameter.
 
bool update (const ThermoPhase &phase, const Kinetics &kin) override
 Update data common to reaction rates of a specific type.
 
double evalSingle (ReactionRate &rate) override
 Get the rate for a single reaction.
 
DataType & sharedData ()
 Access the underlying shared data object.
 
virtual string type ()=0
 Identifier of reaction rate type.
 
virtual void add (size_t rxn_index, ReactionRate &rate)=0
 Add reaction rate object to the evaluator.
 
virtual bool replace (size_t rxn_index, ReactionRate &rate)=0
 Replace reaction rate object handled by the evaluator.
 
virtual void resize (size_t nSpecies, size_t nReactions, size_t nPhases)=0
 Update number of species and reactions.
 
virtual void getRateConstants (double *kf)=0
 Evaluate all rate constants handled by the evaluator.
 
virtual void processRateConstants_ddT (double *rop, const double *kf, double deltaT)=0
 Evaluate all rate constant temperature derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
 
virtual void processRateConstants_ddP (double *rop, const double *kf, double deltaP)=0
 Evaluate all rate constant pressure derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
 
virtual void processRateConstants_ddM (double *rop, const double *kf, double deltaM, bool overwrite=true)=0
 Evaluate all rate constant third-body derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.
 
virtual void update (double T)=0
 Update common reaction rate data based on temperature.
 
virtual void update (double T, double extra)=0
 Update common reaction rate data based on temperature and extra parameter.
 
virtual void update (double T, const vector< double > &extra)=0
 Update common reaction rate data based on temperature and extra parameter.
 
virtual bool update (const ThermoPhase &phase, const Kinetics &kin)=0
 Update data common to reaction rates of a specific type.
 
virtual double evalSingle (ReactionRate &rate)=0
 Get the rate for a single reaction.
 

Protected Member Functions

void _update ()
 Helper function to process updates.
 

Protected Attributes

vector< pair< size_t, RateType > > m_rxn_rates
 Vector of pairs of reaction rates indices and reaction rates.
 
map< size_t, size_t > m_indices
 
DataType m_shared
 Mapping of indices.
 

Member Function Documentation

◆ type()

template<class RateType , class DataType >
string type ( )
inlineoverridevirtual

Identifier of reaction rate type.

Implements MultiRateBase.

Definition at line 29 of file MultiRate.h.

◆ add()

template<class RateType , class DataType >
void add ( size_t  rxn_index,
ReactionRate rate 
)
inlineoverridevirtual

Add reaction rate object to the evaluator.

Parameters
rxn_indexindex of reaction
ratereaction rate object

Implements MultiRateBase.

Definition at line 37 of file MultiRate.h.

◆ replace()

template<class RateType , class DataType >
bool replace ( size_t  rxn_index,
ReactionRate rate 
)
inlineoverridevirtual

Replace reaction rate object handled by the evaluator.

Parameters
rxn_indexindex of reaction
ratereaction rate object

Implements MultiRateBase.

Definition at line 43 of file MultiRate.h.

◆ resize()

template<class RateType , class DataType >
void resize ( size_t  nSpecies,
size_t  nReactions,
size_t  nPhases 
)
inlineoverridevirtual

Update number of species and reactions.

Parameters
nSpeciesnumber of species
nReactionsnumber of reactions
nPhasesnumber of phases

Implements MultiRateBase.

Definition at line 63 of file MultiRate.h.

◆ getRateConstants()

template<class RateType , class DataType >
void getRateConstants ( double *  kf)
inlineoverridevirtual

Evaluate all rate constants handled by the evaluator.

Parameters
kfarray of rate constants

Implements MultiRateBase.

Definition at line 68 of file MultiRate.h.

◆ processRateConstants_ddT()

template<class RateType , class DataType >
void processRateConstants_ddT ( double *  rop,
const double *  kf,
double  deltaT 
)
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.

Parameters
[in,out]roparray of rop, which is modified by the method; contains rop on input, and d(rop)/dT on output
kfarray of forward rate constants (numerical derivative only)
deltaTrelative temperature perturbation (numerical derivative only)

Implements MultiRateBase.

Definition at line 74 of file MultiRate.h.

◆ processRateConstants_ddP()

template<class RateType , class DataType >
void processRateConstants_ddP ( double *  rop,
const double *  kf,
double  deltaP 
)
inlineoverridevirtual

Evaluate all rate constant pressure derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.

Parameters
[in,out]roparray of rop, which is modified by the method; contains rop on input, and d(rop)/dP on output
kfarray of forward rate constants
deltaPrelative pressure perturbation

Implements MultiRateBase.

Definition at line 100 of file MultiRate.h.

◆ processRateConstants_ddM()

template<class RateType , class DataType >
void processRateConstants_ddM ( double *  rop,
const double *  kf,
double  deltaM,
bool  overwrite = true 
)
inlineoverridevirtual

Evaluate all rate constant third-body derivatives handled by the evaluator; which are multiplied with the array of rate-of-progress variables.

Parameters
[in,out]roparray of rop, which is modified by the method; contains rop on input, and d(rop)/dM on output
kfarray of forward rate constants
deltaMrelative perturbation of third-body concentrations
overwriteif true, rop entries not affected by M are set to zero

Implements MultiRateBase.

Definition at line 124 of file MultiRate.h.

◆ update() [1/4]

template<class RateType , class DataType >
void update ( double  T)
inlineoverridevirtual

Update common reaction rate data based on temperature.

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters
Ttemperature [K]

Implements MultiRateBase.

Definition at line 156 of file MultiRate.h.

◆ update() [2/4]

template<class RateType , class DataType >
void update ( double  T,
double  extra 
)
inlineoverridevirtual

Update common reaction rate data based on temperature and extra parameter.

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters
Ttemperature [K]
extraextra parameter (depends on parameterization)

Implements MultiRateBase.

Definition at line 161 of file MultiRate.h.

◆ update() [3/4]

template<class RateType , class DataType >
void update ( double  T,
const vector< double > &  extra 
)
inlineoverridevirtual

Update common reaction rate data based on temperature and extra parameter.

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters
Ttemperature [K]
extraextra vector parameter (depends on parameterization)
Warning
This method is an experimental part of the Cantera API and may be changed or removed without notice.

Implements MultiRateBase.

Definition at line 166 of file MultiRate.h.

◆ update() [4/4]

template<class RateType , class DataType >
bool update ( const ThermoPhase phase,
const Kinetics kin 
)
inlineoverridevirtual

Update data common to reaction rates of a specific type.

This update mechanism is used by Kinetics reaction rate evaluators.

Parameters
phaseobject representing reacting phase
kinobject representing kinetics
Returns
flag indicating whether reaction rates need to be re-evaluated

Implements MultiRateBase.

Definition at line 171 of file MultiRate.h.

◆ evalSingle()

template<class RateType , class DataType >
double evalSingle ( ReactionRate rate)
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 181 of file MultiRate.h.

◆ sharedData()

template<class RateType , class DataType >
DataType & sharedData ( )
inline

Access the underlying shared data object.

Used for setting up ReactionDataDelegator instances.

Definition at line 191 of file MultiRate.h.

◆ _update()

template<class RateType , class DataType >
void _update ( )
inlineprotected

Helper function to process updates.

Definition at line 197 of file MultiRate.h.

Member Data Documentation

◆ m_rxn_rates

template<class RateType , class DataType >
vector<pair<size_t, RateType> > m_rxn_rates
protected

Vector of pairs of reaction rates indices and reaction rates.

Definition at line 206 of file MultiRate.h.

◆ m_indices

template<class RateType , class DataType >
map<size_t, size_t> m_indices
protected

Definition at line 207 of file MultiRate.h.

◆ m_shared

template<class RateType , class DataType >
DataType m_shared
protected

Mapping of indices.

Definition at line 208 of file MultiRate.h.


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