17 : m_b(rdata.rateCoeffParameters[1])
18 , m_E(rdata.rateCoeffParameters[2])
19 , m_A(rdata.rateCoeffParameters[0])
24 m_logA = std::log(m_A);
40 SurfaceArrhenius::SurfaceArrhenius()
53 SurfaceArrhenius::SurfaceArrhenius(
double A,
double b,
double Ta)
66 SurfaceArrhenius::SurfaceArrhenius(
const ReactionData& rdata)
67 : m_b(rdata.rateCoeffParameters[1])
68 , m_E(rdata.rateCoeffParameters[2])
69 , m_A(rdata.rateCoeffParameters[0])
79 m_logA = std::log(m_A);
82 const vector_fp& data = rdata.rateCoeffParameters;
83 if (data.size() >= 7) {
84 for (
size_t n = 3; n < data.size()-3; n += 4) {
85 addCoverageDependence(
size_t(data[n]), data[n+1],
86 data[n+2], data[n+3]);
92 doublereal m, doublereal e) {
110 warn_deprecated(
"class ExchangeCurrent",
"Duplicate of class Arrhenius."
111 " To be removed after Cantera 2.2.");
115 : m_b(rdata.rateCoeffParameters[1])
116 , m_E(rdata.rateCoeffParameters[2])
117 , m_A(rdata.rateCoeffParameters[0])
119 warn_deprecated(
"class ExchangeCurrent",
"Duplicate of class Arrhenius."
120 " To be removed after Cantera 2.2.");
124 m_logA = std::log(m_A);
133 warn_deprecated(
"class ExchangeCurrent",
"Duplicate of class Arrhenius."
134 " To be removed after Cantera 2.2.");
138 m_logA = std::log(m_A);
148 typedef std::multimap<double, vector_fp>::const_iterator iter_t;
156 double logp = std::log(iter->first);
166 rates_.push_back(
Arrhenius(iter->second[0], iter->second[1],
186 rates_.reserve(rates.size());
188 for (std::multimap<double, Arrhenius>::const_iterator iter = rates.begin();
191 double logp = std::log(iter->first);
201 rates_.push_back(iter->second);
211 double T[] = {200.0, 500.0, 1000.0, 2000.0, 5000.0, 10000.0};
216 for (
size_t i=0; i < 6; i++) {
217 double k =
updateRC(log(T[i]), 1.0/T[i]);
223 "Invalid rate coefficient for reaction '" + equation +
224 "'\nat P = " +
fp2str(std::exp((++iter)->first)) +
233 std::vector<std::pair<double, Arrhenius> > R;
235 for (std::map<
double, std::pair<size_t, size_t> >::const_iterator iter = ++
pressures_.begin();
238 for (
size_t i = iter->second.first;
239 i < iter->second.second;
241 R.push_back(std::make_pair(std::exp(iter->first), rates_[i]));
248 : Tmin_(rdata.chebTmin)
249 , Tmax_(rdata.chebTmax)
250 , Pmin_(rdata.chebPmin)
251 , Pmax_(rdata.chebPmax)
252 , nP_(rdata.chebDegreeP)
253 , nT_(rdata.chebDegreeT)
254 , chebCoeffs_(rdata.chebCoeffs)
255 , dotProd_(rdata.chebDegreeT)
257 double logPmin = std::log10(rdata.
chebPmin);
258 double logPmax = std::log10(rdata.
chebPmax);
259 double TminInv = 1.0 / rdata.
chebTmin;
260 double TmaxInv = 1.0 / rdata.
chebTmax;
262 TrNum_ = - TminInv - TmaxInv;
263 TrDen_ = 1.0 / (TmaxInv - TminInv);
264 PrNum_ = - logPmin - logPmax;
265 PrDen_ = 1.0 / (logPmax - logPmin);
274 , nP_(coeffs.nColumns())
275 , nT_(coeffs.nRows())
276 , chebCoeffs_(coeffs.nColumns() * coeffs.nRows(), 0.0)
277 , dotProd_(coeffs.nRows())
279 double logPmin = std::log10(Pmin);
280 double logPmax = std::log10(Pmax);
281 double TminInv = 1.0 /
Tmin;
282 double TmaxInv = 1.0 /
Tmax;
284 TrNum_ = - TminInv - TmaxInv;
285 TrDen_ = 1.0 / (TmaxInv - TminInv);
286 PrNum_ = - logPmin - logPmax;
287 PrDen_ = 1.0 / (logPmax - logPmin);
289 for (
size_t t = 0; t <
nT_; t++) {
290 for (
size_t p = 0; p <
nP_; p++) {
Plog()
Default constructor.
const vector_fp & coeffs() const
Access the Chebyshev coefficients.
void addCoverageDependence(size_t k, doublereal a, doublereal m, doublereal e)
Add a coverage dependency for species k, with pre-exponential dependence a, temperature exponent depe...
size_t nP_
number of points in the pressure direction
std::multimap< double, vector_fp > plogParameters
Arrhenius parameters for P-log reactions.
double chebPmin
Minimum pressure for Chebyshev fit.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
bool validate
Perform validation of the rate coefficient data.
Arrhenius()
Default constructor.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
std::vector< std::pair< double, Arrhenius > > rates() const
Return the pressures and Arrhenius expressions which comprise this reaction.
Header file for class Cantera::Array2D.
std::string equation
The reaction equation. Used only for display purposes.
double chebPmax
Maximum pressure for Chebyshev fit.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
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...
void update_C(const doublereal *c)
Update concentration-dependent parts of the rate coefficient.
Arrhenius reaction rate type depends only on temperature.
double Tmax() const
Maximum valid temperature [K].
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
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
ChebyshevRate()
Default constructor.
doublereal updateRC(doublereal logT, doublereal recipT) const
Update the value the rate constant.
ExchangeCurrent()
Default constructor.
double PrDen_
terms appearing in the reduced pressure
double chebTmax
Maximum temperature for Chebyshev fit.
vector_fp chebCoeffs_
Chebyshev coefficients, length nP * nT.
double Tmin() const
Minimum valid temperature [K].
double chebTmin
Minimum temperature for Chebyshev fit.