27 m_logA = std::log(m_A);
31 SurfaceArrhenius::SurfaceArrhenius()
41 SurfaceArrhenius::SurfaceArrhenius(
double A,
double b,
double Ta)
52 doublereal m, doublereal e)
63 Plog::Plog(
const std::multimap<double, Arrhenius>& rates)
70 rates_.reserve(
rates.size());
72 for (
const auto& rate :
rates) {
73 double logp = std::log(rate.first);
83 rates_.push_back(rate.second);
93 double T[] = {200.0, 500.0, 1000.0, 2000.0, 5000.0, 10000.0};
94 for (
auto iter =
pressures_.begin(); iter->first < 1000; iter++) {
96 for (
size_t i=0; i < 6; i++) {
97 double k =
updateRC(log(T[i]), 1.0/T[i]);
103 "Invalid rate coefficient for reaction '{}'\nat P = {}, T = {}",
104 equation, std::exp((++iter)->first), T[i]);
112 std::vector<std::pair<double, Arrhenius> > R;
117 for (
size_t i = iter->second.first;
118 i < iter->second.second;
120 R.emplace_back(std::exp(iter->first), rates_[i]);
133 , nP_(coeffs.nColumns())
134 , nT_(coeffs.nRows())
135 , chebCoeffs_(coeffs.nColumns() * coeffs.nRows(), 0.0)
136 , dotProd_(coeffs.nRows())
138 double logPmin = std::log10(
Pmin);
139 double logPmax = std::log10(
Pmax);
140 double TminInv = 1.0 /
Tmin;
141 double TmaxInv = 1.0 /
Tmax;
143 TrNum_ = - TminInv - TmaxInv;
144 TrDen_ = 1.0 / (TmaxInv - TminInv);
145 PrNum_ = - logPmin - logPmax;
146 PrDen_ = 1.0 / (logPmax - logPmin);
148 for (
size_t t = 0; t <
nT_; t++) {
149 for (
size_t p = 0; p <
nP_; p++) {
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
Plog()
Default constructor.
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].
double Pmin() const
Minimum valid pressure [Pa].
std::vector< std::pair< double, Arrhenius > > rates() const
Return the pressures and Arrhenius expressions which comprise this reaction.
Arrhenius()
Default constructor.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Header file for class Cantera::Array2D.
double TrDen_
terms appearing in the reduced temperature
Base class for exceptions thrown by Cantera classes.
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.
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
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].
ChebyshevRate()
Default constructor.
Namespace for the Cantera kernel.
double PrDen_
terms appearing in the reduced pressure
vector_fp chebCoeffs_
Chebyshev coefficients, length nP * nT.
double Pmax() const
Maximum valid pressure [Pa].