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

Custom reaction rate depending only on temperature. More...

#include <Custom.h>

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

Public Member Functions

 CustomFunc1Rate (const AnyMap &node, const UnitStack &rate_units)
 
unique_ptr< MultiRateBasenewMultiRate () const override
 Create a rate evaluator for reactions of a particular derived type. More...
 
const std::string type () const override
 String identifying reaction rate specialization. More...
 
void getParameters (AnyMap &rateNode, const Units &rate_units=Units(0.)) const
 
virtual void validate (const std::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)
 
ReactionRateoperator= (const ReactionRate &other)
 
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...
 
virtual void check (const std::string &equation, const AnyMap &node)
 Check basic syntax and settings of reaction rate expression. More...
 
virtual void validate (const std::string &equation)
 Validate the reaction rate expression (legacy call) 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

shared_ptr< Func1m_ratefunc
 
- 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

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.

Warning
This class is an experimental part of the Cantera API and may be changed or removed without notice.

Definition at line 36 of file Custom.h.

Constructor & Destructor Documentation

◆ CustomFunc1Rate() [1/2]

Definition at line 12 of file Custom.cpp.

◆ CustomFunc1Rate() [2/2]

CustomFunc1Rate ( const AnyMap node,
const UnitStack rate_units 
)
inline

Definition at line 40 of file Custom.h.

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 unique_ptr<MultiRateBase>(new MultiRate<RateType, DataType>);
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition: Custom.h:46

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 46 of file Custom.h.

◆ type()

const std::string type ( ) const
inlineoverridevirtual

String identifying reaction rate specialization.

Implements ReactionRate.

Definition at line 50 of file Custom.h.

◆ getParameters() [1/2]

void getParameters ( AnyMap rateNode,
const Units rate_units = Units(0.) 
) const

Definition at line 38 of file Custom.cpp.

◆ validate()

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

Validate the reaction rate expression.

Reimplemented from ReactionRate.

Definition at line 22 of file Custom.cpp.

◆ evalFromStruct()

double evalFromStruct ( const ArrheniusData shared_data) const

Update information specific to reaction.

Parameters
shared_datadata shared by all reactions of a given type

Definition at line 30 of file Custom.cpp.

References ReactionData::temperature.

◆ setRateFunction()

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 17 of file Custom.cpp.

◆ getParameters() [2/2]

virtual 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 172 of file ReactionRate.h.

Member Data Documentation

◆ m_ratefunc

shared_ptr<Func1> m_ratefunc
protected

Definition at line 71 of file Custom.h.


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