23 void update(
double T)
override;
25 void update(
double T,
double P)
override {
83 explicit PlogRate(
const std::multimap<double, ArrheniusRate>& rates);
88 return make_unique<MultiRate<PlogRate, PlogData>>();
92 const string type()
const override {
return "pressure-dependent-Arrhenius"; }
101 void getParameters(
AnyMap& rateNode,
const Units& rate_units)
const;
103 return getParameters(rateNode,
Units(0));
119 "Pressure out of range: {}",
logP_);
121 "Pressure out of range: {}",
logP_);
125 ihigh1_ = iter->second.first;
126 ihigh2_ = iter->second.second;
130 ilow1_ = iter->second.first;
131 ilow2_ = iter->second.second;
142 double log_k1, log_k2;
147 for (
size_t i =
ilow1_; i < ilow2_; i++) {
148 k += rates_[i].evalRate(shared_data.
logT, shared_data.
recipT);
150 log_k1 = std::log(k);
153 if (ihigh1_ == ihigh2_) {
154 log_k2 = rates_[ihigh1_].evalLog(shared_data.
logT, shared_data.
recipT);
157 for (
size_t i = ihigh1_; i < ihigh2_; i++) {
158 k += rates_[i].evalRate(shared_data.
logT, shared_data.
recipT);
160 log_k2 = std::log(k);
167 void setRates(
const std::multimap<double, ArrheniusRate>& rates);
177 std::multimap<double, ArrheniusRate>
getRates()
const;
184 vector<ArrheniusRate> rates_;
Header for reaction rates that involve Arrhenius-type kinetics.
A map of string keys to values whose type can vary at runtime.
Public interface for kinetics managers.
Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate ex...
void getParameters(AnyMap &rateNode) const override
Get parameters.
map< double, pair< size_t, size_t > > pressures_
log(p) to (index range) in the rates_ vector
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
void updateFromStruct(const PlogData &shared_data)
Update information specific to reaction.
PlogRate()=default
Default constructor.
std::multimap< double, ArrheniusRate > getRates() const
Return the pressures and Arrhenius expressions which comprise this reaction.
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Perform object setup based on AnyMap node information.
void setRates(const std::multimap< double, ArrheniusRate > &rates)
Set up Plog object.
void validate(const string &equation, const Kinetics &kin) override
Check to make sure that the rate expression is finite over a range of temperatures at each interpolat...
double evalFromStruct(const PlogData &shared_data)
Evaluate reaction rate.
double rDeltaP_
reciprocal of (logP2 - logP1)
double logP_
log(p) at the current state
const string type() const override
Identifier of reaction rate type.
double logP1_
log(p) at the lower pressure reference
size_t ilow1_
Indices to the ranges within rates_ for the lower / upper pressure, such that rates_[ilow1_] through ...
double logP2_
log(p) at the upper pressure reference
Abstract base class for reaction rate definitions; this base class is used by user-facing APIs to acc...
Base class for a phase with thermodynamic properties.
A representation of the units associated with a dimensional quantity.
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
Namespace for the Cantera kernel.
Data container holding shared data specific to PlogRate.
void perturbPressure(double deltaP)
Perturb pressure of data container.
double m_pressure_buf
buffered pressure
void update(double T) override
Update data container based on temperature T
double logP
logarithm of pressure
void restore() override
Restore data container after a perturbation.
void invalidateCache() override
Force shared data and reaction rates to be updated next time.
void update(double T, double P) override
Update data container based on temperature T and an extra parameter.
Data container holding shared data used for ReactionRate calculation.
double recipT
inverse of temperature
virtual void update(double T)
Update data container based on temperature T
double logT
logarithm of temperature
virtual void invalidateCache()
Force shared data and reaction rates to be updated next time.
Unit aggregation utility.