Reaktoro
A unified framework for modeling chemically reactive systems
AqueousMixture Class Reference

A type used to describe an aqueous mixture. More...

#include <AqueousMixture.hpp>

Inheritance diagram for AqueousMixture:
[legend]
Collaboration diagram for AqueousMixture:
[legend]

Public Member Functions

 AqueousMixture ()
 Construct a default AqueousMixture instance.
 
 AqueousMixture (const std::vector< AqueousSpecies > &species)
 Construct an AqueousMixture instance with given species. More...
 
virtual ~AqueousMixture ()
 Destroy the AqueousMixture instance.
 
auto setWaterDensity (const ThermoScalarFunction &rho) -> void
 Set a customized density function for water.
 
auto setWaterDielectricConstant (const ThermoScalarFunction &epsilon) -> void
 Set a customized dielectric constant function for water.
 
auto setInterpolationPoints (const std::vector< double > &temperatures, const std::vector< double > &pressures) -> void
 Set the temperature and pressure interpolation points for calculation of water density and water dielectric constant. More...
 
auto numNeutralSpecies () const -> unsigned
 Return the number of neutral aqueous species in the aqueous mixture.
 
auto numChargedSpecies () const -> unsigned
 Return the number of charged aqueous species in the aqueous mixture.
 
auto indicesNeutralSpecies () const -> const Indices &
 Return the indices of the neutral aqueous species in the aqueous mixture.
 
auto indicesChargedSpecies () const -> const Indices &
 Return the indices of the charged aqueous species in the aqueous mixture.
 
auto indicesCations () const -> const Indices &
 Return the indices of the cations in the aqueous mixture.
 
auto indicesAnions () const -> const Indices &
 Return the indices of the anions in the aqueous mixture.
 
auto indexWater () const -> Index
 Return the index of the water species \(\ce{H2O(l)}\)..
 
auto indexNeutralSpecies (std::string name) const -> Index
 Return the local index of a neutral species among the neutral species in the aqueous mixture. More...
 
auto indexNeutralSpeciesAny (const std::vector< std::string > &names) const -> Index
 Return the local index of the first neutral species among the neutral species in the aqueous mixture that has any of the given names. More...
 
auto indexChargedSpecies (std::string name) const -> Index
 Return the local index of a charged species among the charged species in the aqueous mixture. More...
 
auto indexChargedSpeciesAny (const std::vector< std::string > &names) const -> Index
 Return the local index of the first charged species among the charged species in the aqueous mixture that has any of the given names. More...
 
auto indexCation (std::string name) const -> Index
 Return the local index of a cation among the cations in the aqueous mixture. More...
 
auto indexAnion (std::string name) const -> Index
 Return the local index of an anion among the anions in the aqueous mixture. More...
 
auto namesNeutralSpecies () const -> std::vector< std::string >
 Return the names of the neutral species in the aqueous mixture.
 
auto namesChargedSpecies () const -> std::vector< std::string >
 Return the names of the charged species in the aqueous mixture.
 
auto namesCations () const -> std::vector< std::string >
 Return the names of the cations in the aqueous mixture.
 
auto namesAnions () const -> std::vector< std::string >
 Return the names of the anions in the aqueous mixture.
 
auto chargesChargedSpecies () const -> Vector
 Return the charges of the charged species in the aqueous mixture.
 
auto chargesCations () const -> Vector
 Return the charges of the cations in the aqueous mixture.
 
auto chargesAnions () const -> Vector
 Return the charges of the anions in the aqueous mixture.
 
auto dissociationMatrix () const -> MatrixConstRef
 Return the dissociation matrix of the aqueous complexes into ions. More...
 
auto molalities (VectorConstRef n) const -> ChemicalVector
 Calculate the molalities of the aqueous species and its molar derivatives. More...
 
auto stoichiometricMolalities (const ChemicalVector &m) const -> ChemicalVector
 Calculate the stoichiometric molalities of the ions and its molar derivatives. More...
 
auto effectiveIonicStrength (const ChemicalVector &m) const -> ChemicalScalar
 Calculate the effective ionic strength of the aqueous mixture and its molar derivatives. More...
 
auto stoichiometricIonicStrength (const ChemicalVector &ms) const -> ChemicalScalar
 Calculate the stoichiometric ionic strength of the aqueous mixture and its molar derivatives. More...
 
auto state (Temperature T, Pressure P, VectorConstRef n) const -> AqueousMixtureState
 Calculate the state of the aqueous mixture. More...
 
- Public Member Functions inherited from GeneralMixture< AqueousSpecies >
 GeneralMixture ()
 Construct a default GeneralMixture instance.
 
 GeneralMixture (const std::vector< AqueousSpecies > &species)
 Construct a GeneralMixture instance with given species. More...
 
virtual ~GeneralMixture ()
 Destroy the instance.
 
auto setName (std::string name) -> void
 Set the name of the mixture.
 
auto numSpecies () const -> unsigned
 Return the number of species in the mixture.
 
auto name () const -> std::string
 Return the name of the mixture.
 
auto species () const -> const std::vector< AqueousSpecies > &
 Return the species that compose the mixture. More...
 
auto species (const Index &index) const -> const AqueousSpecies &
 Return a species in the mixture. More...
 
auto indexSpecies (const std::string &name) const -> Index
 Return the index of a species in the mixture. More...
 
auto indexSpeciesAny (const std::vector< std::string > &names) const -> Index
 Return the index of the first species in the mixture with any of the given names. More...
 
auto namesSpecies () const -> std::vector< std::string >
 Return the names of the species in the mixture.
 
