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

## Detailed Description

A type that contains the values of a scalar field and its derivatives.

#include <EquilibriumCompositionProblem.hpp>

## Public Member Functions

EquilibriumCompositionProblem ()
Construct a default EquilibriumCompositionProblem instance.

EquilibriumCompositionProblem (const ChemicalSystem &system)
Construct a custom EquilibriumCompositionProblem instance.

EquilibriumCompositionProblem (const EquilibriumCompositionProblem &other)
Construct a copy of a EquilibriumCompositionProblem instance.

virtual ~EquilibriumCompositionProblem ()
Destroy this instance.

auto operator= (EquilibriumCompositionProblem other) -> EquilibriumCompositionProblem &
Construct a copy of a EquilibriumCompositionProblem instance.

auto system () const -> const ChemicalSystem &
Return the chemical system.

auto partition () const -> const Partition &
Return the partition of the chemical system.

auto setPartition (const Partition &partition) -> void
Set the partition of the chemical system.

auto setTemperature (double value, std::string units) -> void
Set the temperature for the equilibrium calculation. More...

auto setPressure (double value, std::string units) -> void
Set the pressure for the equilibrium calculation. More...

auto setAqueousComposition (std::string molalities) -> void
Set the composition of the aqueous phase using molalities of compounds. More...

auto setGaseousComposition (std::string molarfractions) -> void
Set the composition of the gaseous phase using molar fractions of compounds. More...

auto setSolidComposition (std::string volumefractions) -> void
Set the volume fractions of the solid phases. More...

auto setAqueousSaturation (double value) -> void
Set the saturation of the aqueous fluid. More...

auto setGaseousSaturation (double value) -> void
Set the saturation of the gaseous fluid. More...

auto setPorosity (double value) -> void
Set the porosity of the solid matrix. More...

operator EquilibriumInverseProblem ()
Convert this EquilibriumCompositionProblem instance into an EquilibriumProblem instance. More...

## Member Function Documentation

 auto Reaktoro::EquilibriumCompositionProblem::setTemperature ( double value, std::string units ) -> void

Set the temperature for the equilibrium calculation.

Parameters
 value The temperature value. units The temperature units.
 auto Reaktoro::EquilibriumCompositionProblem::setPressure ( double value, std::string units ) -> void

Set the pressure for the equilibrium calculation.

Parameters
 value The pressure value. units The pressure units.
 auto Reaktoro::EquilibriumCompositionProblem::setAqueousComposition ( std::string molalities ) -> void

Set the composition of the aqueous phase using molalities of compounds.

The compounds and their molalities are separated by semicollon. The following describes how to set the composition of an aqueous phase with 1 molal of NaCl and 1 mmolal MgCl2:

composition.aqueous("1 molal NaCl; 1 mmolal MgCl2");
 auto Reaktoro::EquilibriumCompositionProblem::setGaseousComposition ( std::string molarfractions ) -> void

Set the composition of the gaseous phase using molar fractions of compounds.

The compounds and their molar fractions are separated by semicollon. The following describes how to set the composition of a gas phase with 70% N2, 20% O2, and 10% CO2 (molar percentage):

composition.gaseous("0.70 N2; 0.20 O2; 0.10 CO2");
 auto Reaktoro::EquilibriumCompositionProblem::setSolidComposition ( std::string volumefractions ) -> void

Set the volume fractions of the solid phases.

The composition of the solid part of the system is defined using volume fractions of each solid phase. The volume fraction of a solid phase is defined as the volume of that phase divided by total solid volume. The following describes how to set the volume fractions of solid phases Calcite and Quartz.

composition.solid("0.10 Calcite; 0.90 Quartz");
 auto Reaktoro::EquilibriumCompositionProblem::setAqueousSaturation ( double value ) -> void

Set the saturation of the aqueous fluid.

The saturation of the aqueous fluid is defined as the ratio of its volume and the total fluid volume.

 auto Reaktoro::EquilibriumCompositionProblem::setGaseousSaturation ( double value ) -> void

Set the saturation of the gaseous fluid.

The saturation of the gaseous fluid is defined as the ratio of its volume and the total fluid volume.

 auto Reaktoro::EquilibriumCompositionProblem::setPorosity ( double value ) -> void

Set the porosity of the solid matrix.

The porosity is defined as the total fluid volume divided by total volume.

 Reaktoro::EquilibriumCompositionProblem::operator EquilibriumInverseProblem ( )

Convert this EquilibriumCompositionProblem instance into an EquilibriumProblem instance.

This conversion is needed to calculate the equilibrium state of both fluid and solid phases using their given compositions and volume conditions. Note that the calculated equilibrium state will satisfy the given fluid phase saturations and solid matrix porosity. The internal equilibrium composition of each phase might differ from those provided. For example, assume the aqueous and gaseous phases are set as:

composition.setAqueousFluid("1 molal NaCl");
composition.setGaseousFluid("0.95 CO2; 0.05 O2");
ChemicalState state = equilibrate(composition);

When both phases are equilibrated, enouth amount of gas with prescribed composition will be added in the system to satisfy the saturation of the gaseous phase. As a result, the aqueous phase will become saturated with both CO2 and O2. Thus, its final composition will contain a saturated molality of CO2 and O2 in addition to NaCl.

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