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

## 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.

AqueousSpecies

#include <AqueousMixture.hpp>

Inheritance diagram for Reaktoro::AqueousMixture:
Collaboration diagram for Reaktoro::AqueousMixture:

## 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 -> const Matrix &
Return the dissociation matrix of the aqueous complexes into ions. More...

auto molalities (const Vector &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 (double T, double P, const Vector &n) const -> AqueousMixtureState
Calculate the state of the aqueous mixture. More...

Public Member Functions inherited from Reaktoro::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 molarFractions (const Vector &n) const -> ChemicalVector
Calculates the molar fractions of the species and their partial derivatives. More...

auto state (double T, double P, const Vector &n) const -> MixtureState
Calculate the state of the mixture. More...

## Constructor & Destructor Documentation

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

Construct an AqueousMixture instance with given species.

Parameters
 species The species that compose the aqueous mixture

## Member Function Documentation

 auto Reaktoro::AqueousMixture::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
 temperatures The temperature points (in units of K) pressures The pressure points (in units of Pa)
 auto Reaktoro::AqueousMixture::indexNeutralSpecies ( std::string name ) const -> Index

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

Parameters
 name The name of the neutral species
Returns
The local index of the neutral species if found. The number of neutral species otherwise.
 auto Reaktoro::AqueousMixture::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
 names The alternative names of the neutral species.
Returns
The local index of the neutral species if found. The number of neutral species otherwise.
 auto Reaktoro::AqueousMixture::indexChargedSpecies ( std::string name ) const -> Index

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

Parameters
 name The name of the charged species
Returns
The local index of the charged species if found. The number of charged species otherwise.
 auto Reaktoro::AqueousMixture::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
 names The alternative names of the charged species
Returns
The local index of the charged species if found. The number of charged species otherwise.
 auto Reaktoro::AqueousMixture::indexCation ( std::string name ) const -> Index

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

Parameters
 name The name of the cation
Returns
The local index of the cation if found. The number of cations otherwise.
 auto Reaktoro::AqueousMixture::indexAnion ( std::string name ) const -> Index

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

Parameters
 name The name of the anion
Returns
The local index of the anion if found. The number of anions otherwise.
 auto Reaktoro::AqueousMixture::dissociationMatrix ( ) const -> const Matrix&

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.

 auto Reaktoro::AqueousMixture::molalities ( const Vector & n ) const -> ChemicalVector

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

Parameters
 n The molar abundance of species (in units of mol)
Returns
The molalities and their partial derivatives
 auto Reaktoro::AqueousMixture::stoichiometricMolalities ( const ChemicalVector & m ) const -> ChemicalVector

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

Parameters
 m The molalities of the aqueous species and their partial derivatives
Returns
The stoichiometric molalities and their partial derivatives
 auto Reaktoro::AqueousMixture::effectiveIonicStrength ( const ChemicalVector & m ) const -> ChemicalScalar

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

Parameters
 m The molalities of the aqueous species and their partial derivatives
Returns
The effective ionic strength of the aqueous mixture and its molar derivatives
 auto Reaktoro::AqueousMixture::stoichiometricIonicStrength ( const ChemicalVector & ms ) const -> ChemicalScalar

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

Parameters
 ms The stoichiometric molalities of the ions and their partial derivatives
Returns
The stoichiometric ionic strength of the aqueous mixture and its molar derivatives
 auto Reaktoro::AqueousMixture::state ( double T, double P, const Vector & n ) const -> AqueousMixtureState

Calculate the state of the aqueous mixture.

Parameters
 T The temperature (in units of K) P The pressure (in units of Pa) n The 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