| Cantera 3.0.0

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ChebyshevRate Class Referencefinal
Chemical Kinetics » Reactions and Reaction Rates » Other Reaction Rate Parameterizations

Pressure-dependent rate expression where the rate coefficient is expressed as a bivariate Chebyshev polynomial in temperature and pressure. More...

`#include <ChebyshevRate.h>`

Inheritance diagram for ChebyshevRate:
[legend]

## Detailed Description

Pressure-dependent rate expression where the rate coefficient is expressed as a bivariate Chebyshev polynomial in temperature and pressure.

The rate constant can be written as:

\[ \log_{10} k(T,P) = \sum_{t=1}^{N_T} \sum_{p=1}^{N_P} \alpha_{tp} \phi_t(\tilde{T}) \phi_p(\tilde{P}) \]

where \( \alpha_{tp} \) are the constants defining the rate, \( \phi_n(x) \) is the Chebyshev polynomial of the first kind of degree n evaluated at x, and

\[ \tilde{T} \equiv \frac{2T^{-1} - T_\mathrm{min}^{-1} - T_\mathrm{max}^{-1}} {T_\mathrm{max}^{-1} - T_\mathrm{min}^{-1}} \]

\[ \tilde{P} \equiv \frac{2 \log_{10} P - \log_{10} P_\mathrm{min} - \log_{10} P_\mathrm{max}} {\log_{10} P_\mathrm{max} - \log_{10} P_\mathrm{min}} \]

are reduced temperature and reduced pressures which map the ranges \( (T_\mathrm{min}, T_\mathrm{max}) \) and \( (P_\mathrm{min}, P_\mathrm{max}) \) to (-1, 1).

A ChebyshevRate rate expression is specified in terms of the coefficient matrix \( \alpha \) and the temperature and pressure ranges. Note that the Chebyshev polynomials are not defined outside the interval (-1,1), and therefore extrapolation of rates outside the range of temperatures and pressures for which they are defined is strongly discouraged.

Definition at line 91 of file ChebyshevRate.h.

## Public Member Functions
| ChebyshevRate ()=default
| Default constructor.
| ChebyshevRate (double Tmin, double Tmax, double Pmin, double Pmax, const Array2D &coeffs)
| Constructor directly from coefficient array.
| ChebyshevRate (const AnyMap &node, const UnitStack &rate_units={})
unique_ptr< MultiRateBase > | newMultiRate () const override
| Create a rate evaluator for reactions of a particular derived type.
const string | type () const override
| String identifying reaction rate specialization.
void | setParameters (const AnyMap &node, const UnitStack &rate_units) override
| Perform object setup based on AnyMap node information.
void | getParameters (AnyMap &rateNode) const override
| Get parameters.
void | getParameters (AnyMap &rateNode, const Units &rate_units) const
void | validate (const string &equation, const Kinetics &kin) override
| Validate the reaction rate expression.
void | updateFromStruct (const ChebyshevData &shared_data)
| Update information specific to reaction.
double | evalFromStruct (const ChebyshevData &shared_data)
| Evaluate reaction rate.
void | setLimits (double Tmin, double Tmax, double Pmin, double Pmax)
| Set limits for ChebyshevRate object.
double | Tmin () const
| Minimum valid temperature [K].
double | Tmax () const
| Maximum valid temperature [K].
double | Pmin () const
| Minimum valid pressure [Pa].
double | Pmax () const
| Maximum valid pressure [Pa].
size_t | nPressure () const
| Number of points in the pressure direction.
size_t | nTemperature () const
| Number of points in the temperature direction.
const Array2D & | data () const
| Access Chebyshev coefficients as 2-dimensional array with temperature and pressure dimensions corresponding to rows and columns, respectively.
void | setData (const Array2D &coeffs)
| Set the Chebyshev coefficients as 2-dimensional array.
Public Member Functions inherited from ReactionRate
| ReactionRate (const ReactionRate &other)
ReactionRate & | operator= (const ReactionRate &other)
virtual const string | subType () const
| String identifying sub-type of reaction rate specialization.
AnyMap | parameters () const
| Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function.
const Units & | conversionUnits () const
| Get the units for converting the leading term in the reaction rate expression.
virtual void | setRateUnits (const UnitStack &rate_units)
| Set the units of the reaction rate expression.
virtual void | check (const string &equation)
| Check basic syntax and settings of reaction rate expression.
void | check (const string &equation, const AnyMap &node)
| Check basic syntax and settings of reaction rate expression.
virtual void | validate (const string &equation)
| Validate the reaction rate expression (legacy call)
size_t | rateIndex () const
| Reaction rate index within kinetics evaluator.
void | setRateIndex (size_t idx)
| Set reaction rate index within kinetics evaluator.
virtual void | setContext (const Reaction &rxn, const Kinetics &kin)
| Set context of reaction rate evaluation.
double | eval (double T)
| Evaluate reaction rate based on temperature.
double | eval (double T, double extra)
| Evaluate reaction rate based on temperature and an extra parameter.
double | eval (double T, const vector< double > &extra)
| Evaluate reaction rate based on temperature and an extra vector parameter.
bool | valid () const
| Get flag indicating whether reaction rate is set up correctly.
bool | compositionDependent ()
| Boolean indicating whether rate has compositional dependence.
void | setCompositionDependence (bool comp_dep)
| Set rate compositional dependence.

