Reaktoro  v2.0.0
A unified framework for modeling chemically reactive systems
ChemicalProps Class Reference

The class that computes chemical properties of a chemical system. More...

#include <ChemicalProps.hpp>

Public Member Functions

 ChemicalProps (const ChemicalSystem &system)
 Construct an uninitialized ChemicalProps object with given chemical system.
 
 ChemicalProps (const ChemicalState &state)
 Construct a ChemicalProps object with given chemical state of the system.
 
auto update (const ChemicalState &state) -> void
 Update the chemical properties of the system. More...
 
auto update (const real &T, const real &P, ArrayXrConstRef n) -> void
 Update the chemical properties of the system. More...
 
auto update (ArrayXrConstRef u) -> void
 Update the chemical properties of the system with serialized data. More...
 
auto update (ArrayXdConstRef u) -> void
 Update the chemical properties of the system with serialized data. More...
 
auto updateIdeal (const ChemicalState &state) -> void
 Update the chemical properties of the system using ideal activity models. More...
 
auto updateIdeal (const real &T, const real &P, ArrayXrConstRef n) -> void
 Update the chemical properties of the system using ideal activity models. More...
 
auto serialize (ArrayStream< real > &stream) const -> void
 Serialize the chemical properties into the array stream stream. More...
 
auto serialize (ArrayStream< double > &stream) const -> void
 Serialize the chemical properties into the array stream stream. More...
 
auto deserialize (const ArrayStream< real > &stream) -> void
 Update the chemical properties of the system using the array stream stream. More...
 
auto deserialize (const ArrayStream< double > &stream) -> void
 Update the chemical properties of the system using the array stream stream. More...
 
auto system () const -> const ChemicalSystem &
 Return the chemical system associated with these chemical properties.
 
auto phaseProps (StringOrIndex phase) -> ChemicalPropsPhaseRef
 Return the chemical properties of a phase with given index. More...
 
auto phaseProps (StringOrIndex phase) const -> ChemicalPropsPhaseConstRef
 Return the chemical properties of a phase with given index. More...
 
auto extra () const -> const Map< String, Any > &
 Return the extra data produced during the evaluation of activity models.
 
auto temperature () const -> real
 Return the temperature of the system (in K).
 
auto pressure () const -> real
 Return the pressure of the system (in Pa).
 
auto charge () const -> real
 Return the amount of electric charge in the system (in mol).
 
auto elementAmount (StringOrIndex element) const -> real
 Return the amount of an element in the system (in mol). More...
 
auto elementAmountInPhase (StringOrIndex element, StringOrIndex phase) const -> real
 Return the amount of an element in the system (in mol). More...
 
auto elementAmountAmongSpecies (StringOrIndex element, ArrayXlConstRef indices) const -> real
 Return the amount of an element among a group of species in the system (in mol). More...
 
auto elementMass (StringOrIndex element) const -> real
 Return the mass of an element in the system (in kg). More...
 
auto elementMassInPhase (StringOrIndex element, StringOrIndex phase) const -> real
 Return the mass of an element in the system (in kg). More...
 
auto elementMassAmongSpecies (StringOrIndex element, ArrayXlConstRef indices) const -> real
 Return the mass of an element among a group of species in the system (in kg). More...
 
auto elementAmounts () const -> ArrayXr
 Return the amounts of the elements in the system (in mol).
 
auto elementAmountsInPhase (StringOrIndex phase) const -> ArrayXr
 Return the amounts of the elements in a phase of the system (in mol). More...
 
auto elementAmountsAmongSpecies (ArrayXlConstRef indices) const -> ArrayXr
 Return the amounts of the elements among a group of species in the system (in mol). More...
 
auto speciesAmount (StringOrIndex species) const -> real
 Return the amount of a species in the system (in mol). More...
 
auto speciesMass (StringOrIndex species) const -> real
 Return the mass of a species in the system. More...
 
auto speciesMoleFraction (StringOrIndex species) const -> real
 Return the mole fraction of a species in the system. More...
 
auto speciesConcentration (StringOrIndex species) const -> real
 Return the concentration (activity divided by activity coefficient) of a species in the system. More...
 
auto speciesConcentrationLg (StringOrIndex species) const -> real
 Return the lg concentration (activity divided by activity coefficient) of a species in the system. More...
 
auto speciesConcentrationLn (StringOrIndex species) const -> real
 Return the ln concentration (activity divided by activity coefficient) of a species in the system. More...
 
auto speciesActivityCoefficient (StringOrIndex species) const -> real
 Return the activity coefficient of a species in the system. More...
 
