Reaktoro 
A unified framework for modeling chemically reactive systems
Reaktoro::Reaction Class Reference

Detailed Description

Provide a computational representation of a chemical reaction.

The Reaction class provides a representation of a chemical reaction and operations such as the calculation of equilibrium constants at given temperature and pressure points, reaction quotients, and reaction rates.

See also
ReactionRate, EquilibriumConstant

#include <Reaction.hpp>

Public Member Functions

 Reaction ()
 Construct a default Reaction instance.
 
 Reaction (const ReactionEquation &equation, const ChemicalSystem &system)
 Construct a Reaction instance from a ReactionEquation instance.
 
 Reaction (const Reaction &other)
 Construct a copy of a Reaction instance.
 
virtual ~Reaction ()
 Destroy this instance.
 
auto operator= (Reaction other) -> Reaction &
 Assign a Reaction instance to this instance.
 
auto setName (std::string name) -> void
 Set the name of the reaction.
 
auto setEquilibriumConstant (const ThermoScalarFunction &lnk) -> void
 Set the equilibrium constant function of the reaction (in natural log scale).
 
auto setRate (const ReactionRateFunction &function) -> void
 Set the rate function of the reaction (in units of mol/s).
 
auto name () const -> std::string
 Return the name of the reaction.
 
auto equilibriumConstant () const -> const ThermoScalarFunction &
 Return the equilibrium constant function of the reaction.
 
auto rate () const -> const ReactionRateFunction &
 Return the rate function of the reaction.
 
auto equation () const -> const ReactionEquation &
 Return the equation of the reaction.
 
auto system () const -> const ChemicalSystem &
 Return the chemical system instance of the reaction.
 
auto species () const -> const std::vector< Species > &
 Return the reacting species of the reaction.
 
auto indices () const -> const Indices &
 Return the indices of the reacting species of the reaction.
 
auto stoichiometries () const -> const Vector &
 Return the stoichiometries of the reacting species of the reaction.
 
auto stoichiometry (std::string species) const -> double
 Return the stoichiometry of a species in the reaction equation. More...
 
auto lnEquilibriumConstant (const ChemicalProperties &properties) const -> ThermoScalar
 Calculate the equilibrium constant of the reaction (in natural log). More...
 
auto lnReactionQuotient (const ChemicalProperties &properties) const -> ChemicalScalar
 Calculate the reaction quotient of the reaction (in natural log scale). More...
 
auto lnEquilibriumIndex (const ChemicalProperties &properties) const -> ChemicalScalar
 Calculate the equilibrium index of the reaction as \(\ln(Q/K)\).
 
auto rate (const ChemicalProperties &properties) const -> ChemicalScalar
 Calculate the rate of the reaction (in units of mol/s). More...
 

Member Function Documentation

auto Reaktoro::Reaction::stoichiometry ( std::string  species) const -> double

Return the stoichiometry of a species in the reaction equation.

Parameters
speciesThe name of the species.
auto Reaktoro::Reaction::lnEquilibriumConstant ( const ChemicalProperties properties) const -> ThermoScalar

Calculate the equilibrium constant of the reaction (in natural log).

Parameters
propertiesThe chemical properties of the system
auto Reaktoro::Reaction::lnReactionQuotient ( const ChemicalProperties properties) const -> ChemicalScalar

Calculate the reaction quotient of the reaction (in natural log scale).

The reaction quotient of a reaction is defined as:

\[\ln Q=\sum_{i=1}^{N}\nu_{i}\ln a_{i},\]

where \(N\) denotes the number of species in the multiphase system, \(a_{i}\) the activity of the \(i\)-th species, and \(\nu_{i}\) the stoichiometry of the \(i\)-th species in the reaction:

\[0\rightleftharpoons\sum_{i=1}^{N}\nu_{i}\alpha_{i},\]

with \(\alpha_{i}\) denoting the \(i\)-th species. The sign convention for the stoichiometric coefficients is: positive for products, negative for reactants.

Parameters
propertiesThe chemical properties of the system
auto Reaktoro::Reaction::rate ( const ChemicalProperties properties) const -> ChemicalScalar

Calculate the rate of the reaction (in units of mol/s).

Parameters
propertiesThe thermodynamic properties of the chemical system at (T, P, n)

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