Cantera 2.6.0
Public Member Functions | Protected Attributes | List of all members
PlogRate Class Referencefinal

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

#include <PlogRate.h>

Inheritance diagram for PlogRate:
[legend]
Collaboration diagram for PlogRate:
[legend]

Public Member Functions

 PlogRate ()
 Default constructor. More...
 
 PlogRate (const std::multimap< double, ArrheniusRate > &rates)
 Constructor from Arrhenius rate expressions at a set of pressures. More...
 
 PlogRate (const std::multimap< double, Arrhenius2 > &rates)
 Constructor using legacy Arrhenius2 framework. More...
 
 PlogRate (const AnyMap &node, const UnitStack &rate_units={})
 
unique_ptr< MultiRateBasenewMultiRate () const
 Create a rate evaluator for reactions of a particular derived type. More...
 
const std::string type () const
 Identifier of reaction rate type. More...
 
void setParameters (const AnyMap &node, const UnitStack &units)
 Perform object setup based on AnyMap node information. More...
 
void getParameters (AnyMap &rateNode, const Units &rate_units) const
 
void getParameters (AnyMap &rateNode) const
 Get parameters. More...
 
void updateFromStruct (const PlogData &shared_data)
 Update information specific to reaction. More...
 
double evalFromStruct (const PlogData &shared_data)
 Evaluate reaction rate. More...
 
void setup (const std::multimap< double, Arrhenius2 > &rates)
 Set up Plog object. More...
 
void setRates (const std::multimap< double, ArrheniusRate > &rates)
 Set up Plog object. More...
 
void update_C (const double *c)
 Update concentration-dependent parts of the rate coefficient. More...
 
double updateRC (double logT, double recipT) const
 Update the value the rate constant. More...
 
void validate (const std::string &equation, const Kinetics &kin)
 Check to make sure that the rate expression is finite over a range of temperatures at each interpolation pressure. More...
 
void validate (const std::string &equation)
 Validate the reaction rate expression (legacy call) More...
 
std::vector< std::pair< double, Arrhenius2 > > rates () const
 Return the pressures and Arrhenius expressions which comprise this reaction. More...
 
std::multimap< double, ArrheniusRategetRates () const
 Return the pressures and Arrhenius expressions which comprise this reaction. More...
 
- Public Member Functions inherited from ReactionRate
 ReactionRate (const ReactionRate &other)
 
ReactionRateoperator= (const ReactionRate &other)
 
AnyMap parameters () const
 Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function. More...
 
virtual void check (const std::string &equation, const AnyMap &node)
 Check basic syntax and settings of reaction rate expression. More...
 
size_t rateIndex () const
 Reaction rate index within kinetics evaluator. More...
 
void setRateIndex (size_t idx)
 Set reaction rate index within kinetics evaluator. More...
 
virtual void setContext (const Reaction &rxn, const Kinetics &kin)
 Set context of reaction rate evaluation. More...
 
double eval (double T)
 Evaluate reaction rate based on temperature. More...
 
double eval (double T, double extra)
 Evaluate reaction rate based on temperature and an extra parameter. More...
 
double eval (double T, const std::vector< double > &extra)
 Evaluate reaction rate based on temperature and an extra vector parameter. More...
 

Protected Attributes

std::map< double, std::pair< size_t, size_t > > pressures_
 log(p) to (index range) in the rates_ vector More...
 
std::vector< ArrheniusRaterates_
 
double logP_
 log(p) at the current state More...
 
double logP1_
 
double logP2_
 log(p) at the lower / upper pressure reference More...
 
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. More...
 
size_t ilow2_
 
size_t ihigh1_
 
size_t ihigh2_
 
double rDeltaP_
 reciprocal of (logP2 - logP1) More...
 
- Protected Attributes inherited from ReactionRate
AnyMap m_input
 Input data used for specific models. More...
 
size_t m_rate_index
 Index of reaction rate within kinetics evaluator. More...
 

Additional Inherited Members

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:

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

