ChemicalState.hpp
31 //=================================================================================================
35 //=================================================================================================
332 //=================================================================================================
336 //=================================================================================================
454 auto optimaState() const -> Optima::State const&;
The class that computes chemical properties of a chemical system.
Definition: ChemicalProps.hpp:34
The access to the properties related to an equilibrium state in a ChemicalState object.
Definition: ChemicalState.hpp:340
virtual ~Equilibrium()
Destroy this ChemicalState::Equilibrium instance.
auto setOptimaState(Optima::State const &state) -> void
Set the Optima::State object computed as part of the equilibrium calculation.
auto setInitialComponentAmounts(ArrayXdConstRef const &c0) -> void
Set initial component amounts used in the equilibrium calculation.
auto setNamesControlVariablesQ(Strings const &qnames) -> void
Set the names of the computed control variables q in the equilibrium calculation.
auto setControlVariablesP(ArrayXdConstRef const &p) -> void
Set the values of the computed control variables p in the equilibrium calculation.
auto empty() const -> bool
Return true if no equilibrium information available.
auto setControlVariablesQ(ArrayXdConstRef const &q) -> void
Set the values of the computed control variables q in the equilibrium calculation.
auto setNamesControlVariablesP(Strings const &pnames) -> void
Set the names of the computed control variables p in the equilibrium calculation.
Equilibrium(ChemicalSystem const &system)
Construct a ChemicalState::Equilibrium instance.
auto reset() -> void
Reset this object by clearing all information related to a previous computed equilibrium state.
auto operator=(Equilibrium other) -> Equilibrium &
Assign a ChemicalState::Equilibrium instance to this instance.
auto setInputVariables(ArrayXdConstRef const &w) -> void
Set the values of the input variables w used in the equilibrium calculation.
auto setNamesInputVariables(Strings const &wnames) -> void
Set the names of the input variables w used in the equilibrium calculation.
Equilibrium(Equilibrium const &other)
Construct a copy of a ChemicalState::Equilibrium instance.
ChemicalState(ChemicalState const &other)
Construct a copy of a ChemicalState instance.
auto temperature() const -> real
Return the temperature in the chemical state (in K).
auto scaleSpeciesAmountsInPhase(StringOrIndex const &phase, real const &scalar) -> void
Scale the amounts of the species in a phase by a given factor.
auto updateIdeal(real const &T, real const &P, ArrayXrConstRef const &n) -> void
Update the chemical state and properties of the system using ideal activity models.
auto pressure() const -> real
Return the pressure in the chemical state (in Pa).
auto pressure(real const &value) -> void
Set the pressure of the chemical state.
auto scalePhaseMass(StringOrIndex const &phase, real mass, Chars unit) -> void
Scale the mass of a phase to a new value.
auto props() const -> ChemicalProps const &
Return the chemical properties of the system.
auto charge() const -> real
Return the electric charge in the chemical state (in mol).
auto speciesAmountsInPhase(StringOrIndex const &phase) const -> ArrayXrConstRef
Return the amounts of the species from a phase in the chemical state (in mol).
auto scaleAmount(real amount, Chars unit) -> void
Scale the amount of the system to a new value.
auto set(StringOrIndex const &species, real value, Chars unit) -> void
Set the amount or mass of a chemical species in the chemical state.
auto elementAmounts() const -> ArrayXr
Return the amounts of the elements in the chemical state (in mol).
auto speciesAmount(StringOrIndex const &species) const -> real
Return the amount of a species in the chemical state (in mol).
auto output(std::ostream &out) const -> void
Output this ChemicalState instance to a stream.
auto scaleFluidVolume(real volume, Chars unit) -> void
Scale the total volume of fluids in the system to a new value.
auto speciesAmounts() const -> ArrayXrConstRef
Return the amounts of the species in the chemical state (in mol).
auto scaleSolidAmount(real amount, Chars unit) -> void
Scale the total amount of solids in the system to a new value.
auto setTemperature(real value, Chars unit) -> void
Set the temperature of the chemical state with given unit.
auto scaleSpeciesAmounts(real const &scalar) -> void
Scale the amounts of every species by a given factor.
auto add(StringOrIndex const &species, real value, Chars unit) -> void
Add a specified amount or mass of a chemical species in the chemical state.
auto temperature(real const &value) -> void
Set the temperature of the chemical state.
auto scalePhaseAmount(StringOrIndex const &phase, real amount, Chars unit) -> void
Scale the amount of a phase to a new value.
auto temperature(real value, Chars unit) -> void
Set the temperature of the chemical state with given unit.
auto setPressure(real const &value) -> void
Set the pressure of the chemical state.
auto operator=(ChemicalState other) -> ChemicalState &
Assign a ChemicalState instance to this instance.
auto componentAmounts() const -> ArrayXr
Return the amounts of the conservative components (elements and charge) in the chemical state (in mol...
auto scalePhaseVolume(StringOrIndex const &phase, real volume, Chars unit) -> void
Scale the volume of a phase to a new value.
auto setSpeciesAmounts(real const &value) -> void
Set the amounts of all species in the chemical state to a common value (in mol).
auto system() const -> ChemicalSystem const &
Return the underlying chemical system for this chemical state.
auto setTemperature(real const &value) -> void
Set the temperature of the chemical state.
auto scaleVolume(real volume, Chars unit) -> void
Scale the volume of the system to a new value.
auto scaleFluidAmount(real amount, Chars unit) -> void
Scale the total amount of fluids in the system to a new value.
auto update(real const &T, real const &P, ArrayXrConstRef const &n) -> void
Update the chemical state and properties of the system.
auto scaleFluidMass(real mass, Chars unit) -> void
Scale the total mass of fluids in the system to a new value.
ChemicalState(ChemicalSystem const &system)
Construct a ChemicalState instance with standard conditions.
auto scaleSolidMass(real mass, Chars unit) -> void
Scale the total mass of solids in the system to a new value.
auto setSpeciesAmount(Index ispecies, real const &amount) -> void
Set the amount of a specific species in the system (in mol).
auto scaleMass(real mass, Chars unit) -> void
Scale the mass of the system to a new value.
auto setSpeciesMass(StringOrIndex const &species, real mass, Chars unit) -> void
Set the mass of a specific species in the system.
auto scaleSolidVolume(real volume, Chars unit) -> void
Scale the total volume of solids in the system to a new value.
auto equilibrium() const -> Equilibrium const &
Return the equilibrium properties of a calculated chemical equilibrium state.
auto speciesMass(StringOrIndex const &species) const -> real
Return the mass of a species in the chemical state (in kg).
The class used to represent a chemical system and its attributes and properties.
Definition: ChemicalSystem.hpp:70
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
std::unique_ptr< T > Ptr
Convenient alias for std::unique_ptr<T>.
Definition: Types.hpp:102
Eigen::Ref< const ArrayXl > ArrayXlConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:97
std::variant< Index, int, std::string > StringOrIndex
The type used to accept either a name or an index.
Definition: Types.hpp:58
std::tuple< Args... > Tuple
Convenient alias for std::tuple<Args...>.
Definition: Types.hpp:94
Eigen::Ref< const ArrayXd > ArrayXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:105
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
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
Tuple< real, real, ArrayXr > CacheType
The type used instead to cache a ChemicalState object.
Definition: ChemicalState.hpp:483
Used to enable function arguments of a type T to be cached in a memoized version of the function.
Definition: Memoization.hpp:30