Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
FormationReaction Class Reference

A class to represent a formation reaction of a chemical species. More...

#include <FormationReaction.hpp>

Public Member Functions

 FormationReaction ()
 Construct a default FormationReaction object.
 
auto clone () const -> FormationReaction
 Return a deep copy of this FormationReaction object.
 
auto withReactants (Pairs< Species, double > const &reactants) const -> FormationReaction
 Return a duplicate of this FormationReaction object with new reactant species in the formation reaction.
 
auto withEquilibriumConstant (real const &lgK0) const -> FormationReaction
 Return a duplicate of this FormationReaction object with new reaction thermodynamic model function. More...
 
auto withProductStandardVolume (real const &V0p) const -> FormationReaction
 Return a duplicate of this FormationReaction object with new standard molar volume function for the product species. More...
 
auto withProductStandardVolumeModel (Model< real(real, real)> fn) const -> FormationReaction
 Return a duplicate of this FormationReaction object with new standard molar volume function for the product species. More...
 
auto withReactionStandardThermoModel (const ReactionStandardThermoModel &fn) const -> FormationReaction
 Return a duplicate of this FormationReaction object with a new reaction standard thermodynamic model function.
 
auto initialized () const -> bool
 Return true if this FormationReaction object has been initialized with reactants and a reaction thermodynamic model.
 
auto reactants () const -> const Pairs< Species, double > &
 Return the reactant species in the formation reaction.
 
auto stoichiometry (String reactant) const -> double
 Return the stoichiometric coefficient of a reactant with given name in the formation reaction.
 
auto productStandardVolumeModel () const -> const Model< real(real, real)> &
 Return the standard molar volume function of the product species.
 
auto reactionThermoModel () const -> const ReactionStandardThermoModel &
 Return the reaction thermodynamic model function of the formation reaction.
 
auto createStandardThermoModel () const -> StandardThermoModel
 Construct the standard thermodynamic model function of the product species. More...
 

Detailed Description

A class to represent a formation reaction of a chemical species.

Member Function Documentation

◆ withEquilibriumConstant()

auto withEquilibriumConstant ( real const &  lgK0) const -> FormationReaction

Return a duplicate of this FormationReaction object with new reaction thermodynamic model function.

This method sets a constant equilibrium constant for the formation reaction. It also sets the standard molar enthalpy and volume of the reaction to zero.

For a more advanced thermodynamic model setup, use methods withProductStandardVolumeModel and withReactionStandardThermoModel.

Parameters
lgK0The equilibrium constant of the reaction (in log base 10)

◆ withProductStandardVolume()

auto withProductStandardVolume ( real const &  V0p) const -> FormationReaction

Return a duplicate of this FormationReaction object with new standard molar volume function for the product species.

The standard molar volume of the product species is needed to enable the calculation of the standard molar volume of the reaction.

Warning
Ensure the standard molar volume of the product species is set using either withProductStandardVolume or withProductStandardVolumeModel. Calling withEquilibriumConstant also sets the standard molar volume of the product species, but to zero.
Parameters
V0pThe constant standard molar volume of the product species (in m3/mol).

◆ withProductStandardVolumeModel()

auto withProductStandardVolumeModel ( Model< real(real, real)>  fn) const -> FormationReaction

Return a duplicate of this FormationReaction object with new standard molar volume function for the product species.

The standard molar volume of the product species is needed to enable the calculation of the standard molar volume of the reaction.

Warning
Ensure the standard molar volume of the product species is set using either withProductStandardVolume or withProductStandardVolumeModel. Calling withEquilibriumConstant also sets the standard molar volume of the product species, but to zero.
Parameters
fnThe standard molar volume model of the product species (in m3/mol).

◆ createStandardThermoModel()

auto createStandardThermoModel ( ) const -> StandardThermoModel

Construct the standard thermodynamic model function of the product species.

This method constructs a standard thermodynamic model function for the product species using the assigned thermodynamic model of the formation reaction. An empty model is returned if no reaction thermodynamic model has been previously assigned.

Warning
This method will throw a runtime error if methods withProductStandardVolumeModel and withReactionStandardThermoModel have not been invoked.

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