ChemicalSystem.hpp
47 ChemicalSystem(const std::vector<Phase>& phases, const ThermoModel& thermo_model, const ChemicalModel& chemical_model);
223 auto elementAmountInSpecies(Index ielement, const Indices& ispecies, VectorConstRef n) const -> double;
std::function< void(ThermoModelResult &, Temperature, Pressure)> ThermoModel
The signature of the thermodynamic model function that calculates the standard thermodynamic properti...
Definition: ThermoModel.hpp:114
auto formulaMatrix() const -> MatrixConstRef
Return the formula matrix of the system The formula matrix is defined as the matrix whose entry (j,...
Definition: ChemicalSystem.cpp:260
auto indexElementWithError(std::string name) const -> Index
Return the index of an element in the system.
Definition: ChemicalSystem.cpp:270
std::function< void(ChemicalModelResult &, Temperature, Pressure, VectorConstRef)> ChemicalModel
The signature of the chemical model function that calculates the chemical properties of the species i...
Definition: ChemicalModel.hpp:132
auto properties(double T, double P) const -> ThermoProperties
Calculate the standard thermodynamic properties of the species.
Definition: ChemicalSystem.cpp:493
auto indices(const std::vector< std::string > &names, const NamedValues &values) -> Indices
Return the indices of some entries in a container.
Definition: SetUtils.hxx:59
ChemicalSystem()
Construct a default ChemicalSystem instance.
Definition: ChemicalSystem.cpp:167
auto index(const T &value, const std::vector< T > &values) -> Index
Find the index of a value in a container of values.
Definition: SetUtils.hxx:21
auto names(const NamedValues &values) -> std::vector< std::string >
Return the names of the entries in a container.
Definition: Utils.hxx:22
virtual ~ChemicalSystem()
Destroy this ChemicalSystem instance.
Definition: ChemicalSystem.cpp:179
auto numPhases() const -> unsigned
Return the number of phases in the system.
Definition: ChemicalSystem.cpp:197
auto indexSpecies(std::string name) const -> Index
Return the index of a species in the system.
Definition: ChemicalSystem.cpp:281
auto thermoModel() const -> const ThermoModel &
Return the thermodynamic model of the system.
Definition: ChemicalSystem.cpp:250
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
auto numElements() const -> unsigned
Return the number of elements in the system.
Definition: ChemicalSystem.cpp:182
auto elementAmount(Index ielement, VectorConstRef n) const -> double
Calculate the molar amount of elements (in units of mol)
Definition: ChemicalSystem.cpp:468
auto phases() const -> const std::vector< Phase > &
Return the list of phases in the system.
Definition: ChemicalSystem.cpp:245
auto elementAmountInPhase(Index ielement, Index iphase, VectorConstRef n) const -> double
Calculate the molar amounts of elements in a given phase (in units of mol)
Definition: ChemicalSystem.cpp:474
auto indexSpeciesAnyWithError(const std::vector< std::string > &names) const -> Index
Return the index of the first species in the system with any of the given names.
Definition: ChemicalSystem.cpp:300
auto indicesPhasesWithSpecies(const Indices &indices) const -> Indices
Return the index of the phase that contains a given species.
Definition: ChemicalSystem.cpp:405
auto indicesSolidSpecies() const -> Indices
Return the indices of the species in the solid phases.
Definition: ChemicalSystem.cpp:438
auto numSpeciesInPhase(Index iphase) const -> unsigned
Return the number of species in a phase of the system.
Definition: ChemicalSystem.cpp:192
auto indexElement(std::string name) const -> Index
Return the index of an element in the system.
Definition: ChemicalSystem.cpp:265
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto chemicalModel() const -> const ChemicalModel &
Return the chemical model of the system.
Definition: ChemicalSystem.cpp:255
auto elements() const -> const std::vector< Element > &
Return the list of elements in the system.
Definition: ChemicalSystem.cpp:212
auto elementAmountsInSpecies(const Indices &ispecies, VectorConstRef n) const -> Vector
Calculate the molar amounts of the elements in a given set of species (in units of mol)
Definition: ChemicalSystem.cpp:459
auto phase(Index index) const -> const Phase &
Return a phase of the system.
Definition: ChemicalSystem.cpp:232
auto indexSpeciesWithError(std::string name) const -> Index
Return the index of a species in the system.
Definition: ChemicalSystem.cpp:286
auto numSpecies() const -> unsigned
Return the number of species in the system.
Definition: ChemicalSystem.cpp:187
A class for querying thermodynamic and chemical properties of a chemical system.
Definition: ChemicalProperties.hpp:33
auto indexFirstSpeciesInPhase(Index iphase) const -> unsigned
Return the index of the first species in a phase.
Definition: ChemicalSystem.cpp:337
auto indicesFluidSpecies() const -> Indices
Return the indices of the species in the fluid phases.
Definition: ChemicalSystem.cpp:423
auto indexPhaseWithError(std::string name) const -> Index
Return the index of a phase in the system.
Definition: ChemicalSystem.cpp:315
auto indicesPhases(const std::vector< std::string > &names) const -> Indices
Return the indices of a set of phases in the system.
Definition: ChemicalSystem.cpp:396
auto elementAmountsInPhase(Index iphase, VectorConstRef n) const -> Vector
Calculate the molar amounts of the elements in a given phase (in units of mol)
Definition: ChemicalSystem.cpp:449
auto indicesSpeciesInPhases(const Indices &indices) const -> Indices
Return the indices of the species in a given set of phases.
Definition: ChemicalSystem.cpp:382
A class used for calculating standard thermodynamic properties of species in a chemical system.
Definition: ThermoProperties.hpp:30
auto indexPhaseWithSpecies(Index index) const -> Index
Return the index of the phase that contains a given species.
Definition: ChemicalSystem.cpp:326
A type used to define a chemical element and its attributes.
Definition: Element.hpp:28
auto indicesSolidPhases() const -> Indices
Return the indices of the solid phases.
Definition: ChemicalSystem.cpp:428
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
auto indicesElementsInSpecies(Index index) const -> Indices
Return the indices of the elements that compose a species.
Definition: ChemicalSystem.cpp:354
auto indexSpeciesAny(const std::vector< std::string > &names) const -> Index
Return the index of the first species in the system with any of the given names.
Definition: ChemicalSystem.cpp:295
auto indicesFluidPhases() const -> Indices
Return the indices of the fluid phases.
Definition: ChemicalSystem.cpp:413
auto indexPhase(std::string name) const -> Index
Return the index of a phase in the system.
Definition: ChemicalSystem.cpp:310
Eigen::Ref< const Eigen::MatrixXd > MatrixConstRef
Alias to Eigen type Ref<const MatrixXd>.
Definition: Matrix.hpp:44
auto element(Index index) const -> const Element &
Return an element of the system.
Definition: ChemicalSystem.cpp:202
Eigen::Ref< const Eigen::VectorXd > VectorConstRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:31
auto species() const -> const std::vector< Species > &
Return the list of species in the system.
Definition: ChemicalSystem.cpp:227
auto indicesSpecies(const std::vector< std::string > &names) const -> Indices
Return the indices of a set of species in the system.
Definition: ChemicalSystem.cpp:373
auto indicesElements(const std::vector< std::string > &names) const -> Indices
Return the indices of a set of elements in the system.
Definition: ChemicalSystem.cpp:345
auto elementAmounts(VectorConstRef n) const -> Vector
Calculate the molar amounts of the elements (in units of mol)
Definition: ChemicalSystem.cpp:443
auto elementAmountInSpecies(Index ielement, const Indices &ispecies, VectorConstRef n) const -> double
Calculate the molar amounts of elements in a given set of species (in units of mol)
Definition: ChemicalSystem.cpp:484