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

Detailed Description

A wrapper class for Gems code.

#include <Gems.hpp>

Inheritance diagram for Reaktoro::Gems:
Collaboration diagram for Reaktoro::Gems:

Public Member Functions

 Gems ()
 Construct a default Gems instance.
 
 Gems (std::string filename)
 Construct a Gems instance from a specification file. More...
 
virtual ~Gems ()
 Destroy this Gems instance.
 
virtual auto temperature () const -> double
 Return the temperature (in units of K)
 
virtual auto pressure () const -> double
 Return the pressure (in units of Pa)
 
virtual auto speciesAmounts () const -> Vector
 Return the amounts of the species (in units of mol)
 
virtual auto numElements () const -> unsigned
 Return the number of elements.
 
virtual auto numSpecies () const -> unsigned
 Return the number of species.
 
virtual auto numPhases () const -> unsigned
 Return the number of phases.
 
virtual auto numSpeciesInPhase (Index iphase) const -> unsigned
 Return the number of species in a phase.
 
virtual auto elementName (Index ielement) const -> std::string
 Return the name of an element.
 
virtual auto elementMolarMass (Index ielement) const -> double
 Return the molar mass of an element (in units of kg/mol)
 
virtual auto elementStoichiometry (Index ispecies, Index ielement) const -> double
 Return the stoichiometry of an element in a species.
 
virtual auto speciesName (Index ispecies) const -> std::string
 Return the name of a species.
 
virtual auto phaseName (Index iphase) const -> std::string
 Return the name of a phase.
 
virtual auto properties (Index iphase, double T, double P) -> PhaseThermoModelResult
 Return the thermodynamic properties of a phase. More...
 
virtual auto properties (Index iphase, double T, double P, const Vector &nphase) -> PhaseChemicalModelResult
 Return the chemical properties of a phase. More...
 
virtual auto clone () const -> std::shared_ptr< Interface >
 Return a clone of this Gems instance.
 
auto set (double T, double P) -> void
 Set the temperature and pressure of the Gems instance. More...
 
auto set (double T, double P, const Vector &n) -> void
 Set the temperature, pressure and molar composition of the Gems instance. More...
 
auto setOptions (const GemsOptions &options) -> void
 Set the options of the Gems instance.
 
auto equilibrate (double T, double P, const Vector &b) -> void
 Calculate the equilibrium state of the system. More...
 
auto converged () const -> bool
 Return the convergence result of the equilibrium calculation.
 
auto numIterations () const -> unsigned
 Return the number of iterations of the equilibrium calculation.
 
auto elapsedTime () const -> double
 Return the wall time of the equilibrium calculation (in units of s)
 
auto node () const -> std::shared_ptr< TNode >
 Return a shared pointer to the TNode instance of Gems.
 
- Public Member Functions inherited from Reaktoro::Interface
virtual ~Interface ()=0
 Virtual destructor.
 
auto formulaMatrix () const -> Matrix
 Return the formula matrix of the species.
 
auto indexElement (std::string element) const -> Index
 Return the index of an element.
 
auto indexSpecies (std::string species) const -> Index
 Return the index of a species.
 
auto indexPhase (std::string phase) const -> Index
 Return the index of a phase.
 
auto indexPhaseWithSpecies (Index ispecies) const -> Index
 Return the index of the phase with a species.
 
auto indexFirstSpeciesInPhase (Index iphase) const -> Index
 Return the index of the first species in a phase.
 
auto system () const -> ChemicalSystem
 Return a ChemicalSystem instance created from an instance of a class derived from Interface.
 
auto state (const ChemicalSystem &system) const -> ChemicalState
 Return a ChemicalState instance created from an instance of a class derived from Interface. More...
 
 operator ChemicalSystem () const
 Convert the classes derived from Interface into a ChemicalSystem instance.
 

Constructor & Destructor Documentation

Reaktoro::Gems::Gems ( std::string  filename)

Construct a Gems instance from a specification file.

Parameters
filenameThe name of the file containing the definition of the chemical system

Member Function Documentation

virtual auto Reaktoro::Gems::properties ( Index  iphase,
double  T,
double  P 
) -> PhaseThermoModelResult
virtual

Return the thermodynamic properties of a phase.

Parameters
iphaseThe index of the phase
TThe temperature (in units of K)
PThe pressure (in units of Pa)

Implements Reaktoro::Interface.

virtual auto Reaktoro::Gems::properties ( Index  iphase,
double  T,
double  P,
const Vector nphase 
) -> PhaseChemicalModelResult
virtual

Return the chemical properties of a phase.

Parameters
iphaseThe index of the phase
TThe temperature (in units of K)
PThe pressure (in units of Pa)
nphaseThe amounts of the species in the phase (in units of mol)

Implements Reaktoro::Interface.

auto Reaktoro::Gems::set ( double  T,
double  P 
) -> void

Set the temperature and pressure of the Gems instance.

Parameters
TThe temperature (in units of K)
PThe pressure (in units of Pa)
auto Reaktoro::Gems::set ( double  T,
double  P,
const Vector n 
) -> void

Set the temperature, pressure and molar composition of the Gems instance.

Parameters
TThe temperature (in units of K)
PThe pressure (in units of Pa)
nThe composition of the species (in units of mol)
auto Reaktoro::Gems::equilibrate ( double  T,
double  P,
const Vector b 
) -> void

Calculate the equilibrium state of the system.

Parameters
TThe temperature for the equilibrium calculation (in units of K)
PThe pressure for the equilibrium calculation (in units of Pa)
nThe amounts of the elements (in units of mol)

The documentation for this class was generated from the following files:
  • Reaktoro/Interfaces/Gems.hpp
  • Reaktoro/Interfaces/Gems.cpp