35 return ARRHENIUS_REACTION_RATECOEFF_TYPE;
47 Arrhenius(doublereal A, doublereal b, doublereal E);
60 doublereal
updateLog(doublereal logT, doublereal recipT)
const {
61 return m_logA + m_b*logT - m_E*recipT;
70 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
71 return m_A * std::exp(m_b*logT - m_E*recipT);
92 doublereal m_logA, m_b, m_E, m_A;
123 return SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE;
134 doublereal m, doublereal e);
136 void update_C(
const doublereal* theta) {
142 for (
size_t n = 0; n < m_ac.size(); n++) {
144 m_acov += m_ac[n] * theta[k];
145 m_ecov += m_ec[n] * theta[k];
147 for (
size_t n = 0; n < m_mc.size(); n++) {
149 th = std::max(theta[k],
Tiny);
150 m_mcov += m_mc[n]*std::log(th);
160 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
161 return m_A * std::exp(std::log(10.0)*m_acov + m_b*logT -
162 (m_E + m_ecov)*recipT + m_mcov);
171 return m_A * std::exp(std::log(10.0)*m_acov + m_mcov);
186 doublereal m_b, m_E, m_A;
187 doublereal m_acov, m_ecov, m_mcov;
188 std::vector<size_t> m_sp, m_msp;
216 return PLOG_REACTION_RATECOEFF_TYPE;
223 explicit Plog(
const std::multimap<double, Arrhenius>&
rates);
235 "Pressure out of range: {}",
logP_);
237 "Pressure out of range: {}",
logP_);
241 ihigh1_ = iter->second.first;
242 ihigh2_ = iter->second.second;
245 logP1_ = (--iter)->first;
246 ilow1_ = iter->second.first;
247 ilow2_ = iter->second.second;
257 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
258 double log_k1, log_k2;
260 log_k1 = rates_[
ilow1_].updateLog(logT, recipT);
263 for (
size_t i =
ilow1_; i < ilow2_; i++) {
264 k += rates_[i].updateRC(logT, recipT);
266 log_k1 = std::log(k);
269 if (ihigh1_ == ihigh2_) {
270 log_k2 = rates_[ihigh1_].updateLog(logT, recipT);
273 for (
size_t i = ihigh1_; i < ihigh2_; i++) {
274 k += rates_[i].updateRC(logT, recipT);
276 log_k2 = std::log(k);
279 return std::exp(log_k1 + (log_k2-log_k1) * (
logP_-logP1_) *
rDeltaP_);
286 void validate(
const std::string& equation);
290 std::vector<std::pair<double, Arrhenius> >
rates()
const;
297 std::vector<Arrhenius> rates_;
345 return CHEBYSHEV_REACTION_RATECOEFF_TYPE;
367 double Pr = (2 * c[0] + PrNum_) *
PrDen_;
371 for (
size_t j = 0; j <
nT_; j++) {
374 for (
size_t i = 2; i <
nP_; i++) {
375 Cnp1 = 2 * Pr * Cn - Cnm1;
376 for (
size_t j = 0; j <
nT_; j++) {
389 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
390 double Tr = (2 * recipT + TrNum_) *
TrDen_;
395 for (
size_t i = 2; i <
nT_; i++) {
396 Cnp1 = 2 * Tr * Cn - Cnm1;
401 return std::pow(10, logk);
size_t ilow1_
Indices to the ranges within rates_ for the lower / upper pressure, such that rates_[ilow1_] through ...
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
Plog()
Default constructor.
doublereal preExponentialFactor() const
Return the pre-exponential factor A (in m, kmol, s to powers depending on the reaction order) account...
void addCoverageDependence(size_t k, doublereal a, doublereal m, doublereal e)
Add a coverage dependency for species k, with pre-exponential dependence a, rate constant exponential...
size_t nP_
number of points in the pressure direction
double Tmin() const
Minimum valid temperature [K].
static int type()
return the rate coefficient type.
Pressure-dependent rate expression where the rate coefficient is expressed as a bivariate Chebyshev p...
size_t nPressure() const
Number of points in the pressure direction.
double Pmin() const
Minimum valid pressure [Pa].
double logP2_
log(p) at the lower / upper pressure reference
std::vector< std::pair< double, Arrhenius > > rates() const
Return the pressures and Arrhenius expressions which comprise this reaction.
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
Arrhenius()
Default constructor.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
doublereal temperatureExponent() const
Return effective temperature exponent.
size_t nTemperature() const
Number of points in the temperature direction.
This file defines some constants used to specify reaction types.
double preExponentialFactor() const
Return the pre-exponential factor A (in m, kmol, s to powers depending on the reaction order) ...
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
vector_fp dotProd_
dot product of chebCoeffs with the reduced pressure polynomial
double TrDen_
terms appearing in the reduced temperature
doublereal activationEnergy_R() const
Return the activation energy divided by the gas constant (i.e.
double temperatureExponent() const
Return the temperature exponent b
void validate(const std::string &equation)
Check to make sure that the rate expression is finite over a range of temperatures at each interpolat...
const vector_fp & coeffs() const
Access the Chebyshev coefficients.
Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate ex...
doublereal activationEnergy_R() const
Return the activation energy divided by the gas constant (i.e.
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
doublereal updateLog(doublereal logT, doublereal recipT) const
Update the value of the natural logarithm of the rate constant.
Arrhenius reaction rate type depends only on temperature.
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
double Pmax_
valid pressure range
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
size_t nT_
number of points in the temperature direction
std::map< double, std::pair< size_t, size_t > > pressures_
log(p) to (index range) in the rates_ vector
double Tmax() const
Maximum valid temperature [K].
const doublereal Tiny
Small number to compare differences of mole fractions against.
double logP_
log(p) at the current state
ChebyshevRate()
Default constructor.
Contains declarations for string manipulation functions within Cantera.
Namespace for the Cantera kernel.
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
static int type()
return the rate coefficient type.
double PrDen_
terms appearing in the reduced pressure
double rDeltaP_
reciprocal of (logP2 - logP1)
An Arrhenius rate with coverage-dependent terms.
double Tmax_
valid temperature range
static int type()
return the rate coefficient type.
vector_fp chebCoeffs_
Chebyshev coefficients, length nP * nT.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
double Pmax() const
Maximum valid pressure [Pa].