Reaktoro 
A unified framework for modeling chemically reactive systems
ChemicalProperties.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <memory>
22 
23 // Reaktoro includes
24 #include <Reaktoro/Common/ChemicalVector.hpp>
25 #include <Reaktoro/Common/ThermoVector.hpp>
26 
27 namespace Reaktoro {
28 
29 // Forward declarations
30 class ChemicalSystem;
31 class ChemicalPropertiesAqueousPhase;
32 struct PhaseChemicalModelResult;
33 struct PhaseThermoModelResult;
34 
37 {
38 public:
41 
44 
48  auto update(double T, double P) -> void;
49 
54  auto update(double T, double P, const Vector& n) -> void;
55 
57  auto temperature() const -> double;
58 
60  auto pressure() const -> double;
61 
63  auto composition() const -> const Vector&;
64 
66  auto system() const -> const ChemicalSystem&;
67 
69  auto phaseThermoModelResults() const -> const std::vector<PhaseThermoModelResult>&;
70 
72  auto phaseChemicalModelResults() const -> const std::vector<PhaseChemicalModelResult>&;
73 
75  auto molarFractions() const -> ChemicalVector;
76 
78  auto lnActivityCoefficients() const -> ChemicalVector;
79 
81  auto lnActivityConstants() const -> ThermoVector;
82 
84  auto lnActivities() const -> ChemicalVector;
85 
87  auto chemicalPotentials() const -> ChemicalVector;
88 
91 
94 
97 
100 
103 
106 
109 
112 
114  auto phaseMolarGibbsEnergies() const -> ChemicalVector;
115 
117  auto phaseMolarEnthalpies() const -> ChemicalVector;
118 
120  auto phaseMolarVolumes() const -> ChemicalVector;
121 
123  auto phaseMolarEntropies() const -> ChemicalVector;
124 
127 
130 
133 
136 
139 
141  auto phaseSpecificEnthalpies() const -> ChemicalVector;
142 
144  auto phaseSpecificVolumes() const -> ChemicalVector;
145 
147  auto phaseSpecificEntropies() const -> ChemicalVector;
148 
151 
154 
157 
160 
162  auto phaseDensities() const -> ChemicalVector;
163 
165  auto phaseMasses() const -> ChemicalVector;
166 
168  auto phaseAmounts() const -> ChemicalVector;
169 
171  auto phaseVolumes() const -> ChemicalVector;
172 
174  auto volume() const -> ChemicalScalar;
175 
178  auto subvolume(const Indices& iphases) const -> ChemicalScalar;
179 
182  auto fluidVolume() const -> ChemicalScalar;
183 
186  auto solidVolume() const -> ChemicalScalar;
187 
189  auto aqueous() const -> ChemicalPropertiesAqueousPhase;
190 
191 private:
192  struct Impl;
193 
194  std::shared_ptr<Impl> pimpl;
195 };
196 
197 } // namespace Reaktoro
auto phaseMolarInternalEnergies() const -> ChemicalVector
Return the molar internal energies of the phases (in units of J/mol).
Definition: ChemicalProperties.cpp:646
auto phaseMolarHelmholtzEnergies() const -> ChemicalVector
Return the molar Helmholtz energies of the phases (in units of J/mol).
Definition: ChemicalProperties.cpp:651
auto standardPartialMolarHeatCapacitiesConstV() const -> ThermoVector
Return the standard partial molar isochoric heat capacities of the species (in units of J/(mol*K))...
Definition: ChemicalProperties.cpp:621
auto phaseMolarEntropies() const -> ChemicalVector
Return the molar entropies of the phases (in units of J/(mol*K)).
Definition: ChemicalProperties.cpp:641
auto phaseMolarVolumes() const -> ChemicalVector
Return the molar volumes of the phases (in units of m3/mol).
Definition: ChemicalProperties.cpp:636
ThermoVectorBase< Vector, Vector, Vector > ThermoVector
A type that defines a vector thermo property.
Definition: ScalarTypes.hpp:41
A class for querying thermodynamic and chemical properties of a chemical system.
Definition: ChemicalProperties.hpp:36
auto phaseSpecificInternalEnergies() const -> ChemicalVector
Return the specific internal energies of the phases (in units of J/kg).
Definition: ChemicalProperties.cpp:686
auto molarFractions() const -> ChemicalVector
Return the molar fractions of the species.
Definition: ChemicalProperties.cpp:561
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
auto phaseMolarGibbsEnergies() const -> ChemicalVector
Return the molar Gibbs energies of the phases (in units of J/mol).
Definition: ChemicalProperties.cpp:626
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
auto phaseMolarEnthalpies() const -> ChemicalVector
Return the molar enthalpies of the phases (in units of J/mol).
Definition: ChemicalProperties.cpp:631
auto volume() const -> ChemicalScalar
Return the volume of the system (in units of m3).
Definition: ChemicalProperties.cpp:726
auto phaseMasses() const -> ChemicalVector
Return the masses of the phases (in units of kg).
Definition: ChemicalProperties.cpp:711
auto standardPartialMolarVolumes() const -> ThermoVector
Return the standard partial molar volumes of the species (in units of m3/mol).
Definition: ChemicalProperties.cpp:596
auto phaseMolarHeatCapacitiesConstP() const -> ChemicalVector
Return the molar isobaric heat capacities of the phases (in units of J/(mol*K)).
Definition: ChemicalProperties.cpp:656
auto system() const -> const ChemicalSystem &
Return the chemical system.
Definition: ChemicalProperties.cpp:546
auto standardPartialMolarHeatCapacitiesConstP() const -> ThermoVector
Return the standard partial molar isobaric heat capacities of the species (in units of J/(mol*K))...
Definition: ChemicalProperties.cpp:616
ChemicalScalarBase< double, Vector > ChemicalScalar
A type that represents a chemical scalar and its derivatives.
Definition: ChemicalScalar.hpp:35
auto phaseSpecificHeatCapacitiesConstP() const -> ChemicalVector
Return the specific isobaric heat capacities of the phases (in units of J/(kg*K)).
Definition: ChemicalProperties.cpp:696
auto phaseSpecificHelmholtzEnergies() const -> ChemicalVector
Return the specific Helmholtz energies of the phases (in units of J/kg).
Definition: ChemicalProperties.cpp:691
auto phaseSpecificEnthalpies() const -> ChemicalVector
Return the specific enthalpies of the phases (in units of J/kg).
Definition: ChemicalProperties.cpp:671
A class for querying aqueous thermodynamic and chemical properties in a chemical system.
Definition: ChemicalPropertiesAqueousPhase.hpp:34
auto lnActivityCoefficients() const -> ChemicalVector
Return the ln activity coefficients of the species.
Definition: ChemicalProperties.cpp:566
auto standardPartialMolarInternalEnergies() const -> ThermoVector
Return the standard partial molar internal energies of the species (in units of J/mol).
Definition: ChemicalProperties.cpp:606
auto solidVolume() const -> ChemicalScalar
Return the total solid volume of the system (in units of m3).
Definition: ChemicalProperties.cpp:741
auto phaseVolumes() const -> ChemicalVector
Return the volumes of the phases (in units of m3).
Definition: ChemicalProperties.cpp:721
auto pressure() const -> double
Return the pressure of the system (in units of Pa).
Definition: ChemicalProperties.cpp:536
auto fluidVolume() const -> ChemicalScalar
Return the total fluid volume of the system (in units of m3).
Definition: ChemicalProperties.cpp:736
Eigen::VectorXd Vector
Define an alias to the vector type of the Eigen library.
Definition: Matrix.hpp:384
auto temperature() const -> double
Return the temperature of the system (in units of K).
Definition: ChemicalProperties.cpp:531
auto lnActivityConstants() const -> ThermoVector
Return the ln activity constants of the species.
Definition: ChemicalProperties.cpp:571
auto phaseDensities() const -> ChemicalVector
Return the densities of the phases (in units of kg/m3).
Definition: ChemicalProperties.cpp:706
auto update(double T, double P) -> void
Update the thermodynamic properties of the chemical system.
Definition: ChemicalProperties.cpp:521
ChemicalProperties()
Construct a default ChemicalProperties instance.
Definition: ChemicalProperties.cpp:513
auto phaseAmounts() const -> ChemicalVector
Return the molar amounts of the phases (in units of mol).
Definition: ChemicalProperties.cpp:716
auto subvolume(const Indices &iphases) const -> ChemicalScalar
Return the total volume occupied by given phases (in units of m3).
Definition: ChemicalProperties.cpp:731
ChemicalVectorBase< Vector, Vector, Vector, Matrix > ChemicalVector
A type that represents a vector of chemical scalars and their derivatives.
Definition: ChemicalVector.hpp:39
auto standardPartialMolarGibbsEnergies() const -> ThermoVector
Return the standard partial molar Gibbs energies of the species (in units of J/mol).
Definition: ChemicalProperties.cpp:586
auto standardPartialMolarEntropies() const -> ThermoVector
Return the standard partial molar entropies of the species (in units of J/(mol*K)).
Definition: ChemicalProperties.cpp:601
auto phaseSpecificHeatCapacitiesConstV() const -> ChemicalVector
Return the specific isochoric heat capacities of the phases (in units of J/(kg*K)).
Definition: ChemicalProperties.cpp:701
auto phaseMolarHeatCapacitiesConstV() const -> ChemicalVector
Return the molar isochoric heat capacities of the phases (in units of J/(mol*K)). ...
Definition: ChemicalProperties.cpp:661
auto aqueous() const -> ChemicalPropertiesAqueousPhase
Return specific chemical properties of the aqueous phase.
Definition: ChemicalProperties.cpp:746
auto phaseChemicalModelResults() const -> const std::vector< PhaseChemicalModelResult > &
Return the result of the PhaseChemicalModel function of each phase.
Definition: ChemicalProperties.cpp:556
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto composition() const -> const Vector &
Return the molar amounts of the species (in units of mol).
Definition: ChemicalProperties.cpp:541
auto standardPartialMolarHelmholtzEnergies() const -> ThermoVector
Return the standard partial molar Helmholtz energies of the species (in units of J/mol).
Definition: ChemicalProperties.cpp:611
auto phaseThermoModelResults() const -> const std::vector< PhaseThermoModelResult > &
Return the result of the PhaseThermoModel function of each phase.
Definition: ChemicalProperties.cpp:551
auto standardPartialMolarEnthalpies() const -> ThermoVector
Return the standard partial molar enthalpies of the species (in units of J/mol).
Definition: ChemicalProperties.cpp:591
auto chemicalPotentials() const -> ChemicalVector
Return the chemical potentials of the species (in units of J/mol).
Definition: ChemicalProperties.cpp:581
auto phaseSpecificEntropies() const -> ChemicalVector
Return the specific entropies of the phases (in units of J/(kg*K)).
Definition: ChemicalProperties.cpp:681
auto phaseSpecificVolumes() const -> ChemicalVector
Return the specific volumes of the phases (in units of m3/kg).
Definition: ChemicalProperties.cpp:676
auto phaseSpecificGibbsEnergies() const -> ChemicalVector
Return the specific Gibbs energies of the phases (in units of J/kg).
Definition: ChemicalProperties.cpp:666
auto lnActivities() const -> ChemicalVector
Return the ln activities of the species.
Definition: ChemicalProperties.cpp:576