Go to the documentation of this file.
40 "To be removed after Cantera 2.5.");
41 return ARRHENIUS_REACTION_RATECOEFF_TYPE;
53 Arrhenius(doublereal A, doublereal b, doublereal E);
66 doublereal
updateLog(doublereal logT, doublereal recipT)
const {
67 return m_logA + m_b*logT - m_E*recipT;
76 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
77 return m_A * std::exp(m_b*logT - m_E*recipT);
98 doublereal m_logA, m_b, m_E, m_A;
133 "To be removed after Cantera 2.5.");
134 return SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE;
144 doublereal m, doublereal e);
146 void update_C(
const doublereal* theta) {
152 for (
size_t n = 0; n < m_ac.size(); n++) {
154 m_acov += m_ac[n] * theta[k];
155 m_ecov += m_ec[n] * theta[k];
157 for (
size_t n = 0; n < m_mc.size(); n++) {
159 th = std::max(theta[k],
Tiny);
160 m_mcov += m_mc[n]*std::log(th);
170 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
171 return m_A * std::exp(std::log(10.0)*m_acov + m_b*logT -
172 (m_E + m_ecov)*recipT + m_mcov);
181 return m_A * std::exp(std::log(10.0)*m_acov + m_mcov);
196 doublereal m_b, m_E, m_A;
197 doublereal m_acov, m_ecov, m_mcov;
198 std::vector<size_t> m_sp, m_msp;
230 "To be removed after Cantera 2.5.");
231 return PLOG_REACTION_RATECOEFF_TYPE;
238 explicit Plog(
const std::multimap<double, Arrhenius>&
rates);
250 "Pressure out of range: {}",
logP_);
252 "Pressure out of range: {}",
logP_);
256 ihigh1_ = iter->second.first;
257 ihigh2_ = iter->second.second;
260 logP1_ = (--iter)->first;
261 ilow1_ = iter->second.first;
262 ilow2_ = iter->second.second;
272 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
273 double log_k1, log_k2;
275 log_k1 = rates_[
ilow1_].updateLog(logT, recipT);
278 for (
size_t i =
ilow1_; i < ilow2_; i++) {
279 k += rates_[i].updateRC(logT, recipT);
281 log_k1 = std::log(k);
284 if (ihigh1_ == ihigh2_) {
285 log_k2 = rates_[ihigh1_].updateLog(logT, recipT);
288 for (
size_t i = ihigh1_; i < ihigh2_; i++) {
289 k += rates_[i].updateRC(logT, recipT);
291 log_k2 = std::log(k);
294 return std::exp(log_k1 + (log_k2-log_k1) * (
logP_-logP1_) *
rDeltaP_);
301 void validate(
const std::string& equation);
305 std::vector<std::pair<double, Arrhenius> >
rates()
const;
312 std::vector<Arrhenius> rates_;
364 "To be removed after Cantera 2.5.");
365 return CHEBYSHEV_REACTION_RATECOEFF_TYPE;
387 double Pr = (2 * c[0] + PrNum_) *
PrDen_;
391 for (
size_t j = 0; j <
nT_; j++) {
394 for (
size_t i = 1; i <
nP_; i++) {
395 Cnp1 = 2 * Pr * Cn - Cnm1;
396 for (
size_t j = 0; j <
nT_; j++) {
409 doublereal
updateRC(doublereal logT, doublereal recipT)
const {
410 double Tr = (2 * recipT + TrNum_) *
TrDen_;
415 for (
size_t i = 1; i <
nT_; i++) {
416 Cnp1 = 2 * Tr * Cn - Cnm1;
421 return std::pow(10, logk);
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
Arrhenius reaction rate type depends only on temperature.
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value of the rate constant.
const vector_fp & coeffs() const
Access the Chebyshev coefficients.
static int type()
return the rate coefficient type.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
std::map< double, std::pair< size_t, size_t > > pressures_
log(p) to (index range) in the rates_ vector
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
ChebyshevRate()
Default constructor.
const double Tiny
Small number to compare differences of mole fractions against.
void addCoverageDependence(size_t k, doublereal a, doublereal m, doublereal e)
Add a coverage dependency for species k, with exponential dependence a, power-law exponent m,...
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
Pressure-dependent rate expression where the rate coefficient is expressed as a bivariate Chebyshev p...
double Tmax() const
Maximum valid temperature [K].
double logP_
log(p) at the current state
size_t nT_
number of points in the temperature direction
double TrDen_
terms appearing in the reduced temperature
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
vector_fp dotProd_
dot product of chebCoeffs with the reduced pressure polynomial
size_t ilow1_
Indices to the ranges within rates_ for the lower / upper pressure, such that rates_[ilow1_] through ...
double PrDen_
terms appearing in the reduced pressure
double temperatureExponent() const
Return the temperature exponent b
Arrhenius()
Default constructor.
Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate ex...
double Tmin() const
Minimum valid temperature [K].
doublereal activationEnergy_R() const
Return the activation energy divided by the gas constant (i.e.
size_t nP_
number of points in the pressure direction
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
double logP2_
log(p) at the lower / upper pressure reference
Plog()
Default constructor.
size_t nPressure() const
Number of points in the pressure direction.
double rDeltaP_
reciprocal of (logP2 - logP1)
double Pmin() const
Minimum valid pressure [Pa].
static int type()
return the rate coefficient type.
doublereal activationEnergy_R() const
Return the activation energy divided by the gas constant (i.e.
double Tmax_
valid temperature range
doublereal preExponentialFactor() const
Return the pre-exponential factor A (in m, kmol, s to powers depending on the reaction order) account...
double Pmax() const
Maximum valid pressure [Pa].
doublereal temperatureExponent() const
Return effective temperature exponent.
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 chebCoeffs_
Chebyshev coefficients, length nP * nT.
static int type()
return the rate coefficient type.
doublereal updateLog(doublereal logT, doublereal recipT) const
Update the value of the natural logarithm of the rate constant.
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.
size_t nTemperature() const
Number of points in the temperature direction.
Namespace for the Cantera kernel.
void validate(const std::string &equation)
Check to make sure that the rate expression is finite over a range of temperatures at each interpolat...
double Pmax_
valid pressure range
An Arrhenius rate with coverage-dependent terms.