auto speciesActivityCoefficientLg (StringOrIndex species) const -> real
 Return the lg activity coefficient of a species in the system. More...
 
auto speciesActivityCoefficientLn (StringOrIndex species) const -> real
 Return the ln activity coefficient of a species in the system. More...
 
auto speciesActivity (StringOrIndex species) const -> real
 Return the activity of a species in the system. More...
 
auto speciesActivityLg (StringOrIndex species) const -> real
 Return the lg activity of a species in the system. More...
 
auto speciesActivityLn (StringOrIndex species) const -> real
 Return the ln activity of a species in the system. More...
 
auto speciesChemicalPotential (StringOrIndex species) const -> real
 Return the chemical potential of a species in the system. More...
 
auto speciesStandardVolume (StringOrIndex species) const -> real
 Return the standard partial molar volume of a species in the system (in m³/mol). More...
 
auto speciesStandardVolumeT (StringOrIndex species) const -> real
 Return the temperature derivative of the standard partial molar volume of a species in the system (in m³/(mol·K)). More...
 
auto speciesStandardVolumeP (StringOrIndex species) const -> real
 Return the pressure derivative of the standard partial molar volume of a species in the system (in m³/(mol·Pa)). More...
 
auto speciesStandardGibbsEnergy (StringOrIndex species) const -> real
 Return the standard partial molar Gibbs energy of formation of a species in the system (in J/mol). More...
 
auto speciesStandardEnthalpy (StringOrIndex species) const -> real
 Return the standard partial molar enthalpy of formation of a species in the system (in J/mol). More...
 
auto speciesStandardEntropy (StringOrIndex species) const -> real
 Return the standard partial molar entropy of formation of the species a the system (in J/(mol·K)). More...
 
auto speciesStandardInternalEnergy (StringOrIndex species) const -> real
 Return the standard partial molar internal energy of formation of a species in the system (in J/mol). More...
 
auto speciesStandardHelmholtzEnergy (StringOrIndex species) const -> real
 Return the standard partial molar Helmholtz energy of formation of a species in the system (in J/mol). More...
 
auto speciesStandardHeatCapacityConstP (StringOrIndex species) const -> real
 Return the standard partial molar isobaric heat capacity of the species a the system (in J/(mol·K)). More...
 
auto speciesStandardHeatCapacityConstV (StringOrIndex species) const -> real
 Return the standard partial molar isochoric heat capacity of the species a the system (in J/(mol·K)). More...
 
auto speciesAmounts () const -> ArrayXrConstRef
 Return the amounts of the species in the system (in mol).
 
auto speciesMasses () const -> ArrayXr
 Return the masses of the species in the system (in kg).
 
auto speciesMoleFractions () const -> ArrayXrConstRef
 Return the mole fractions of the species in the system.
 
auto speciesConcentrationsLn () const -> ArrayXr
 Return the ln concentrations (activity divided by activity coefficient) of the species in the system.
 
auto speciesActivityCoefficientsLn () const -> ArrayXrConstRef
 Return the ln activity coefficients of the species in the system.
 
auto speciesActivitiesLn () const -> ArrayXrConstRef
 Return the ln activities of the species in the system.
 
auto speciesChemicalPotentials () const -> ArrayXrConstRef
 Return the chemical potentials of the species in the system (in J/mol).
 
auto speciesStandardVolumes () const -> ArrayXrConstRef
 Return the standard partial molar volumes of the species in the system (in m³/mol).
 
auto speciesStandardVolumesT () const -> ArrayXrConstRef
 Return the temperature derivative of the standard molar volumes of the species in the system (in m³/(mol·K)).
 
auto speciesStandardVolumesP () const -> ArrayXrConstRef
 Return the pressure derivative of the standard molar volumes of the species in the system (in m³/(mol·Pa)).
 
auto speciesStandardGibbsEnergies () const -> ArrayXrConstRef
 Return the standard partial molar Gibbs energies of formation of the species in the system (in J/mol).
 
auto speciesStandardEnthalpies () const -> ArrayXrConstRef
 Return the standard partial molar enthalpies of formation of the species in the system (in J/mol).
 
auto speciesStandardEntropies () const -> ArrayXr
 Return the standard partial molar entropies of formation of the species in the system (in J/(mol·K)).
 
auto speciesStandardInternalEnergies () const -> ArrayXr
 Return the standard partial molar internal energies of formation of the species in the system (in J/mol).
 
auto speciesStandardHelmholtzEnergies () const -> ArrayXr
 Return the standard partial molar Helmholtz energies of formation of the species in the system (in J/mol).
 
