Cantera  3.1.0a1
Loading...
Searching...
No Matches

Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate expressions at various pressures. More...

#include <PlogRate.h>

Inheritance diagram for PlogRate:
[legend]

Detailed Description

Pressure-dependent reaction rate expressed by logarithmically interpolating between Arrhenius rate expressions at various pressures.

Given two rate expressions at two specific pressures:

  • \( P_1: k_1(T) = A_1 T^{b_1} e^{-E_1 / RT} \)
  • \( P_2: k_2(T) = A_2 T^{b_2} e^{-E_2 / RT} \)

The rate at an intermediate pressure \( P_1 < P < P_2 \) is computed as

\[ \ln k(T,P) = \ln k_1(T) + \bigl(\ln k_2(T) - \ln k_1(T)\bigr) \frac{\ln P - \ln P_1}{\ln P_2 - \ln P_1} \]

Multiple rate expressions may be given at the same pressure, in which case the rate used in the interpolation formula is the sum of all the rates given at that pressure. For pressures outside the given range, the rate expression at the nearest pressure is used.

Definition at line 76 of file PlogRate.h.

Public Member Functions

 PlogRate ()=default
 Default constructor.
 
 PlogRate (const std::multimap< double, ArrheniusRate > &rates)
 Constructor from Arrhenius rate expressions at a set of pressures.
 
 PlogRate (const AnyMap &node, const UnitStack &rate_units={})
 
unique_ptr< MultiRateBasenewMultiRate () const override
 Create a rate evaluator for reactions of a particular derived type.
 
const string type () const override
 Identifier of reaction rate type.
 
void setParameters (const AnyMap &node, const UnitStack &rate_units) override
 Perform object setup based on AnyMap node information.
 
void getParameters (AnyMap &rateNode, const Units &rate_units) const
 
void getParameters (AnyMap &rateNode) const override
 Get parameters.
 
void updateFromStruct (const PlogData &shared_data)
 Update information specific to reaction.
 
double evalFromStruct (const PlogData &shared_data)
 Evaluate reaction rate.
 
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 interpolation pressure.
 
std::multimap< double, ArrheniusRategetRates () const
 Return the pressures and Arrhenius expressions which comprise this reaction.
 
- Public Member Functions inherited from ReactionRate
 ReactionRate (const ReactionRate &other)
 
ReactionRateoperator= (const ReactionRate &other)
 
virtual unique_ptr< MultiRateBasenewMultiRate () const
 Create a rate evaluator for reactions of a particular derived type.
 
virtual const string type () const =0
 String identifying reaction rate specialization.
 
virtual const string subType () const
 String identifying sub-type of reaction rate specialization.
 
virtual void setParameters (const AnyMap &node, const UnitStack &units)
 Set parameters.
 
AnyMap parameters () const
 Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function.
 
const UnitsconversionUnits () const
 Get the units for converting the leading term in the reaction rate expression.
 
virtual void setRateUnits (const UnitStack &rate_units)
 Set the units of the reaction rate expression.
 
virtual void check (const string &equation)
 Check basic syntax and settings of reaction rate expression.
 
virtual void validate (const string &equation, const Kinetics &kin)
 Validate the reaction rate expression.
 
size_t rateIndex () const
 Reaction rate index within kinetics evaluator.
 
void setRateIndex (size_t idx)
 Set reaction rate index within kinetics evaluator.
 
virtual void setContext (const Reaction &rxn, const Kinetics &kin)
 Set context of reaction rate evaluation.
 
double eval (double T)
 Evaluate reaction rate based on temperature.
 
double eval (double T, double extra)
 Evaluate reaction rate based on temperature and an extra parameter.
 
double eval (double T, const vector< double > &extra)
 Evaluate reaction rate based on temperature and an extra vector parameter.
 
bool valid () const
 Get flag indicating whether reaction rate is set up correctly.
 
bool compositionDependent ()
 Boolean indicating whether rate has compositional dependence.
 
void setCompositionDependence (bool comp_dep)
 Set rate compositional dependence.
 

Protected Attributes

map< double, pair< size_t, size_t > > pressures_
 log(p) to (index range) in the rates_ vector
 
vector< ArrheniusRaterates_
 
double logP_ = -1000
 log(p) at the current state
 
double logP1_ = 1000
 log(p) at the lower pressure reference
 
double logP2_ = -1000
 log(p) at the upper pressure reference
 
size_t ilow1_
 Indices to the ranges within rates_ for the lower / upper pressure, such that rates_[ilow1_] through rates_[ilow2_] (inclusive) are the rates expressions which are combined to form the rate at the lower reference pressure.
 
size_t ilow2_
 
size_t ihigh1_
 
size_t ihigh2_
 
double rDeltaP_ = -1.0
 reciprocal of (logP2 - logP1)
 
- Protected Attributes inherited from ReactionRate
AnyMap m_input
 Input data used for specific models.
 
size_t m_rate_index = npos
 Index of reaction rate within kinetics evaluator.
 
bool m_valid = false
 Flag indicating whether reaction rate is set up correctly.
 
bool m_composition_dependent_rate = false
 Flag indicating composition dependent rate.
 
