Cantera
3.1.0a1
|
Abstract base class which stores data about a reaction and its rate parameterization so that it can be added to a Kinetics object. More...
#include <Reaction.h>
Abstract base class which stores data about a reaction and its rate parameterization so that it can be added to a Kinetics object.
Definition at line 24 of file Reaction.h.
Public Member Functions | |
Reaction (const Composition &reactants, const Composition &products, shared_ptr< ReactionRate > rate, shared_ptr< ThirdBody > tbody=nullptr) | |
Reaction (const string &equation, shared_ptr< ReactionRate > rate, shared_ptr< ThirdBody > tbody=nullptr) | |
Reaction (const AnyMap &node, const Kinetics &kin) | |
Construct a Reaction and corresponding ReactionRate based on AnyMap (YAML) input. More... | |
string | reactantString () const |
The reactant side of the chemical equation for this reaction. More... | |
string | productString () const |
The product side of the chemical equation for this reaction. More... | |
string | equation () const |
The chemical equation for this reaction. More... | |
void | setEquation (const string &equation, const Kinetics *kin=0) |
Set the reactants and products based on the reaction equation. More... | |
string | type () const |
The type of reaction, including reaction rate information. More... | |
UnitStack | calculateRateCoeffUnits (const Kinetics &kin) |
Calculate the units of the rate constant. More... | |
void | check () |
Ensure that the rate constant and other parameters for this reaction are valid. More... | |
void | validate (Kinetics &kin) |
Perform validation checks that need access to a complete Kinetics objects, for. More... | |
AnyMap | parameters (bool withInput=true) const |
Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function. More... | |
void | setParameters (const AnyMap &node, const Kinetics &kin) |
Set up reaction based on AnyMap node More... | |
bool | valid () const |
Get validity flag of reaction. More... | |
void | setValid (bool valid) |
Set validity flag of reaction. More... | |
void | checkBalance (const Kinetics &kin) const |
Check that the specified reaction is balanced (same number of atoms for each element in the reactants and products). More... | |
bool | checkSpecies (const Kinetics &kin) const |
Verify that all species involved in the reaction are defined in the Kinetics object. More... | |
bool | usesElectrochemistry (const Kinetics &kin) const |
Check whether reaction uses electrochemistry. More... | |
shared_ptr< ReactionRate > | rate () |
Get reaction rate pointer. More... | |
void | setRate (shared_ptr< ReactionRate > rate) |
Set reaction rate pointer. More... | |
shared_ptr< ThirdBody > | thirdBody () |
Get pointer to third-body handler. More... | |
bool | usesThirdBody () const |
Check whether reaction involves third body collider. More... | |
Public Attributes | |
Composition | reactants |
Reactant species and stoichiometric coefficients. More... | |
Composition | products |
Product species and stoichiometric coefficients. More... | |
Composition | orders |
Forward reaction order with respect to specific species. More... | |
string | id |
An identification string for the reaction, used in some filtering operations. More... | |
bool | reversible = true |
True if the current reaction is reversible. False otherwise. More... | |
bool | duplicate = false |
True if the current reaction is marked as duplicate. More... | |
bool | allow_nonreactant_orders = false |
True if reaction orders can be specified for non-reactant species. More... | |
bool | allow_negative_orders = false |
True if negative reaction orders are allowed. Default is false . More... | |
AnyMap | input |
Input data used for specific models. More... | |
Units | rate_units {0.0} |
The units of the rate constant. More... | |
Protected Member Functions | |
void | getParameters (AnyMap &reactionNode) const |
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(AnyMap&, Kinetics&) function. More... | |
Protected Attributes | |
bool | m_valid = true |
Flag indicating whether reaction is set up correctly. More... | |
bool | m_explicit_type = false |
Flag indicating that serialization uses explicit type. More... | |
bool | m_from_composition = false |
Flag indicating that object was instantiated from reactant/product compositions. More... | |
shared_ptr< ReactionRate > | m_rate |
Reaction rate used by generic reactions. More... | |
shared_ptr< ThirdBody > | m_third_body |
Relative efficiencies of third-body species in enhancing the reaction rate (if applicable) More... | |
Construct a Reaction and corresponding ReactionRate based on AnyMap (YAML) input.
Definition at line 81 of file Reaction.cpp.
string reactantString | ( | ) | const |
The reactant side of the chemical equation for this reaction.
Definition at line 309 of file Reaction.cpp.
string productString | ( | ) | const |
The product side of the chemical equation for this reaction.
Definition at line 327 of file Reaction.cpp.
string equation | ( | ) | const |
The chemical equation for this reaction.
Definition at line 345 of file Reaction.cpp.
void setEquation | ( | const string & | equation, |
const Kinetics * | kin = 0 |
||
) |
Set the reactants and products based on the reaction equation.
If a Kinetics object is provided, it is used to check that all reactants and products exist.
Definition at line 354 of file Reaction.cpp.
string type | ( | ) | const |
The type of reaction, including reaction rate information.
Definition at line 504 of file Reaction.cpp.
Calculate the units of the rate constant.
These are determined by the units of the standard concentration of the reactant species' phases and the phase where the reaction occurs. Sets the value of rate_units.
Definition at line 523 of file Reaction.cpp.
void check | ( | ) |
Ensure that the rate constant and other parameters for this reaction are valid.
Definition at line 123 of file Reaction.cpp.
|
inline |
Perform validation checks that need access to a complete Kinetics objects, for.
Definition at line 66 of file Reaction.h.
AnyMap parameters | ( | bool | withInput = true | ) | const |
Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function.
Behavior specific to derived classes is handled by the getParameters() method.
withInput | If true, include additional input data fields associated with the object, such as user-defined fields from a YAML input file, as contained in the input attribute. |
Definition at line 159 of file Reaction.cpp.
Set up reaction based on AnyMap node
Definition at line 229 of file Reaction.cpp.
|
inline |
Get validity flag of reaction.
Definition at line 84 of file Reaction.h.
|
inline |
Set validity flag of reaction.
Definition at line 89 of file Reaction.h.
void checkBalance | ( | const Kinetics & | kin | ) | const |
Check that the specified reaction is balanced (same number of atoms for each element in the reactants and products).
Raises an exception if the reaction is not balanced. Used by checkSpecies.
kin | Kinetics object |
Definition at line 576 of file Reaction.cpp.
bool checkSpecies | ( | const Kinetics & | kin | ) | const |
Verify that all species involved in the reaction are defined in the Kinetics object.
The function returns true if all species are found, and raises an exception unless the kinetics object is configured to skip undeclared species, in which case false is returned.
kin | Kinetics object |
Definition at line 643 of file Reaction.cpp.
bool usesElectrochemistry | ( | const Kinetics & | kin | ) | const |
Check whether reaction uses electrochemistry.
kin | Kinetics object |
Definition at line 687 of file Reaction.cpp.
|
inline |
Get reaction rate pointer.
Definition at line 147 of file Reaction.h.
void setRate | ( | shared_ptr< ReactionRate > | rate | ) |
Set reaction rate pointer.
Definition at line 267 of file Reaction.cpp.
|
inline |
Get pointer to third-body handler.
Definition at line 155 of file Reaction.h.
|
inline |
Check whether reaction involves third body collider.
Definition at line 161 of file Reaction.h.
|
protected |
Store the parameters of a Reaction needed to reconstruct an identical object using the newReaction(AnyMap&, Kinetics&) function.
Does not include user-defined fields available in the input map.
Definition at line 181 of file Reaction.cpp.
Composition reactants |
Reactant species and stoichiometric coefficients.
Definition at line 111 of file Reaction.h.
Composition products |
Product species and stoichiometric coefficients.
Definition at line 114 of file Reaction.h.
Composition orders |
Forward reaction order with respect to specific species.
By default, mass-action kinetics is assumed, with the reaction order equal to each reactant's stoichiometric coefficient.
Definition at line 119 of file Reaction.h.
string id |
An identification string for the reaction, used in some filtering operations.
Definition at line 123 of file Reaction.h.
bool reversible = true |
True if the current reaction is reversible. False otherwise.
Definition at line 126 of file Reaction.h.
bool duplicate = false |
True if the current reaction is marked as duplicate.
Definition at line 129 of file Reaction.h.
bool allow_nonreactant_orders = false |
True if reaction orders can be specified for non-reactant species.
Default is false
.
Definition at line 133 of file Reaction.h.
bool allow_negative_orders = false |
True if negative reaction orders are allowed. Default is false
.
Definition at line 136 of file Reaction.h.
AnyMap input |
Input data used for specific models.
Definition at line 139 of file Reaction.h.
Units rate_units {0.0} |
The units of the rate constant.
These are determined by the units of the standard concentration of the reactant species' phases of the phase where the reaction occurs.
Definition at line 144 of file Reaction.h.
|
protected |
Flag indicating whether reaction is set up correctly.
Definition at line 172 of file Reaction.h.
|
protected |
Flag indicating that serialization uses explicit type.
Definition at line 175 of file Reaction.h.
|
protected |
Flag indicating that object was instantiated from reactant/product compositions.
Definition at line 178 of file Reaction.h.
|
protected |
Reaction rate used by generic reactions.
Definition at line 181 of file Reaction.h.
|
protected |
Relative efficiencies of third-body species in enhancing the reaction rate (if applicable)
Definition at line 185 of file Reaction.h.