auto speciesStandardHeatCapacitiesConstP () const -> ArrayXrConstRef
 Return the standard partial molar isobaric heat capacities of the species in the system (in J/(mol·K)).
 
auto speciesStandardHeatCapacitiesConstV () const -> ArrayXr
 Return the standard partial molar isochoric heat capacities of the species in the system (in J/(mol·K)).
 
auto molarVolume () const -> real
 Return the molar volume of the system (in m³/mol).
 
auto molarVolumeT () const -> real
 Return the temperature derivative of the molar volume of the system (in m³/(mol·K)).
 
auto molarVolumeP () const -> real
 Return the pressure derivative of the molar volume of the system (in m³/(mol·Pa)).
 
auto molarGibbsEnergy () const -> real
 Return the molar Gibbs energy of formation of the system (in J/mol).
 
auto molarEnthalpy () const -> real
 Return the molar enthalpy of formation of the system (in J/mol).
 
auto molarEntropy () const -> real
 Return the molar entropy of formation of the system (in J/(mol·K)).
 
auto molarInternalEnergy () const -> real
 Return the molar internal energy of formation of the system (in J/mol).
 
auto molarHelmholtzEnergy () const -> real
 Return the molar Helmholtz energy of formation of the system (in J/mol).
 
auto molarHeatCapacityConstP () const -> real
 Return the molar isobaric heat capacity of the system (in J/(mol·K)).
 
auto molarHeatCapacityConstV () const -> real
 Return the molar isochoric heat capacity of the system (in J/(mol·K)).
 
auto specificVolume () const -> real
 Return the specific volume of the system (in m³/kg).
 
auto specificVolumeT () const -> real
 Return the temperature derivative of the specific volume of the system (in m³/(kg·K)).
 
auto specificVolumeP () const -> real
 Return the pressure derivative of the specific volume of the system (in m³/(kg·Pa)).
 
auto specificGibbsEnergy () const -> real
 Return the specific Gibbs energy of formation of the system (in J/kg).
 
auto specificEnthalpy () const -> real
 Return the specific enthalpy of formation of the system (in J/kg).
 
auto specificEntropy () const -> real
 Return the specific entropy of formation of the system (in J/(kg·K)).
 
auto specificInternalEnergy () const -> real
 Return the specific internal energy of formation of the system (in J/kg).
 
auto specificHelmholtzEnergy () const -> real
 Return the specific Helmholtz energy of formation of the system (in J/kg).
 
auto specificHeatCapacityConstP () const -> real
 Return the specific isobaric heat capacity of the system (in J/(kg·K)).
 
auto specificHeatCapacityConstV () const -> real
 Return the specific isochoric heat capacity of the system (in J/(kg·K)).
 
auto density () const -> real
 Return the density of the system (in kg/m³).
 
auto amount () const -> real
 Return the sum of species amounts in the system (in mol).
 
auto mass () const -> real
 Return the sum of species masses in the system (in kg).
 
auto volume () const -> real
 Return the volume of the system (in m³).
 
auto volumeT () const -> real
 Return the temperature derivative of the volume of the system (in m³/K).
 
auto volumeP () const -> real
 Return the pressure derivative of the volume of the system (in m³/Pa).
 
auto gibbsEnergy () const -> real
 Return the Gibbs energy of formation of the system (in J).
 
auto enthalpy () const -> real
 Return the enthalpy of formation of the system (in J).
 
auto entropy () const -> real
 Return the entropy of formation of the system (in J/K).
 
auto internalEnergy () const -> real
 Return the internal energy of formation of the system (in J).
 
auto helmholtzEnergy () const -> real
 Return the Helmholtz energy of formation of the system (in J).
 
auto heatCapacityConstP () const -> real
 Return the isobaric heat capacity of the system (in J/K).
 
auto heatCapacityConstV () const -> real
 Return the isochoric heat capacity of the system (in J/K).
 
auto indicesPhasesWithState (StateOfMatter som) const -> Indices
 Return the indices of the phases in a given state of matter.
 
auto indicesPhasesWithStates (std::initializer_list< StateOfMatter > soms) const -> Indices
 Return the indices of the phases with one of the given states of matter.
 
auto indicesPhasesWithFluidState () const -> Indices
 Return the indices of the phases in liquid, gaseous, or supercritical states.
 
auto indicesPhasesWithSolidState () const -> Indices
 Return the indices of the phases in solid states.
 
auto indicesSpeciesInPhasesWithState (StateOfMatter som) const -> Indices
 Return the indices of the phases with a given state of matter.
 