Units m_conversion_units {0.}
 Units of the leading term in the reaction rate expression.
 

Additional Inherited Members

virtual void getParameters (AnyMap &node) const
 Get parameters.
 

Constructor & Destructor Documentation

◆ PlogRate() [1/3]

PlogRate ( )
default

Default constructor.

◆ PlogRate() [2/3]

PlogRate ( const std::multimap< double, ArrheniusRate > &  rates)
explicit

Constructor from Arrhenius rate expressions at a set of pressures.

Definition at line 52 of file PlogRate.cpp.

◆ PlogRate() [3/3]

PlogRate ( const AnyMap node,
const UnitStack rate_units = {} 
)

Definition at line 57 of file PlogRate.cpp.

Member Function Documentation

◆ newMultiRate()

unique_ptr< MultiRateBase > newMultiRate ( ) const
inlineoverridevirtual

Create a rate evaluator for reactions of a particular derived type.

Derived classes usually implement this as:

unique_ptr<MultiRateBase> newMultiRate() const override {
return make_unique<MultiRate<RateType, DataType>>();
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition PlogRate.h:87

where RateType is the derived class name and DataType is the corresponding container for parameters needed to evaluate reactions of that type.

Reimplemented from ReactionRate.

Definition at line 87 of file PlogRate.h.

◆ type()

const string type ( ) const
inlineoverridevirtual

Identifier of reaction rate type.

Implements ReactionRate.

Definition at line 92 of file PlogRate.h.

◆ setParameters()

void setParameters ( const AnyMap node,
const UnitStack rate_units 
)
overridevirtual

Perform object setup based on AnyMap node information.

Parameters
nodeAnyMap containing rate information
rate_unitsUnit definitions specific to rate information

Reimplemented from ReactionRate.

Definition at line 62 of file PlogRate.cpp.

◆ getParameters() [1/2]

void getParameters ( AnyMap rateNode,
const Units rate_units 
) const

Definition at line 76 of file PlogRate.cpp.

◆ getParameters() [2/2]

void getParameters ( AnyMap node) const
inlineoverridevirtual

Get parameters.

Parameters
nodeAnyMap containing rate information Store the parameters of a ReactionRate needed to reconstruct an identical object. Does not include user-defined fields available in the m_input map.

Reimplemented from ReactionRate.

Definition at line 102 of file PlogRate.h.

◆ updateFromStruct()

void updateFromStruct ( const PlogData shared_data)
inline

Update information specific to reaction.

Parameters
shared_datadata shared by all reactions of a given type

Definition at line 110 of file PlogRate.h.

◆ evalFromStruct()

double evalFromStruct ( const PlogData shared_data)
inline

Evaluate reaction rate.

Parameters
shared_datadata shared by all reactions of a given type

Definition at line 141 of file PlogRate.h.

◆ setRates()

void setRates ( const std::multimap< double, ArrheniusRate > &  rates)

Set up Plog object.

Definition at line 92 of file PlogRate.cpp.

◆ validate()

void validate ( const string &  equation,
const Kinetics kin 
)
overridevirtual

Check to make sure that the rate expression is finite over a range of temperatures at each interpolation pressure.

This is potentially an issue when one of the Arrhenius expressions at a particular pressure has a negative pre-exponential factor.

Reimplemented from ReactionRate.

Definition at line 125 of file PlogRate.cpp.

◆ getRates()

std::multimap< double, ArrheniusRate > getRates ( ) const

Return the pressures and Arrhenius expressions which comprise this reaction.

Definition at line 160 of file PlogRate.cpp.

Member Data Documentation

◆ pressures_

map<double, pair<size_t, size_t> > pressures_
protected

log(p) to (index range) in the rates_ vector

Definition at line 181 of file PlogRate.h.

◆ rates_

vector<ArrheniusRate> rates_
protected

Definition at line 184 of file PlogRate.h.

◆ logP_

double logP_ = -1000
protected

log(p) at the current state

Definition at line 186 of file PlogRate.h.

◆ logP1_

double logP1_ = 1000
protected

log(p) at the lower pressure reference

Definition at line 187 of file PlogRate.h.

◆ logP2_

double logP2_ = -1000
protected

log(p) at the upper pressure reference

Definition at line 188 of file PlogRate.h.

◆ ilow1_

size_t ilow1_
protected

Indices to the ranges within rates_ for the lower / upper pressure, such that rates_[ilow1_] through rates_[ilow2_] (inclusive) are the rates expressions which are combined to form the rate at the lower reference pressure.

Definition at line 194 of file PlogRate.h.

◆ ilow2_

size_t ilow2_
protected

Definition at line 194 of file PlogRate.h.

◆ ihigh1_

size_t ihigh1_
protected

Definition at line 194 of file PlogRate.h.

◆ ihigh2_

size_t ihigh2_
protected

Definition at line 194 of file PlogRate.h.

◆ rDeltaP_

double rDeltaP_ = -1.0
protected

reciprocal of (logP2 - logP1)

Definition at line 196 of file PlogRate.h.


The documentation for this class was generated from the following files: