Cantera 2.6.0

Public Member Functions | List of all members
MultiRateBase Class Referenceabstract

An abstract base class for evaluating all reactions of a particular type. More...

`#include <MultiRateBase.h>`

Inheritance diagram for MultiRateBase:
[legend]

## Public Member Functions
virtual std::string | type ()=0
| Identifier of reaction rate type. More...
virtual void | add (size_t rxn_index, ReactionRate &rate)=0
| Add reaction rate object to the evaluator. More...
virtual bool | replace (size_t rxn_index, ReactionRate &rate)=0
| Replace reaction rate object handled by the evaluator. More...
virtual void | resize (size_t nSpecies, size_t nReactions, size_t nPhases)=0
| Update number of species and reactions. More...
virtual void | getRateConstants (double *kf)=0
| Evaluate all rate constants handled by the evaluator. More...
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. More...
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. More...
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. More...
virtual void | update (double T)=0
| Update common reaction rate data based on temperature. More...
virtual void | update (double T, double extra)=0
| Update common reaction rate data based on temperature and extra parameter. More...
virtual void | update (double T, const vector_fp &extra)=0
| Update common reaction rate data based on temperature and extra parameter. More...
virtual bool | update (const ThermoPhase &phase, const Kinetics &kin)=0
| Update data common to reaction rates of a specific type. More...
virtual double | evalSingle (ReactionRate &rate)=0
| Get the rate for a single reaction. More...

## Detailed Description

An abstract base class for evaluating all reactions of a particular type.

Because this class has no template parameters, the Kinetics object can store all of these rate coefficient evaluators as a `vector<shared_ptr<MultiRateBase>>`. All of the actual implementation for this capability is done in the MultiRate class.

Definition at line 26 of file MultiRateBase.h.

## Constructor & Destructor Documentation

## ◆ ~MultiRateBase()

virtual ~MultiRateBase | ( |  | ) |
| inline virtual

Definition at line 29 of file MultiRateBase.h.

## Member Function Documentation

## ◆ type()

virtual std::string type | ( |  | ) |
| pure virtual

Identifier of reaction rate type.

Implemented in MultiRate< RateType, DataType >.

## ◆ add()

virtual void add | ( | size_t | rxn_index,
|  | ReactionRate & | rate
| ) |  |
| pure virtual

Add reaction rate object to the evaluator.

Parameters

  rxn_index | index of reaction
  rate | reaction rate object

Implemented in MultiRate< RateType, DataType >.

## ◆ replace()

virtual bool replace | ( | size_t | rxn_index,
|  | ReactionRate & | rate
| ) |  |
| pure virtual

Replace reaction rate object handled by the evaluator.

Parameters

  rxn_index | index of reaction
  rate | reaction rate object

Implemented in MultiRate< RateType, DataType >.

## ◆ resize()

virtual void resize | ( | size_t | nSpecies,
|  | size_t | nReactions,
|  | size_t | nPhases
| ) |  |
| pure virtual

Update number of species and reactions.

Parameters

  nSpecies | number of species
  nReactions | number of reactions
  nPhases | number of phases

Implemented in MultiRate< RateType, DataType >.

## ◆ getRateConstants()

virtual void getRateConstants | ( | double * | kf | ) |
| pure virtual

Evaluate all rate constants handled by the evaluator.

Parameters

  kf | array of rate constants

Implemented in MultiRate< RateType, DataType >.

## ◆ processRateConstants_ddT()

virtual void processRateConstants_ddT | ( | double * | rop,
|  | const double * | kf,
|  | double | deltaT
| ) |  |
| pure virtual

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] | 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)

Implemented in MultiRate< RateType, DataType >.

## ◆ processRateConstants_ddP()

virtual void processRateConstants_ddP | ( | double * | rop,
|  | const double * | kf,
|  | double | deltaP
| ) |  |
| pure virtual

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

Parameters

  [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

Implemented in MultiRate< RateType, DataType >.

## ◆ processRateConstants_ddM()

virtual void processRateConstants_ddM | ( | double * | rop,
|  | const double * | kf,
|  | double | deltaM,
|  | bool | overwrite = `true`
| ) |  |
| pure virtual

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] | 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

Implemented in MultiRate< RateType, DataType >.

## ◆ update() [1/4]

virtual void update | ( | double | T | ) |
| pure virtual

Update common reaction rate data based on temperature.

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters

  T | temperature [K]

Implemented in MultiRate< RateType, DataType >.

## ◆ update() [2/4]

virtual void update | ( | double | T,
|  | double | extra
| ) |  |
| pure virtual

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

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters

  T | temperature [K]
  extra | extra parameter (depends on parameterization)

Implemented in MultiRate< RateType, DataType >.

## ◆ update() [3/4]

virtual void update | ( | double | T,
|  | const vector_fp & | extra
| ) |  |
| pure virtual

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

Only used in conjunction with evalSingle and ReactionRate::eval

Parameters

  T | temperature [K]
  extra | extra vector parameter (depends on parameterization)

Warning
  This method is an experimental part of the Cantera API and may be changed or removed without notice.

Implemented in MultiRate< RateType, DataType >.

## ◆ update() [4/4]

virtual bool update | ( | const ThermoPhase & | phase,
|  | const Kinetics & | kin
| ) |  |
| pure virtual

Update data common to reaction rates of a specific type.

This update mechanism is used by Kinetics reaction rate evaluators.

Parameters

  phase | object representing reacting phase
  kin | object representing kinetics

Returns
  flag indicating whether reaction rates need to be re-evaluated

Implemented in MultiRate< RateType, DataType >.

## ◆ evalSingle()

virtual double evalSingle | ( | ReactionRate & | rate | ) |
| pure virtual

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.

Implemented in MultiRate< RateType, DataType >.

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

- MultiRateBase.h