auto indicesSpeciesInPhasesWithStates (std::initializer_list< StateOfMatter > soms) const -> Indices
 Return the indices of the phases with one of the given states of matter.
 
auto indicesSpeciesInPhasesWithFluidState () const -> Indices
 Return the indices of the phases with liquid, gaseous, or supercritical states.
 
auto indicesSpeciesInPhasesWithSolidState () const -> Indices
 Return the indices of the phases with solid states.
 
auto output (std::ostream &out) const -> void
 Output the chemical properties of the system to a stream.
 
auto output (const String &filename) const -> void
 Output the chemical properties of the system to a file.
 
 operator VectorXr () const
 Return the chemical properties in this object serialized in an array of real numbers.
 
 operator VectorXd () const
 Return the chemical properties in this object serialized in an array of double numbers.
 

Detailed Description

The class that computes chemical properties of a chemical system.

Member Function Documentation

◆ update() [1/4]

auto update ( const ChemicalState state) -> void

Update the chemical properties of the system.

Parameters
stateThe chemical state of the system

◆ update() [2/4]

auto update ( const real T,
const real P,
ArrayXrConstRef  n 
) -> void

Update the chemical properties of the system.

Parameters
TThe temperature condition (in K)
PThe pressure condition (in Pa)
nThe amounts of the species in the system (in mol)

◆ update() [3/4]

auto update ( ArrayXrConstRef  u) -> void

Update the chemical properties of the system with serialized data.

Parameters
uThe chemical properties of the system serialized in an array of real numbers.

◆ update() [4/4]

auto update ( ArrayXdConstRef  u) -> void

Update the chemical properties of the system with serialized data.

Parameters
uThe chemical properties of the system serialized in an array of double numbers.

◆ updateIdeal() [1/2]

auto updateIdeal ( const ChemicalState state) -> void

Update the chemical properties of the system using ideal activity models.

Parameters
stateThe chemical state of the system

◆ updateIdeal() [2/2]

auto updateIdeal ( const real T,
const real P,
ArrayXrConstRef  n 
) -> void

Update the chemical properties of the system using ideal activity models.

Parameters
TThe temperature condition (in K)
PThe pressure condition (in Pa)
nThe amounts of the species in the system (in mol)

◆ serialize() [1/2]

auto serialize ( ArrayStream< real > &  stream) const -> void

Serialize the chemical properties into the array stream stream.

Parameters
streamThe array stream used to serialize the chemical properties.

◆ serialize() [2/2]

auto serialize ( ArrayStream< double > &  stream) const -> void

Serialize the chemical properties into the array stream stream.

Parameters
streamThe array stream used to serialize the chemical properties.

◆ deserialize() [1/2]

auto deserialize ( const ArrayStream< real > &  stream) -> void

Update the chemical properties of the system using the array stream stream.

Parameters
streamThe array stream containing the serialized chemical properties.

◆ deserialize() [2/2]

auto deserialize ( const ArrayStream< double > &  stream) -> void

Update the chemical properties of the system using the array stream stream.

Parameters
streamThe array stream containing the serialized chemical properties.

◆ phaseProps() [1/2]

auto phaseProps ( StringOrIndex  phase) -> ChemicalPropsPhaseRef

Return the chemical properties of a phase with given index.

Parameters
phaseThe name or index of the phase in the system.

◆ phaseProps() [2/2]

auto phaseProps ( StringOrIndex  phase) const -> ChemicalPropsPhaseConstRef

Return the chemical properties of a phase with given index.

Parameters
phaseThe name or index of the phase in the system.

◆ elementAmount()

auto elementAmount ( StringOrIndex  element) const -> real

Return the amount of an element in the system (in mol).

Parameters
elementThe symbol or index of the element in the system.

◆ elementAmountInPhase()

auto elementAmountInPhase ( StringOrIndex  element,
StringOrIndex  phase 
) const -> real

Return the amount of an element in the system (in mol).

Parameters
elementThe symbol or index of the element in the system.
phaseThe name or index of the phase in the system.

◆ elementAmountAmongSpecies()

auto elementAmountAmongSpecies ( StringOrIndex  element,
ArrayXlConstRef  indices 
) const -> real

Return the amount of an element among a group of species in the system (in mol).

Parameters
elementThe symbol or index of the element in the system.
indicesThe indices of the species in the system.

◆ elementMass()

auto elementMass ( StringOrIndex  element) const -> real

Return the mass of an element in the system (in kg).

Parameters
elementThe symbol or index of the element in the system.

◆ elementMassInPhase()

auto elementMassInPhase ( StringOrIndex  element,
StringOrIndex  phase 
) const -> real

Return the mass of an element in the system (in kg).