auto chargesSpecies () const -> Vector
 Return the charges of the species in the mixture.
 
auto moleFractions (VectorConstRef n) const -> ChemicalVector
 Calculates the mole fractions of the species and their partial derivatives. More...
 
auto state (Temperature T, Pressure P, VectorConstRef n) const -> MixtureState
 Calculate the state of the mixture. More...
 

Detailed Description

A type used to describe an aqueous mixture.

The AqueousMixture class is defined as a collection of AqueousSpecies objects, representing, therefore, a mixture of aqueous species. Its main purpose is to provide the necessary operations in the calculation of activities of aqueous species. It implements methods for the calculation of mole fractions, molalities, stoichiometric molalities, and effective and stoichiometric ionic strengths. In addition, it provides methods that retrives information about the ionic, neutral and complex species.

See also
AqueousSpecies

Constructor & Destructor Documentation

◆ AqueousMixture()

AqueousMixture ( const std::vector< AqueousSpecies > &  species)
explicit

Construct an AqueousMixture instance with given species.

Parameters
speciesThe species that compose the aqueous mixture

Member Function Documentation

◆ setInterpolationPoints()

auto setInterpolationPoints ( const std::vector< double > &  temperatures,
const std::vector< double > &  pressures 
) -> void

Set the temperature and pressure interpolation points for calculation of water density and water dielectric constant.

Use this method if temperature-pressure interpolation should be used for the calculation of water density and water dielectric constant. This should be done if the cost of the analytical calculation of these properties is prohibitive for your application.

Parameters
temperaturesThe temperature points (in units of K)
pressuresThe pressure points (in units of Pa)

◆ indexNeutralSpecies()

auto indexNeutralSpecies ( std::string  name) const -> Index

Return the local index of a neutral species among the neutral species in the aqueous mixture.

Parameters
nameThe name of the neutral species
Returns
The local index of the neutral species if found. The number of neutral species otherwise.

◆ indexNeutralSpeciesAny()

auto indexNeutralSpeciesAny ( const std::vector< std::string > &  names) const -> Index

Return the local index of the first neutral species among the neutral species in the aqueous mixture that has any of the given names.

Parameters
namesThe alternative names of the neutral species.
Returns
The local index of the neutral species if found. The number of neutral species otherwise.

◆ indexChargedSpecies()

auto indexChargedSpecies ( std::string  name) const -> Index

Return the local index of a charged species among the charged species in the aqueous mixture.

Parameters
nameThe name of the charged species
Returns
The local index of the charged species if found. The number of charged species otherwise.

◆ indexChargedSpeciesAny()

auto indexChargedSpeciesAny ( const std::vector< std::string > &  names) const -> Index

Return the local index of the first charged species among the charged species in the aqueous mixture that has any of the given names.

Parameters
namesThe alternative names of the charged species
Returns
The local index of the charged species if found. The number of charged species otherwise.

◆ indexCation()

auto indexCation ( std::string  name) const -> Index

Return the local index of a cation among the cations in the aqueous mixture.

Parameters
nameThe name of the cation
Returns
The local index of the cation if found. The number of cations otherwise.

◆ indexAnion()

auto indexAnion ( std::string  name) const -> Index

Return the local index of an anion among the anions in the aqueous mixture.

Parameters
nameThe name of the anion
Returns
The local index of the anion if found. The number of anions otherwise.

◆ dissociationMatrix()

auto dissociationMatrix ( ) const -> MatrixConstRef

Return the dissociation matrix of the aqueous complexes into ions.

This the matrix defines the stoichiometric relationship between the aqueous complexes and the ions produced from their dissociation. For example, the stoichiometry of the j-th ion in the dissociation reaction of the i*-th aqueous complex is given by the (i, j)-th entry in the matrix.

◆ molalities()

auto molalities ( VectorConstRef  n) const -> ChemicalVector

Calculate the molalities of the aqueous species and its molar derivatives.

Parameters
nThe molar abundance of species (in units of mol)
Returns
The molalities and their partial derivatives

◆ stoichiometricMolalities()

auto stoichiometricMolalities ( const ChemicalVector m) const -> ChemicalVector

Calculate the stoichiometric molalities of the ions and its molar derivatives.

Parameters
mThe molalities of the aqueous species and their partial derivatives
Returns
The stoichiometric molalities and their partial derivatives

◆ effectiveIonicStrength()

auto effectiveIonicStrength ( const ChemicalVector m) const -> ChemicalScalar

Calculate the effective ionic strength of the aqueous mixture and its molar derivatives.

Parameters
mThe molalities of the aqueous species and their partial derivatives
Returns
The effective ionic strength of the aqueous mixture and its molar derivatives

◆ stoichiometricIonicStrength()

auto stoichiometricIonicStrength ( const ChemicalVector ms) const -> ChemicalScalar

Calculate the stoichiometric ionic strength of the aqueous mixture and its molar derivatives.

Parameters
msThe stoichiometric molalities of the ions and their partial derivatives
Returns
The stoichiometric ionic strength of the aqueous mixture and its molar derivatives

◆ state()

auto state ( Temperature  T,
Pressure  P,
VectorConstRef  n 
) const -> AqueousMixtureState

Calculate the state of the aqueous mixture.

Parameters
TThe temperature (in units of K)
PThe pressure (in units of Pa)
nThe molar amounts of the species in the mixture (in units of mol)

The documentation for this class was generated from the following files:
  • Reaktoro/Thermodynamics/Mixtures/AqueousMixture.hpp
  • Reaktoro/Thermodynamics/Mixtures/AqueousMixture.cpp