Cantera 2.6.0

Public Member Functions | Protected Attributes | List of all members
ChebyshevRate Class Referencefinal

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]
Collaboration diagram for ChebyshevRate:
[legend]

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

## Protected Attributes
double | m_log10P
| value detecting updates More...
double | Tmin_
double | Tmax_
| valid temperature range More...
double | Pmin_
double | Pmax_
| valid pressure range More...
double | TrNum_
double | TrDen_
| terms appearing in the reduced temperature More...
double | PrNum_
double | PrDen_
| terms appearing in the reduced pressure More...
Array2D | m_coeffs
| < coefficient array More...
vector_fp | chebCoeffs_
| Chebyshev coefficients, length nP * nT. More...
vector_fp | dotProd_
| dot product of chebCoeffs with the reduced pressure polynomial More...
Units | m_rate_units
| Reaction rate units. More...
Protected Attributes inherited from ReactionRate
AnyMap | m_input
| Input data used for specific models. More...
size_t | m_rate_index
| Index of reaction rate within kinetics evaluator. More...

## Additional Inherited Members
virtual void | getParameters (AnyMap &node) const
| Get parameters. More...

## 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 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 P - \log P_\mathrm{min} - \log P_\mathrm{max}} {\log P_\mathrm{max} - \log 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 89 of file ChebyshevRate.h.

## Constructor & Destructor Documentation

## ◆ ChebyshevRate() [1/3]

ChebyshevRate | ( |  | ) |
| inline

Default constructor.

Definition at line 93 of file ChebyshevRate.h.

## ◆ 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.

References ChebyshevRate::coeffs(), ChebyshevRate::Pmax(), ChebyshevRate::Pmin(), ChebyshevRate::setData(), ChebyshevRate::setLimits(), ChebyshevRate::Tmax(), and ChebyshevRate::Tmin().

## ◆ ChebyshevRate() [3/3]

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

Definition at line 108 of file ChebyshevRate.h.

## Member Function Documentation

## ◆ newMultiRate()

unique_ptr< MultiRateBase > newMultiRate | ( |  | ) | const
| inline 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 unique_ptr<MultiRateBase>(new MultiRate<RateType, DataType>);
Cantera::ChebyshevRate::newMultiRate
unique_ptr< MultiRateBase > newMultiRate() const
Create a rate evaluator for reactions of a particular derived type.
Definition: ChebyshevRate.h:114
Cantera::MultiRate
A class template handling ReactionRate specializations.
Definition: MultiRate.h:21

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 114 of file ChebyshevRate.h.

## ◆ type()

const std::string type | ( |  | ) | const
| inline virtual

String identifying reaction rate specialization.

Implements ReactionRate.

Definition at line 119 of file ChebyshevRate.h.

Referenced by ChebyshevRate::getParameters().

## ◆ setParameters()

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

Perform object setup based on AnyMap node information.

Parameters

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

Reimplemented from ReactionRate.

Definition at line 57 of file ChebyshevRate.cpp.

References ChebyshevRate::coeffs(), UnitSystem::convert(), UnitSystem::convertTo(), Units::factor(), AnyMap::hasKey(), ChebyshevRate::m_rate_units, UnitStack::product(), ChebyshevRate::setData(), ChebyshevRate::setLimits(), and AnyMap::units().

## ◆ getParameters() [1/2]

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

Definition at line 127 of file ChebyshevRate.h.

## ◆ getParameters() [2/2]

void getParameters | ( | AnyMap & | node | ) | const
| 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 139 of file ChebyshevRate.cpp.

References ChebyshevRate::coeffs(), Array2D::data(), Units::factor(), ChebyshevRate::m_coeffs, ChebyshevRate::m_rate_units, Array2D::nColumns(), Array2D::nRows(), ChebyshevRate::Pmax(), ChebyshevRate::Pmin(), ChebyshevRate::Tmax(), ChebyshevRate::Tmin(), and ChebyshevRate::type().

## ◆ validate()

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

Validate the reaction rate expression.

Reimplemented from ReactionRate.

Definition at line 174 of file ChebyshevRate.cpp.

References Array2D::data(), and ChebyshevRate::m_coeffs.

