Cantera
3.1.0a1
|
Custom reaction rate depending only on temperature. More...
#include <Custom.h>
Custom reaction rate depending only on temperature.
The rate expression is provided by a Func1 object taking a single argument (temperature) and does not use a formalized parameterization.
Public Member Functions | |
CustomFunc1Rate (const AnyMap &node, const UnitStack &rate_units) | |
unique_ptr< MultiRateBase > | newMultiRate () const override |
Create a rate evaluator for reactions of a particular derived type. More... | |
const string | type () const override |
String identifying reaction rate specialization. More... | |
void | getParameters (AnyMap &rateNode, const Units &rate_units=Units(0.)) const |
void | validate (const string &equation, const Kinetics &kin) override |
Validate the reaction rate expression. More... | |
double | evalFromStruct (const ArrheniusData &shared_data) const |
Update information specific to reaction. More... | |
void | setRateFunction (shared_ptr< Func1 > f) |
Set custom rate. More... | |
virtual void | getParameters (AnyMap &node) const |
Get parameters. More... | |
Public Member Functions inherited from ReactionRate | |
ReactionRate (const ReactionRate &other) | |
ReactionRate & | operator= (const ReactionRate &other) |
virtual const string | subType () const |
String identifying sub-type of reaction rate specialization. More... | |
virtual void | setParameters (const AnyMap &node, const UnitStack &units) |
Set parameters. More... | |
AnyMap | parameters () const |
Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function. More... | |
const Units & | conversionUnits () const |
Get the units for converting the leading term in the reaction rate expression. More... | |
virtual void | setRateUnits (const UnitStack &rate_units) |
Set the units of the reaction rate expression. More... | |
virtual void | check (const string &equation) |
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 vector< double > &extra) |
Evaluate reaction rate based on temperature and an extra vector parameter. More... | |
bool | valid () const |
Get flag indicating whether reaction rate is set up correctly. More... | |
bool | compositionDependent () |
Boolean indicating whether rate has compositional dependence. More... | |
void | setCompositionDependence (bool comp_dep) |
Set rate compositional dependence. More... | |
Protected Attributes | |
shared_ptr< Func1 > | m_ratefunc |
Protected Attributes inherited from ReactionRate | |
AnyMap | m_input |
Input data used for specific models. More... | |
size_t | m_rate_index = npos |
Index of reaction rate within kinetics evaluator. More... | |
bool | m_valid = false |
Flag indicating whether reaction rate is set up correctly. More... | |
bool | m_composition_dependent_rate = false |
Flag indicating composition dependent rate. More... | |
Units | m_conversion_units {0.} |
Units of the leading term in the reaction rate expression. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ReactionRate | |
virtual void | getParameters (AnyMap &node) const |
Get parameters. More... | |
|
inlineoverridevirtual |
Create a rate evaluator for reactions of a particular derived type.
Derived classes usually implement this as:
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.
|
inlineoverridevirtual |
String identifying reaction rate specialization.
Implements ReactionRate.
|
overridevirtual |
Validate the reaction rate expression.
Reimplemented from ReactionRate.
Definition at line 24 of file Custom.cpp.
double evalFromStruct | ( | const ArrheniusData & | shared_data | ) | const |
Update information specific to reaction.
shared_data | data shared by all reactions of a given type |
Definition at line 32 of file Custom.cpp.
void setRateFunction | ( | shared_ptr< Func1 > | f | ) |
Set custom rate.
The call to the Func1 object takes a single argument (temperature) and does not depend on parameters handled in C++.
Definition at line 18 of file Custom.cpp.
|
inline |
Get parameters.
node | AnyMap 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. |
Definition at line 224 of file ReactionRate.h.