Reaktoro  v2.1.1
A unified framework for modeling chemically reactive systems
GeneralReaction Class Reference

Used to define a general reaction. More...

#include <Reactions.hpp>

Public Member Functions

 GeneralReaction ()
 Construct a default GeneralReaction object.
 
 GeneralReaction (String const &equation)
 Construct a GeneralReaction object with given reaction equation as a formatted string. More...
 
auto setName (String const &name) -> GeneralReaction &
 Set the unique name of the reaction.
 
auto setEquation (String const &equation) -> GeneralReaction &
 Set the equation of the reaction as a formatted string. More...
 
auto setRateModel (ReactionRateModel const &model) -> GeneralReaction &
 Set the reaction rate model of the reaction.
 
auto setRateModel (ReactionRateModelGenerator const &model_generator) -> GeneralReaction &
 Set the reaction rate model generator of the reaction. More...
 
auto name () const -> String const &
 Return the name of the reaction.
 
auto equation () const -> String const &
 Return the reaction equation of the reaction.
 
auto rateModel () const -> ReactionRateModel const &
 Return the reaction rate model of the reaction.
 
auto rateModelGenerator () const -> ReactionRateModelGenerator const &
 Return the reaction rate model generator of the reaction.
 
auto operator() (ReactionGeneratorArgs args) const -> Reaction
 Convert this GeneralReaction object into a Reaction object.
 

Detailed Description

Used to define a general reaction.

Constructor & Destructor Documentation

◆ GeneralReaction()

GeneralReaction ( String const &  equation)
explicit

Construct a GeneralReaction object with given reaction equation as a formatted string.

Below are examples of formatted strings representing reaction equations:

GeneralReaction("CO2(g) + H2O = H+ + HCO3-");
GeneralReaction("Calcite + H+ = Ca++ + HCO3-");
GeneralReaction("Dolomite + 2*H+ = Ca++ + Mg++ + 2*HCO3-");
GeneralReaction("Quartz");
GeneralReaction()
Construct a default GeneralReaction object.

Note that unity stoichiometric coefficients can be ommited from the equation. The operator * must be used when this is not the case. Also note that equations with a single reactant name is possible, as in the Quartz reaction above. This exists to permit reaction rates to be defined for a single species instead of a normal stoichiometrically balanced reaction.

Member Function Documentation

◆ setEquation()

auto setEquation ( String const &  equation) -> GeneralReaction &

Set the equation of the reaction as a formatted string.

Below are examples of formatted strings representing reaction equations:

GeneralReaction("CO2(g) + H2O = H+ + HCO3-");
GeneralReaction("Calcite + H+ = Ca++ + HCO3-");
GeneralReaction("Dolomite + 2*H+ = Ca++ + Mg++ + 2*HCO3-");
GeneralReaction("Quartz");

Note that unity stoichiometric coefficients can be ommited from the equation. The operator * must be used when this is not the case. Also note that equations with a single reactant name is possible, as in the Quartz reaction above. This exists to permit reaction rates to be defined for a single species instead of a normal stoichiometrically balanced reaction.

◆ setRateModel()

auto setRateModel ( ReactionRateModelGenerator const &  model_generator) -> GeneralReaction &

Set the reaction rate model generator of the reaction.

Use this method to set a ReactionRateModelGenerator in case you need the ReactionRateModel of the reaction to be constructed later, when the chemical system is assembled.


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