## ◆ 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 139 of file ChebyshevRate.h.

References ChebyshevData::log10P, ChebyshevRate::m_log10P, and ChebyshevRate::update_C().

## ◆ 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 149 of file ChebyshevRate.h.

References ReactionData::recipT, and ChebyshevRate::updateRC().

## ◆ setup()

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

Set up ChebyshevRate object.

Deprecated:
  Deprecated in Cantera 2.6. Replaceable with

See also
  setLimits() and
  setCoeffs().

Definition at line 95 of file ChebyshevRate.cpp.

References ChebyshevRate::coeffs(), ChebyshevRate::Pmax(), ChebyshevRate::Pmin(), ChebyshevRate::setData(), ChebyshevRate::setLimits(), ChebyshevRate::Tmax(), ChebyshevRate::Tmin(), and Cantera::warn_deprecated().

## ◆ 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 104 of file ChebyshevRate.cpp.

References ChebyshevRate::Pmax(), ChebyshevRate::Pmax_, ChebyshevRate::Pmin(), ChebyshevRate::PrDen_, ChebyshevRate::Tmax(), ChebyshevRate::Tmax_, ChebyshevRate::Tmin(), and ChebyshevRate::TrDen_.

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::setParameters(), and ChebyshevRate::setup().

## ◆ update_C()

void update_C | ( | const double * | c | ) |
| inline

Update concentration-dependent parts of the rate coefficient.

Parameters

  c | base-10 logarithm of the pressure in Pa

Deprecated:
  To be removed after Cantera 2.6. Implementation will be moved to the updateFromStruct() method.

Definition at line 174 of file ChebyshevRate.h.

References ChebyshevRate::dotProd_, ChebyshevRate::m_coeffs, ChebyshevRate::m_log10P, Array2D::nColumns(), Array2D::nRows(), and ChebyshevRate::PrDen_.

Referenced by ChebyshevRate::updateFromStruct().

## ◆ updateRC()

double updateRC | ( | double | logT,
|  | double | recipT
| ) |  | const
| inline

Update the value the rate constant.

This function returns the actual value of the rate constant.

Deprecated:
  To be removed after Cantera 2.6. Implementation will be moved to the evalFromStruct() method.

Definition at line 200 of file ChebyshevRate.h.

References ChebyshevRate::dotProd_, ChebyshevRate::m_coeffs, Array2D::nRows(), and ChebyshevRate::TrDen_.

Referenced by ChebyshevRate::evalFromStruct().

## ◆ Tmin()

double Tmin | ( |  | ) | const
| inline

Minimum valid temperature [K].

Definition at line 216 of file ChebyshevRate.h.

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::getParameters(), ChebyshevRate::setLimits(), and ChebyshevRate::setup().

## ◆ Tmax()

double Tmax | ( |  | ) | const
| inline

Maximum valid temperature [K].

Definition at line 221 of file ChebyshevRate.h.

References ChebyshevRate::Tmax_.

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::getParameters(), ChebyshevRate::setLimits(), and ChebyshevRate::setup().

## ◆ Pmin()

double Pmin | ( |  | ) | const
| inline

Minimum valid pressure [Pa].

Definition at line 226 of file ChebyshevRate.h.

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::getParameters(), ChebyshevRate::setLimits(), and ChebyshevRate::setup().

## ◆ Pmax()

double Pmax | ( |  | ) | const
| inline

Maximum valid pressure [Pa].

Definition at line 231 of file ChebyshevRate.h.

References ChebyshevRate::Pmax_.

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::getParameters(), ChebyshevRate::setLimits(), and ChebyshevRate::setup().

## ◆ nPressure()

size_t nPressure | ( |  | ) | const
| inline

Number of points in the pressure direction.

Definition at line 236 of file ChebyshevRate.h.

References ChebyshevRate::m_coeffs, and Array2D::nColumns().

## ◆ nTemperature()

size_t nTemperature | ( |  | ) | const
| inline

Number of points in the temperature direction.

Definition at line 241 of file ChebyshevRate.h.

References ChebyshevRate::m_coeffs, and Array2D::nRows().

## ◆ coeffs()