Parameters
elementThe symbol or index of the element in the system.
phaseThe name or index of the phase in the system.

◆ elementMassAmongSpecies()

auto elementMassAmongSpecies ( StringOrIndex  element,
ArrayXlConstRef  indices 
) const -> real

Return the mass of an element among a group of species in the system (in kg).

Parameters
elementThe symbol or index of the element in the system.
indicesThe indices of the species in the system.

◆ elementAmountsInPhase()

auto elementAmountsInPhase ( StringOrIndex  phase) const -> ArrayXr

Return the amounts of the elements in a phase of the system (in mol).

Parameters
phaseThe name or index of the phase in the system.

◆ elementAmountsAmongSpecies()

auto elementAmountsAmongSpecies ( ArrayXlConstRef  indices) const -> ArrayXr

Return the amounts of the elements among a group of species in the system (in mol).

Parameters
indicesThe indices of the species in the system.

◆ speciesAmount()

auto speciesAmount ( StringOrIndex  species) const -> real

Return the amount of a species in the system (in mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesMass()

auto speciesMass ( StringOrIndex  species) const -> real

Return the mass of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesMoleFraction()

auto speciesMoleFraction ( StringOrIndex  species) const -> real

Return the mole fraction of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesConcentration()

auto speciesConcentration ( StringOrIndex  species) const -> real

Return the concentration (activity divided by activity coefficient) of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesConcentrationLg()

auto speciesConcentrationLg ( StringOrIndex  species) const -> real

Return the lg concentration (activity divided by activity coefficient) of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesConcentrationLn()

auto speciesConcentrationLn ( StringOrIndex  species) const -> real

Return the ln concentration (activity divided by activity coefficient) of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivityCoefficient()

auto speciesActivityCoefficient ( StringOrIndex  species) const -> real

Return the activity coefficient of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivityCoefficientLg()

auto speciesActivityCoefficientLg ( StringOrIndex  species) const -> real

Return the lg activity coefficient of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivityCoefficientLn()

auto speciesActivityCoefficientLn ( StringOrIndex  species) const -> real

Return the ln activity coefficient of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivity()

auto speciesActivity ( StringOrIndex  species) const -> real

Return the activity of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivityLg()

auto speciesActivityLg ( StringOrIndex  species) const -> real

Return the lg activity of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesActivityLn()

auto speciesActivityLn ( StringOrIndex  species) const -> real

Return the ln activity of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesChemicalPotential()

auto speciesChemicalPotential ( StringOrIndex  species) const -> real

Return the chemical potential of a species in the system.

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardVolume()

auto speciesStandardVolume ( StringOrIndex  species) const -> real

Return the standard partial molar volume of a species in the system (in m³/mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardVolumeT()

auto speciesStandardVolumeT ( StringOrIndex  species) const -> real

Return the temperature derivative of the standard partial molar volume of a species in the system (in m³/(mol·K)).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardVolumeP()

auto speciesStandardVolumeP ( StringOrIndex  species) const -> real

Return the pressure derivative of the standard partial molar volume of a species in the system (in m³/(mol·Pa)).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardGibbsEnergy()

auto speciesStandardGibbsEnergy ( StringOrIndex  species) const -> real

Return the standard partial molar Gibbs energy of formation of a species in the system (in J/mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardEnthalpy()

auto speciesStandardEnthalpy ( StringOrIndex  species) const -> real

Return the standard partial molar enthalpy of formation of a species in the system (in J/mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardEntropy()

auto speciesStandardEntropy ( StringOrIndex  species) const -> real

Return the standard partial molar entropy of formation of the species a the system (in J/(mol·K)).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardInternalEnergy()

auto speciesStandardInternalEnergy ( StringOrIndex  species) const -> real

Return the standard partial molar internal energy of formation of a species in the system (in J/mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardHelmholtzEnergy()

auto speciesStandardHelmholtzEnergy ( StringOrIndex  species) const -> real

Return the standard partial molar Helmholtz energy of formation of a species in the system (in J/mol).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardHeatCapacityConstP()

auto speciesStandardHeatCapacityConstP ( StringOrIndex  species) const -> real

Return the standard partial molar isobaric heat capacity of the species a the system (in J/(mol·K)).

Parameters
speciesThe name or index of the species in the system.

◆ speciesStandardHeatCapacityConstV()

auto speciesStandardHeatCapacityConstV ( StringOrIndex  species) const -> real

Return the standard partial molar isochoric heat capacity of the species a the system (in J/(mol·K)).

Parameters
speciesThe name or index of the species in the system.

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