The class used to define conditions to be satisfied at chemical equilibrium. More...
#include <EquilibriumConditions.hpp>
Public Member Functions | |
EquilibriumConditions (ChemicalSystem const &system) | |
Construct an EquilibriumSolver object with given chemical system. | |
EquilibriumConditions (EquilibriumSpecs const &specs) | |
Construct an EquilibriumConditions object with given equilibrium specifications. | |
auto | temperature (real const &value, String const &unit="K") -> void |
Specify the temperature of the system at chemical equilibrium. More... | |
auto | pressure (real const &value, String const &unit="Pa") -> void |
Specify the pressure of the system at chemical equilibrium. More... | |
auto | volume (real const &value, String const &unit="m3") -> void |
Specify the volume of the system at chemical equilibrium. More... | |
auto | internalEnergy (real const &value, String const &unit="J") -> void |
Specify the internal energy of the system at chemical equilibrium. More... | |
auto | enthalpy (real const &value, String const &unit="J") -> void |
Specify the enthalpy of the system at chemical equilibrium. More... | |
auto | gibbsEnergy (real const &value, String const &unit="J") -> void |
Specify the Gibbs energy of the system at chemical equilibrium. More... | |
auto | helmholtzEnergy (real const &value, String const &unit="J") -> void |
Specify the Helmholtz energy of the system at chemical equilibrium. More... | |
auto | entropy (real const &value, String const &unit="J/K") -> void |
Specify the entropy of the system at chemical equilibrium. More... | |
auto | charge (real const &value, String const &unit="mol") -> void |
Specify the electric charge at chemical equilibrium. More... | |
auto | elementAmount (StringOrIndex const &element, real const &value, String const &unit="mol") -> void |
Specify the amount of an element at chemical equilibrium. More... | |
auto | elementAmountInPhase (StringOrIndex const &element, StringOrIndex const &phase, real const &value, String const &unit="mol") -> void |
Specify the amount of an element in a phase at chemical equilibrium. More... | |
auto | elementMass (StringOrIndex const &element, real const &value, String const &unit="kg") -> void |
Specify the mass of an element at chemical equilibrium. More... | |
auto | elementMassInPhase (StringOrIndex const &element, StringOrIndex const &phase, real const &value, String const &unit="kg") -> void |
Specify the mass of an element in a phase at chemical equilibrium. More... | |
auto | phaseAmount (StringOrIndex const &phase, real const &value, String const &unit="mol") -> void |
Specify the amount of a phase at chemical equilibrium. More... | |
auto | phaseMass (StringOrIndex const &phase, real const &value, String const &unit="kg") -> void |
Specify the mass of a phase at chemical equilibrium. More... | |
auto | phaseVolume (StringOrIndex const &phase, real const &value, String const &unit="m3") -> void |
Specify the volume of a phase at chemical equilibrium. More... | |
auto | chemicalPotential (String const &substance, real const &value, String const &unit="J/mol") -> void |
Specify the chemical potential of a substance at chemical equilibrium. More... | |
auto | lnActivity (String const &species, real const &value) -> void |
Specify the ln activity of a species at chemical equilibrium. More... | |
auto | lgActivity (String const &species, real const &value) -> void |
Specify the lg activity of a species at chemical equilibrium. More... | |
auto | activity (String const &species, real const &value) -> void |
Specify the activity of a species at chemical equilibrium. More... | |
auto | fugacity (String const &species, real const &value, String const &unit="bar") -> void |
Specify the fugacity of a gaseous species at chemical equilibrium. More... | |
auto | pH (real const &value) -> void |
Specify the pH at chemical equilibrium. More... | |
auto | pMg (real const &value) -> void |
Specify the pMg at chemical equilibrium. More... | |
auto | pE (real const &value) -> void |
Specify the pE at chemical equilibrium. More... | |
auto | Eh (real const &value, String const &unit="V") -> void |
Specify the Eh at chemical equilibrium. More... | |
auto | setLowerBoundTemperature (double value, String const &unit="K") -> void |
Set the lower bound for temperature during the equilibrium calculation. | |
auto | setUpperBoundTemperature (double value, String const &unit="K") -> void |
Set the upper bound for temperature during the equilibrium calculation. | |
auto | setLowerBoundPressure (double value, String const &unit="Pa") -> void |
Set the lower bound for pressure during the equilibrium calculation. | |
auto | setUpperBoundPressure (double value, String const &unit="Pa") -> void |
Set the upper bound for pressure during the equilibrium calculation. | |
auto | setLowerBoundTitrant (String const &substance, double value, String const &unit="mol") -> void |
Set the lower bound for the amount of a titrant during the equilibrium calculation. | |
auto | setUpperBoundTitrant (String const &substance, double value, String const &unit="mol") -> void |
Set the upper bound for the amount of a titrant during the equilibrium calculation. | |
auto | setLowerBoundsControlVariablesP (ArrayXdConstRef const &values) -> void |
Set the values of the specified lower bounds for the p control variables. | |
auto | setUpperBoundsControlVariablesP (ArrayXdConstRef const &values) -> void |
Set the values of the specified upper bounds for the p control variables. | |
auto | lowerBoundsControlVariablesP () const -> ArrayXdConstRef |
Get the specified lower bounds for the p control variables. | |
auto | upperBoundsControlVariablesP () const -> ArrayXdConstRef |
Get the specified upper bounds for the p control variables. | |
auto | set (String const &input, real const &val) -> void |
Set the value of an input variable with given name. More... | |
auto | setInputVariable (String const &name, real const &val) -> void |
Set the value of an input variable with given name. More... | |
auto | setInputVariable (Index index, real const &val) -> void |
Set the value of an input variable with given index. More... | |
auto | setInputVariables (ArrayXrConstRef const &values) -> void |
Set the input variables with given vector of input values. | |
auto | inputNames () const -> Strings const & |
Get the names of the input variables associated with the equilibrium conditions. | |
auto | inputValues () const -> ArrayXrConstRef |
Get the values of the input variables associated with the equilibrium conditions. | |
auto | inputValuesGetOrCompute (ChemicalState const &state0) const -> ArrayXr |
Get the values of the input variables associated with the equilibrium conditions if specified, otherwise fetch them from given initial state. | |
auto | inputValue (String const &name) const -> real const & |
Get the value of an input variable with given name. More... | |
auto | setInitialComponentAmounts (VectorXdConstRef const &c0) -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts. More... | |
auto | setInitialComponentAmountsFromSpeciesAmounts (VectorXdConstRef const &n0) -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts. More... | |
auto | setInitialComponentAmountsFromState (ChemicalState const &state0) -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts. More... | |
auto | initialComponentAmounts () const -> ArrayXdConstRef |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts. More... | |
auto | initialComponentAmountsGetOrCompute (VectorXdConstRef const &n0) const -> ArrayXd |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts if available, otherwise compute it. More... | |
auto | initialComponentAmountsGetOrCompute (ChemicalState const &state0) const -> ArrayXd |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts if available, otherwise compute it. More... | |
auto | system () const -> ChemicalSystem const & |
Get the chemical system associated with the equilibrium conditions. | |
Detailed Description
The class used to define conditions to be satisfied at chemical equilibrium.
Member Function Documentation
◆ temperature()
Specify the temperature of the system at chemical equilibrium.
- Parameters
-
value The temperature of the system unit The unit of the temperature value (must be convertible to K)
◆ pressure()
Specify the pressure of the system at chemical equilibrium.
- Parameters
-
value The pressure of the system unit The unit of the pressure value (must be convertible to Pa)
◆ volume()
Specify the volume of the system at chemical equilibrium.
- Parameters
-
value The volume of the system unit The unit of the volume value (must be convertible to m3)
◆ internalEnergy()
Specify the internal energy of the system at chemical equilibrium.
- Parameters
-
value The internal energy of the system unit The unit of the internal energy value (must be convertible to J)
◆ enthalpy()
Specify the enthalpy of the system at chemical equilibrium.
- Parameters
-
value The enthalpy of the system unit The unit of the enthalpy value (must be convertible to J)
◆ gibbsEnergy()
Specify the Gibbs energy of the system at chemical equilibrium.
- Parameters
-
value The Gibbs energy of the system unit The unit of the Gibbs energy value (must be convertible to J)
◆ helmholtzEnergy()
Specify the Helmholtz energy of the system at chemical equilibrium.
- Parameters
-
value The Helmholtz energy of the system unit The unit of the Helmholtz energy value (must be convertible to J)
◆ entropy()
Specify the entropy of the system at chemical equilibrium.
- Parameters
-
value The entropy of the system unit The unit of the entropy value (must be convertible to J/K)
◆ charge()
Specify the electric charge at chemical equilibrium.
- Parameters
-
value The electric charge amount in the system unit The unit of the electric charge value (must be convertible to mol)
◆ elementAmount()
auto elementAmount | ( | StringOrIndex const & | element, |
real const & | value, | ||
String const & | unit = "mol" |
||
) | -> void |
Specify the amount of an element at chemical equilibrium.
- Parameters
-
element The name or index of the element in the system value The amount of an element in the system unit The unit of the element amount value (must be convertible to mol)
◆ elementAmountInPhase()
auto elementAmountInPhase | ( | StringOrIndex const & | element, |
StringOrIndex const & | phase, | ||
real const & | value, | ||
String const & | unit = "mol" |
||
) | -> void |
Specify the amount of an element in a phase at chemical equilibrium.
- Parameters
-
element The name or index of the element in the system phase The name or index of the phase in the system value The amount of an element in a phase unit The unit of the element amount value (must be convertible to mol)
◆ elementMass()
auto elementMass | ( | StringOrIndex const & | element, |
real const & | value, | ||
String const & | unit = "kg" |
||
) | -> void |
Specify the mass of an element at chemical equilibrium.
- Parameters
-
element The name or index of the element in the system value The mass of an element in the system unit The unit of the element mass value (must be convertible to kg)
◆ elementMassInPhase()
auto elementMassInPhase | ( | StringOrIndex const & | element, |
StringOrIndex const & | phase, | ||
real const & | value, | ||
String const & | unit = "kg" |
||
) | -> void |
Specify the mass of an element in a phase at chemical equilibrium.
- Parameters
-
element The name or index of the element in the system phase The name or index of the phase in the system value The mass of an element in a phase unit The unit of the element mass value (must be convertible to kg)
◆ phaseAmount()
auto phaseAmount | ( | StringOrIndex const & | phase, |
real const & | value, | ||
String const & | unit = "mol" |
||
) | -> void |
Specify the amount of a phase at chemical equilibrium.
- Parameters
-
phase The name or index of the phase in the system value The amount of a phase in the system unit The unit of the phase amount value (must be convertible to mol)
◆ phaseMass()
auto phaseMass | ( | StringOrIndex const & | phase, |
real const & | value, | ||
String const & | unit = "kg" |
||
) | -> void |
Specify the mass of a phase at chemical equilibrium.
- Parameters
-
phase The name or index of the phase in the system value The mass of a phase in the system unit The unit of the phase mass value (must be convertible to kg)
◆ phaseVolume()
auto phaseVolume | ( | StringOrIndex const & | phase, |
real const & | value, | ||
String const & | unit = "m3" |
||
) | -> void |
Specify the volume of a phase at chemical equilibrium.
- Parameters
-
phase The name or index of the phase in the system value The volume of a phase in the system unit The unit of the phase volume value (must be convertible to m3)
◆ chemicalPotential()
auto chemicalPotential | ( | String const & | substance, |
real const & | value, | ||
String const & | unit = "J/mol" |
||
) | -> void |
Specify the chemical potential of a substance at chemical equilibrium.
- Parameters
-
substance The chemical formula of the substance. value The constrained chemical potential value. unit The unit for the constrained chemical potential value (must be convertible to J/mol).
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider a chemical potential constraint for the substance.
◆ lnActivity()
Specify the ln activity of a species at chemical equilibrium.
- Parameters
-
species The name of the chemical species. value The constrained ln activity value.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider an activity constraint for the species.
◆ lgActivity()
Specify the lg activity of a species at chemical equilibrium.
- Parameters
-
species The name of the chemical species. value The constrained lg activity value.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider an activity constraint for the species.
◆ activity()
Specify the activity of a species at chemical equilibrium.
- Parameters
-
species The name of the chemical species. value The constrained activity value.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider an activity constraint for the species.
◆ fugacity()
Specify the fugacity of a gaseous species at chemical equilibrium.
- Parameters
-
species The name of the gaseous species. value The constrained fugacity value. unit The unit for the constrained fugacity value (must be convertible to Pa; default is bar).
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider a fugacity constraint for the gas.
◆ pH()
auto pH | ( | real const & | value | ) | -> void |
Specify the pH at chemical equilibrium.
- Parameters
-
value The constrained value for pH.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider a pH constraint.
◆ pMg()
auto pMg | ( | real const & | value | ) | -> void |
Specify the pMg at chemical equilibrium.
- Parameters
-
value The constrained value for pMg.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider a pMg constraint.
◆ pE()
auto pE | ( | real const & | value | ) | -> void |
Specify the pE at chemical equilibrium.
- Parameters
-
value The constrained value for pE.
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider a pE constraint.
◆ Eh()
Specify the Eh at chemical equilibrium.
- Parameters
-
value The constrained value for Eh. unit The unit of the constrained value for Eh (must be convertible to V).
- Warning
- An error is thrown if the specifications for the chemical equilibrium calculation
- do not consider an Eh constraint.
◆ set()
Set the value of an input variable with given name.
- Parameters
-
name The unique name of the input variable. value The new value of the input variable.
- Warning
- An error is thrown if there are no input variable with given name.
◆ setInputVariable() [1/2]
Set the value of an input variable with given name.
- Parameters
-
name The unique name of the input variable. value The new value of the input variable.
- Warning
- An error is thrown if there are no input variable with given name.
◆ setInputVariable() [2/2]
Set the value of an input variable with given index.
- Parameters
-
index The index of the input variable. value The new value of the input variable.
- Warning
- An error is thrown if given index is out of bounds.
◆ inputValue()
Get the value of an input variable with given name.
- Parameters
-
name The unique name of the input variable
◆ setInitialComponentAmounts()
auto setInitialComponentAmounts | ( | VectorXdConstRef const & | c0 | ) | -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts.
- Parameters
-
c0 The initial amounts of the conservative components \(c^\circ\).
◆ setInitialComponentAmountsFromSpeciesAmounts()
auto setInitialComponentAmountsFromSpeciesAmounts | ( | VectorXdConstRef const & | n0 | ) | -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts.
This method sets the initial amounts of the conservative components \(c^\circ\) using \(c^\circ=Cn^\circ\) where \(C\) is the conservation matrix of the species with respect to the conservative components and \(n^\circ\) is the given initial amounts of the species.
- Parameters
-
n0 The initial amounts of the species \(n^\circ\).
◆ setInitialComponentAmountsFromState()
auto setInitialComponentAmountsFromState | ( | ChemicalState const & | state0 | ) | -> void |
Set the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts.
This method sets the initial amounts of the conservative components \(c^\circ\) using \(c^\circ=Cn^\circ\) where \(C\) is the conservation matrix of the species with respect to the conservative components and \(n^\circ\) is the initial amounts of the species given in a initial chemical state of the system.
- Parameters
-
state0 The initial state of the system.
◆ initialComponentAmounts()
auto initialComponentAmounts | ( | ) | const -> ArrayXdConstRef |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts.
The amounts of conservative components can be set directly using setInitialComponentAmounts or indirectly using setInitialComponentAmountsFromSpeciesAmounts and setInitialComponentAmountsFromState. If none of these methods have been called, and empty array is returned by this method.
◆ initialComponentAmountsGetOrCompute() [1/2]
auto initialComponentAmountsGetOrCompute | ( | VectorXdConstRef const & | n0 | ) | const -> ArrayXd |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts if available, otherwise compute it.
If neither setInitialSpeciesAmounts nor setInitialComponentAmounts have been used before to set the initial amounts of the conservative components \(c^\circ\), then this vector is computed using a given vector \(n^\circ\) with the initial amounts of species. Otherwise, the existing values for \(c^\circ\) is returned instead.
- Parameters
-
n0 The initial amounts of the species \(n^\circ\) used to compute \(c^\circ\) in case it has not been set before.
◆ initialComponentAmountsGetOrCompute() [2/2]
auto initialComponentAmountsGetOrCompute | ( | ChemicalState const & | state0 | ) | const -> ArrayXd |
Get the initial amounts of the conservative components \(c^\circ\) before the chemical system reacts if available, otherwise compute it.
- Parameters
-
state0 The initial state of the system from which the initial amounts of the species \(n^\circ\) are collected if needed.
The documentation for this class was generated from the following file:
- Reaktoro/Equilibrium/EquilibriumConditions.hpp