EquilibriumConditions.hpp
40 //=================================================================================================
44 //=================================================================================================
95 auto elementAmount(StringOrIndex const& element, real const& value, String const& unit="mol") -> void;
102 auto elementAmountInPhase(StringOrIndex const& element, StringOrIndex const& phase, real const& value, String const& unit="mol") -> void;
108 auto elementMass(StringOrIndex const& element, real const& value, String const& unit="kg") -> void;
115 auto elementMassInPhase(StringOrIndex const& element, StringOrIndex const& phase, real const& value, String const& unit="kg") -> void;
121 auto phaseAmount(StringOrIndex const& phase, real const& value, String const& unit="mol") -> void;
133 auto phaseVolume(StringOrIndex const& phase, real const& value, String const& unit="m3") -> void;
135 //=================================================================================================
139 //=================================================================================================
147 auto chemicalPotential(String const& substance, real const& value, String const& unit="J/mol") -> void;
203 //=================================================================================================
207 //=================================================================================================
222 auto setLowerBoundTitrant(String const& substance, double value, String const& unit="mol") -> void;
225 auto setUpperBoundTitrant(String const& substance, double value, String const& unit="mol") -> void;
239 //=================================================================================================
243 //=================================================================================================
279 //=================================================================================================
283 //=================================================================================================
322 //=================================================================================================
326 //=================================================================================================
The class used to represent a chemical system and its attributes and properties.
Definition: ChemicalSystem.hpp:70
The class used to define conditions to be satisfied at chemical equilibrium.
Definition: EquilibriumConditions.hpp:32
auto upperBoundsControlVariablesP() const -> ArrayXdConstRef
Get the specified upper bounds for the p control variables.
auto setLowerBoundTemperature(double value, String const &unit="K") -> void
Set the lower bound for temperature during the equilibrium calculation.
auto setLowerBoundsControlVariablesP(ArrayXdConstRef const &values) -> void
Set the values of the specified lower bounds for the p control variables.
auto setUpperBoundTemperature(double value, String const &unit="K") -> void
Set the upper bound for temperature during the equilibrium calculation.
auto charge(real const &value, String const &unit="mol") -> void
Specify the electric charge at chemical equilibrium.
auto activity(String const &species, real const &value) -> void
Specify the activity of a species at chemical equilibrium.
auto lnActivity(String const &species, real const &value) -> void
Specify the ln activity of a species at chemical equilibrium.
auto lgActivity(String const &species, real const &value) -> void
Specify the lg activity of a species at chemical equilibrium.
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 inputValue(String const &name) const -> real const &
Get the value of an input variable with given name.
auto setUpperBoundsControlVariablesP(ArrayXdConstRef const &values) -> void
Set the values of the specified upper bounds for the p control variables.
auto setInputVariables(ArrayXrConstRef const &values) -> void
Set the input variables with given vector of input values.
auto pMg(real const &value) -> void
Specify the pMg at chemical equilibrium.
auto initialComponentAmountsGetOrCompute(VectorXdConstRef const &n0) const -> ArrayXd
Get the initial amounts of the conservative components before the chemical system reacts if availabl...
auto enthalpy(real const &value, String const &unit="J") -> void
Specify the enthalpy of the system at chemical equilibrium.
auto setLowerBoundPressure(double value, String const &unit="Pa") -> void
Set the lower bound for pressure during the equilibrium calculation.
auto phaseVolume(StringOrIndex const &phase, real const &value, String const &unit="m3") -> void
Specify the volume of a phase at chemical equilibrium.
auto setInitialComponentAmountsFromSpeciesAmounts(VectorXdConstRef const &n0) -> void
Set the initial amounts of the conservative components before the chemical system reacts.
auto chemicalPotential(String const &substance, real const &value, String const &unit="J/mol") -> void
Specify the chemical potential of a substance at chemical equilibrium.
auto Eh(real const &value, String const &unit="V") -> void
Specify the Eh at chemical equilibrium.
auto inputValuesGetOrCompute(ChemicalState const &state0) const -> ArrayXr
Get the values of the input variables associated with the equilibrium conditions if specified,...
auto pH(real const &value) -> void
Specify the pH at chemical equilibrium.
auto volume(real const &value, String const &unit="m3") -> void
Specify the volume of the system at chemical equilibrium.
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.
auto initialComponentAmounts() const -> ArrayXdConstRef
Get the initial amounts of the conservative components before the chemical system reacts.
EquilibriumConditions(ChemicalSystem const &system)
Construct an EquilibriumSolver object with given chemical system.
auto elementAmount(StringOrIndex const &element, real const &value, String const &unit="mol") -> void
Specify the amount of an element at chemical equilibrium.
auto helmholtzEnergy(real const &value, String const &unit="J") -> void
Specify the Helmholtz energy of the system at chemical equilibrium.
auto setInputVariable(String const &name, real const &val) -> void
Set the value of an input variable with given name.
auto lowerBoundsControlVariablesP() const -> ArrayXdConstRef
Get the specified lower bounds for the p control variables.
auto temperature(real const &value, String const &unit="K") -> void
Specify the temperature of the system at chemical equilibrium.
auto system() const -> ChemicalSystem const &
Get the chemical system associated with the equilibrium conditions.
auto setInitialComponentAmountsFromState(ChemicalState const &state0) -> void
Set the initial amounts of the conservative components before the chemical system reacts.
auto elementMass(StringOrIndex const &element, real const &value, String const &unit="kg") -> void
Specify the mass of an element at chemical equilibrium.
auto internalEnergy(real const &value, String const &unit="J") -> void
Specify the internal energy of the system at chemical equilibrium.
auto gibbsEnergy(real const &value, String const &unit="J") -> void
Specify the Gibbs energy of the system at chemical equilibrium.
auto setInitialComponentAmounts(VectorXdConstRef const &c0) -> void
Set the initial amounts of the conservative components before the chemical system reacts.
auto fugacity(String const &species, real const &value, String const &unit="bar") -> void
Specify the fugacity of a gaseous species at chemical equilibrium.
auto inputValues() const -> ArrayXrConstRef
Get the values of the input variables associated with the equilibrium conditions.
auto set(String const &input, real const &val) -> void
Set the value of an input variable with given name.
auto inputNames() const -> Strings const &
Get the names of the input variables associated with the equilibrium conditions.
auto entropy(real const &value, String const &unit="J/K") -> void
Specify the entropy of the system at chemical equilibrium.
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.
auto pE(real const &value) -> void
Specify the pE at chemical equilibrium.
auto phaseAmount(StringOrIndex const &phase, real const &value, String const &unit="mol") -> void
Specify the amount of a phase at chemical equilibrium.
auto pressure(real const &value, String const &unit="Pa") -> void
Specify the pressure of the system at chemical equilibrium.
auto phaseMass(StringOrIndex const &phase, real const &value, String const &unit="kg") -> void
Specify the mass of a phase at chemical equilibrium.
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.
EquilibriumConditions(EquilibriumSpecs const &specs)
Construct an EquilibriumConditions object with given equilibrium specifications.
The class used to define conditions to be satisfied at chemical equilibrium.
Definition: EquilibriumSpecs.hpp:281
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
auto unit(Index rows, Index i) -> decltype(VectorXd::Unit(rows, i))
Return an expression of a unit vector.
Definition: Matrix.hpp:546
autodiff::real real
The number type used throughout the library.
Definition: Real.hpp:26
std::vector< std::string > Strings
Convenient alias for std::vector<String>.
Definition: Types.hpp:55
Eigen::Ref< const VectorXd > VectorXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:76
std::variant< Index, int, std::string > StringOrIndex
The type used to accept either a name or an index.
Definition: Types.hpp:58
Eigen::Ref< const ArrayXd > ArrayXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:105
auto index(const Container &c, const T &x) -> std::size_t
Return the index of item x in container c or the number of items if not found.
Definition: Algorithms.hpp:37
Eigen::Ref< const ArrayXr > ArrayXrConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:89
autodiff::ArrayXreal ArrayXr
Convenient alias to Eigen type.
Definition: Matrix.hpp:87