## Protected Attributes
double | m_log10P = NAN
| value detecting updates
double | Tmin_
double | Tmax_
| valid temperature range
double | Pmin_
double | Pmax_
| valid pressure range
double | TrNum_
double | TrDen_
| terms appearing in the reduced temperature
double | PrNum_
double | PrDen_
| terms appearing in the reduced pressure
Array2D | m_coeffs
| < coefficient array
vector< double > | dotProd_
| dot product of coeffs with the reduced pressure polynomial
Protected Attributes inherited from ReactionRate
AnyMap | m_input
| Input data used for specific models.
size_t | m_rate_index = npos
| Index of reaction rate within kinetics evaluator.
bool | m_valid = false
| Flag indicating whether reaction rate is set up correctly.
bool | m_composition_dependent_rate = false
| Flag indicating composition dependent rate.
Units | m_conversion_units {0.}
| Units of the leading term in the reaction rate expression.

## Additional Inherited Members

## Constructor & Destructor Documentation

## ◆ ChebyshevRate() [1/3]

ChebyshevRate | ( |  | ) |
| default

Default constructor.

## ◆ ChebyshevRate() [2/3]

ChebyshevRate | ( | double | Tmin,
|  | double | Tmax,
|  | double | Pmin,
|  | double | Pmax,
|  | const Array2D & | coeffs
| ) |  |

Constructor directly from coefficient array.

Parameters

  Tmin | Minimum temperature [K]
  Tmax | Maximum temperature [K]
  Pmin | Minimum pressure [Pa]
  Pmax | Maximum pressure [Pa]
  coeffs | Coefficient array dimensioned `nT` by `nP` where `nT` and `nP` are the number of temperatures and pressures used in the fit, respectively.

Definition at line 50 of file ChebyshevRate.cpp.

## ◆ ChebyshevRate() [3/3]

ChebyshevRate | ( | const AnyMap & | node,
|  | const UnitStack & | rate_units = `{}`
| ) |  |

Definition at line 57 of file ChebyshevRate.cpp.

## Member Function Documentation

## ◆ newMultiRate()

unique_ptr< MultiRateBase > newMultiRate | ( |  | ) | const
| inline override virtual

Create a rate evaluator for reactions of a particular derived type.

Derived classes usually implement this as:

unique_ptr<MultiRateBase> newMultiRate() const override {
return make_unique<MultiRate<RateType, DataType>>();
Cantera::ChebyshevRate::newMultiRate
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition ChebyshevRate.h:112

where `RateType` is the derived class name and `DataType` is the corresponding container for parameters needed to evaluate reactions of that type.

Reimplemented from ReactionRate.

Definition at line 112 of file ChebyshevRate.h.

## ◆ type()

const string type | ( |  | ) | const
| inline override virtual

String identifying reaction rate specialization.

Implements ReactionRate.

Definition at line 116 of file ChebyshevRate.h.

## ◆ setParameters()

void setParameters | ( | const AnyMap & | node,
|  | const UnitStack & | rate_units
| ) |  |
| override virtual

Perform object setup based on AnyMap node information.

Parameters

  node | AnyMap containing rate information
  rate_units | Unit definitions specific to rate information

Reimplemented from ReactionRate.

Definition at line 63 of file ChebyshevRate.cpp.

## ◆ getParameters() [1/2]

void getParameters | ( | AnyMap & | node | ) | const
| override virtual

Get parameters.

Parameters

  node | AnyMap containing rate information Store the parameters of a ReactionRate needed to reconstruct an identical object. Does not include user-defined fields available in the m_input map.

Reimplemented from ReactionRate.

Definition at line 126 of file ChebyshevRate.cpp.

## ◆ getParameters() [2/2]

void getParameters | ( | AnyMap & | rateNode,
|  | const Units & | rate_units
| ) |  | const
| inline

Deprecated:
  To be removed after Cantera 3.0.

Definition at line 128 of file ChebyshevRate.h.

## ◆ validate()

void validate | ( | const string & | equation,
|  | const Kinetics & | kin
| ) |  |
| override virtual

Validate the reaction rate expression.

Reimplemented from ReactionRate.

Definition at line 160 of file ChebyshevRate.cpp.

## ◆ updateFromStruct()

void updateFromStruct | ( | const ChebyshevData & | shared_data | ) |
| inline

Update information specific to reaction.

Parameters

  shared_data | data shared by all reactions of a given type

Definition at line 140 of file ChebyshevRate.h.

## ◆ evalFromStruct()

double evalFromStruct | ( | const ChebyshevData & | shared_data | ) |
| inline

Evaluate reaction rate.

Parameters

  shared_data | data shared by all reactions of a given type

Definition at line 165 of file ChebyshevRate.h.

## ◆ setLimits()

void setLimits | ( | double | Tmin,
|  | double | Tmax,
|  | double | Pmin,
|  | double | Pmax
| ) |  |

Set limits for ChebyshevRate object.

Parameters

  Tmin | Minimum temperature [K]
  Tmax | Maximum temperature [K]
  Pmin | Minimum pressure [Pa]
  Pmax | Maximum pressure [Pa]

Definition at line 96 of file ChebyshevRate.cpp.

## ◆ Tmin()

double Tmin | ( |  | ) | const
| inline

Minimum valid temperature [K].

Definition at line 190 of file ChebyshevRate.h.

## ◆ Tmax()

double Tmax | ( |  | ) | const
| inline

Maximum valid temperature [K].

Definition at line 195 of file ChebyshevRate.h.

## ◆ Pmin()

double Pmin | ( |  | ) | const
| inline

Minimum valid pressure [Pa].

Definition at line 200 of file ChebyshevRate.h.

## ◆ Pmax()

double Pmax | ( |  | ) | const
| inline

Maximum valid pressure [Pa].

Definition at line 205 of file ChebyshevRate.h.

## ◆ nPressure()

size_t nPressure | ( |  | ) | const
| inline

Number of points in the pressure direction.

Definition at line 210 of file ChebyshevRate.h.

## ◆ nTemperature()

size_t nTemperature | ( |  | ) | const
| inline

Number of points in the temperature direction.

Definition at line 215 of file ChebyshevRate.h.

## ◆ data()

const Array2D & data | ( |  | ) | const
| inline

Access Chebyshev coefficients as 2-dimensional array with temperature and pressure dimensions corresponding to rows and columns, respectively.

Definition at line 221 of file ChebyshevRate.h.

## ◆ setData()

void setData | ( | const Array2D & | coeffs | ) |

Set the Chebyshev coefficients as 2-dimensional array.

Definition at line 114 of file ChebyshevRate.cpp.

## Member Data Documentation

## ◆ m_log10P

double m_log10P = NAN
| protected

value detecting updates

Definition at line 229 of file ChebyshevRate.h.

## ◆ Tmin_

double Tmin_
| protected

Definition at line 230 of file ChebyshevRate.h.

## ◆ Tmax_

double Tmax_
| protected

valid temperature range

Definition at line 230 of file ChebyshevRate.h.

## ◆ Pmin_

double Pmin_
| protected

Definition at line 231 of file ChebyshevRate.h.

## ◆ Pmax_

double Pmax_
| protected

valid pressure range

Definition at line 231 of file ChebyshevRate.h.

## ◆ TrNum_

double TrNum_
| protected

Definition at line 232 of file ChebyshevRate.h.

## ◆ TrDen_

double TrDen_
| protected

terms appearing in the reduced temperature

Definition at line 232 of file ChebyshevRate.h.

## ◆ PrNum_

double PrNum_
| protected

Definition at line 233 of file ChebyshevRate.h.

## ◆ PrDen_

double PrDen_
| protected

terms appearing in the reduced pressure

Definition at line 233 of file ChebyshevRate.h.

## ◆ m_coeffs

Array2D m_coeffs
| protected

< coefficient array

Definition at line 235 of file ChebyshevRate.h.

## ◆ dotProd_

vector<double> dotProd_
| protected

dot product of coeffs with the reduced pressure polynomial

Definition at line 236 of file ChebyshevRate.h.

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

- ChebyshevRate.h
- ChebyshevRate.cpp