const vector_fp & coeffs | ( |  | ) | const
| inline

Access the ChebyshevRate coefficients.

\( \alpha_{t,p} = \mathrm{coeffs}[N_P*t + p] \) where \( 0 <= t < N_T \) and \( 0 <= p < N_P \).

Deprecated:
  To be removed after Cantera 2.6. Replaceable by

See also
  data().

Definition at line 252 of file ChebyshevRate.h.

References ChebyshevRate::chebCoeffs_, and Cantera::warn_deprecated().

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::getParameters(), ChebyshevRate::setData(), ChebyshevRate::setParameters(), and ChebyshevRate::setup().

## ◆ 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 260 of file ChebyshevRate.h.

References ChebyshevRate::m_coeffs.

## ◆ setData()

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

Set the Chebyshev coefficients as 2-dimensional array.

Definition at line 122 of file ChebyshevRate.cpp.

References ChebyshevRate::chebCoeffs_, ChebyshevRate::coeffs(), ChebyshevRate::dotProd_, ChebyshevRate::m_coeffs, Array2D::nColumns(), and Array2D::nRows().

Referenced by ChebyshevRate::ChebyshevRate(), ChebyshevRate::setParameters(), and ChebyshevRate::setup().

## Member Data Documentation

## ◆ m_log10P

double m_log10P
| protected

value detecting updates

Definition at line 268 of file ChebyshevRate.h.

Referenced by ChebyshevRate::update_C(), and ChebyshevRate::updateFromStruct().

## ◆ Tmin_

double Tmin_
| protected

Definition at line 269 of file ChebyshevRate.h.

## ◆ Tmax_

double Tmax_
| protected

valid temperature range

Definition at line 269 of file ChebyshevRate.h.

Referenced by ChebyshevRate::setLimits(), and ChebyshevRate::Tmax().

## ◆ Pmin_

double Pmin_
| protected

Definition at line 270 of file ChebyshevRate.h.

## ◆ Pmax_

double Pmax_
| protected

valid pressure range

Definition at line 270 of file ChebyshevRate.h.

Referenced by ChebyshevRate::Pmax(), and ChebyshevRate::setLimits().

## ◆ TrNum_

double TrNum_
| protected

Definition at line 271 of file ChebyshevRate.h.

## ◆ TrDen_

double TrDen_
| protected

terms appearing in the reduced temperature

Definition at line 271 of file ChebyshevRate.h.

Referenced by ChebyshevRate::setLimits(), and ChebyshevRate::updateRC().

## ◆ PrNum_

double PrNum_
| protected

Definition at line 272 of file ChebyshevRate.h.

## ◆ PrDen_

double PrDen_
| protected

terms appearing in the reduced pressure

Definition at line 272 of file ChebyshevRate.h.

Referenced by ChebyshevRate::setLimits(), and ChebyshevRate::update_C().

## ◆ m_coeffs

Array2D m_coeffs
| protected

< coefficient array

Definition at line 274 of file ChebyshevRate.h.

Referenced by ChebyshevRate::data(), ChebyshevRate::getParameters(), ChebyshevRate::nPressure(), ChebyshevRate::nTemperature(), ChebyshevRate::setData(), ChebyshevRate::update_C(), ChebyshevRate::updateRC(), and ChebyshevRate::validate().

## ◆ chebCoeffs_

vector_fp chebCoeffs_
| protected

Chebyshev coefficients, length nP * nT.

Definition at line 275 of file ChebyshevRate.h.

Referenced by ChebyshevRate::coeffs(), and ChebyshevRate::setData().

## ◆ dotProd_

vector_fp dotProd_
| protected

dot product of chebCoeffs with the reduced pressure polynomial

Definition at line 276 of file ChebyshevRate.h.

Referenced by ChebyshevRate::setData(), ChebyshevRate::update_C(), and ChebyshevRate::updateRC().

## ◆ m_rate_units

Units m_rate_units
| protected

Reaction rate units.

Definition at line 278 of file ChebyshevRate.h.

Referenced by ChebyshevRate::getParameters(), and ChebyshevRate::setParameters().

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

- ChebyshevRate.h
- ChebyshevRate.cpp