\[ \log k(T,P) = \log k_1(T) + \bigl(\log k_2(T) - \log k_1(T)\bigr) \frac{\log P - \log P_1}{\log P_2 - \log 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 77 of file PlogRate.h.

Constructor & Destructor Documentation

◆ PlogRate() [1/4]

PlogRate ( )

Default constructor.

Definition at line 51 of file PlogRate.cpp.

◆ PlogRate() [2/4]

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

Constructor from Arrhenius rate expressions at a set of pressures.

Definition at line 59 of file PlogRate.cpp.

References PlogRate::rates(), and PlogRate::setRates().

◆ PlogRate() [3/4]

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

Constructor using legacy Arrhenius2 framework.

Definition at line 65 of file PlogRate.cpp.

References PlogRate::rates(), and PlogRate::setup().

◆ PlogRate() [4/4]

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

Definition at line 89 of file PlogRate.h.

Member Function Documentation

◆ newMultiRate()

unique_ptr< MultiRateBase > newMultiRate ( ) const
inlinevirtual

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

Derived classes usually implement this as:

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

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 93 of file PlogRate.h.

◆ type()

const std::string type ( ) const
inlinevirtual

Identifier of reaction rate type.

Implements ReactionRate.

Definition at line 98 of file PlogRate.h.

◆ setParameters()

void setParameters ( const AnyMap node,
const UnitStack units 
)
virtual

Perform object setup based on AnyMap node information.

Parameters
nodeAnyMap containing rate information
unitsUnit definitions specific to rate information

Reimplemented from ReactionRate.

Definition at line 71 of file PlogRate.cpp.

References AnyMap::hasKey(), PlogRate::rates(), PlogRate::setRates(), and AnyMap::units().

◆ getParameters() [1/2]

void getParameters ( AnyMap rateNode,
const Units rate_units 
) const

Definition at line 88 of file PlogRate.cpp.

◆ getParameters() [2/2]

void getParameters ( AnyMap node) const
inlinevirtual

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 108 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 116 of file PlogRate.h.

References PlogData::logP, PlogRate::logP_, and PlogRate::update_C().

◆ 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 126 of file PlogRate.h.

References ReactionData::logT, ReactionData::recipT, and PlogRate::updateRC().

◆ setup()

void setup ( const std::multimap< double, Arrhenius2 > &  rates)

Set up Plog object.

Deprecated:
Deprecated in Cantera 2.6. Replaced by setRates.

Definition at line 112 of file PlogRate.cpp.

References PlogRate::rates(), and PlogRate::setRates().

Referenced by PlogRate::PlogRate().

◆ setRates()

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

Set up Plog object.

Definition at line 121 of file PlogRate.cpp.

References PlogRate::pressures_, and PlogRate::rates().

Referenced by PlogRate::PlogRate(), PlogRate::setParameters(), and PlogRate::setup().

◆ update_C()

void update_C ( const double *  c)
inline

Update concentration-dependent parts of the rate coefficient.

Parameters
cnatural log of the pressure in Pa
Deprecated:
To be removed after Cantera 2.6. Implementation will be moved to the updateFromStruct() method.

Definition at line 143 of file PlogRate.h.

References AssertThrowMsg, PlogRate::ilow1_, PlogRate::logP2_, PlogRate::logP_, PlogRate::pressures_, and PlogRate::rDeltaP_.

Referenced by PlogRate::updateFromStruct().

◆ updateRC()

double updateRC ( double  logT,
double  recipT 
) const
inline

Update the value the rate constant.

This function returns the actual value of the rate constant.

Deprecated:
To be removed after Cantera 2.6. Implementation will be moved to the evalFromStruct() method.

Definition at line 175 of file PlogRate.h.

References PlogRate::ilow1_, PlogRate::logP_, and PlogRate::rDeltaP_.

Referenced by PlogRate::evalFromStruct().

◆ validate() [1/2]

void validate ( const std::string &  equation,
const Kinetics kin 
)
inlinevirtual

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 204 of file PlogRate.h.

References PlogRate::validate().

Referenced by PlogRate::validate().

◆ validate() [2/2]

void validate ( const std::string &  equation)
virtual

Validate the reaction rate expression (legacy call)

Todo:
deprecate in favor of two-parameter version

Reimplemented from ReactionRate.

Definition at line 147 of file PlogRate.cpp.

◆ rates()

std::vector< std::pair< double, Arrhenius2 > > rates ( ) const

Return the pressures and Arrhenius expressions which comprise this reaction.

Deprecated:
Behavior to change after Cantera 2.6.
See also
getRates for new behavior.

Definition at line 172 of file PlogRate.cpp.

References PlogRate::getRates().

Referenced by PlogRate::PlogRate(), PlogRate::setParameters(), PlogRate::setRates(), and PlogRate::setup().

◆ getRates()

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

Return the pressures and Arrhenius expressions which comprise this reaction.

Definition at line 182 of file PlogRate.cpp.

References PlogRate::pressures_.

Referenced by PlogRate::rates().

Member Data Documentation

◆ pressures_

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

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

Definition at line 224 of file PlogRate.h.

Referenced by PlogRate::getRates(), PlogRate::setRates(), and PlogRate::update_C().

◆ rates_

std::vector<ArrheniusRate> rates_
protected

Definition at line 227 of file PlogRate.h.

◆ logP_

double logP_
protected

log(p) at the current state

Definition at line 229 of file PlogRate.h.

Referenced by PlogRate::update_C(), PlogRate::updateFromStruct(), and PlogRate::updateRC().

◆ logP1_

double logP1_
protected

Definition at line 230 of file PlogRate.h.

◆ logP2_

double logP2_
protected

log(p) at the lower / upper pressure reference

Definition at line 230 of file PlogRate.h.

Referenced by PlogRate::update_C().

◆ 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 236 of file PlogRate.h.

Referenced by PlogRate::update_C(), and PlogRate::updateRC().

◆ ilow2_

size_t ilow2_
protected

Definition at line 236 of file PlogRate.h.

◆ ihigh1_

size_t ihigh1_
protected

Definition at line 236 of file PlogRate.h.

◆ ihigh2_

size_t ihigh2_
protected

Definition at line 236 of file PlogRate.h.

◆ rDeltaP_

double rDeltaP_
protected

reciprocal of (logP2 - logP1)

Definition at line 238 of file PlogRate.h.

Referenced by PlogRate::update_C(), and PlogRate::updateRC().


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