Reaktoro
A unified framework for modeling chemically reactive systems
ThermoData.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2018 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <vector>
22 #include <optional>
23 
24 // Reaktoro includes
25 #include <Reaktoro/Common/ReactionEquation.hpp>
26 #include <Reaktoro/Math/BilinearInterpolator.hpp>
27 
28 namespace Reaktoro {
29 
35 {
38 
41 
44 
47 
50 
53 
56 
59 };
60 
66 {
69 
72 };
73 
76 {
78  double Gf;
79 
81  double Hf;
82 
84  double Sr;
85 
87  double a1;
88 
90  double a2;
91 
93  double a3;
94 
96  double a4;
97 
99  double c1;
100 
102  double c2;
103 
105  double wref;
106 };
107 
110 {
112  double Gf;
113 
115  double Hf;
116 
118  double Sr;
119 
121  double a;
122 
124  double b;
125 
127  double c;
128 
130  double Tmax;
131 };
132 
135 
138 {
140  double Gf;
141 
143  double Hf;
144 
146  double Sr;
147 
149  double Vr;
150 
152  int nptrans;
153 
155  std::vector<double> a;
156 
158  std::vector<double> b;
159 
161  std::vector<double> c;
162 
164  std::vector<double> Ttr;
165 
167  std::vector<double> Htr;
168 
170  std::vector<double> Vtr;
171 
173  std::vector<double> dPdTtr;
174 
176  double Tmax;
177 };
178 
181 {
183  {
186 
188  double log_k;
189 
196  double delta_h;
197 
202  std::vector<double> analytic;
203  };
204 
205  ReactionParams reaction;
206 };
207 
210 {
212  std::optional<SpeciesThermoInterpolatedProperties> properties;
213 
215  std::optional<ReactionThermoInterpolatedProperties> reaction;
216 
218  std::optional<SpeciesThermoParamsPhreeqc> phreeqc;
219 };
220 
221 
224 {
226  std::optional<AqueousSpeciesThermoParamsHKF> hkf;
227 };
228 
231 {
233  std::optional<FluidSpeciesThermoParamsHKF> hkf;
234 };
235 
238 
241 {
243  std::optional<MineralSpeciesThermoParamsHKF> hkf;
244 };
245 
246 } // namespace Reaktoro
247 
248 
A type for storing the parameters of the HKF equation of state for a mineral species.
Definition: ThermoData.hpp:138
double b
The coefficient b of the HKF equation of state of the fluid species (in units of cal/(mol�K^2))
Definition: ThermoData.hpp:124
ReactionEquation equation
The equation of the reaction as pairs (reactant, stoichiometry)
Definition: ThermoData.hpp:68
std::optional< SpeciesThermoInterpolatedProperties > properties
The interpolated thermodynamic properties of general species.
Definition: ThermoData.hpp:212
double delta_h
The standard enthalpy of the reaction at 25 °C (in units of kJ/mol).
Definition: ThermoData.hpp:196
A type for storing the thermodynamic data of a mineral species.
Definition: ThermoData.hpp:241
double Sr
The standard molal entropy of the species at reference temperature and pressure (in units of cal/(mol...
Definition: ThermoData.hpp:84
double Hf
The apparent standard molal enthalpy of formation of the species from its elements (in units of cal/m...
Definition: ThermoData.hpp:115
std::vector< double > Htr
The change in the standard molal enthalpy of each mineral phase transition (in units of cal/mol)
Definition: ThermoData.hpp:167
double c2
The coefficient c2 of the HKF equation of state of the aqueous species (in units of (cal*K)/mol)
Definition: ThermoData.hpp:102
double Tmax
The maximum temperature at which the HKF equation of state can be applied for the gaseous species (in...
Definition: ThermoData.hpp:130
double Gf
The apparent standard molal Gibbs free energy of formation of the species from its elements (in units...
Definition: ThermoData.hpp:78
BilinearInterpolator volume
The interpolator of the standard molar volume of the species (in units of m3/mol)
Definition: ThermoData.hpp:52
std::vector< double > Ttr
The temperatures at which the mineral experiences phase transition along the line of reference pressu...
Definition: ThermoData.hpp:164
BilinearInterpolator internal_energy
The interpolator of the standard molar internal energy of the species (in units of J/mol)
Definition: ThermoData.hpp:43
A type for storing the parameters of the HKF equation of state for a fluid (gaseous or liquid) specie...
Definition: ThermoData.hpp:110
double Hf
The apparent standard molal enthalpy of formation of the species from its elements (in units of cal/m...
Definition: ThermoData.hpp:143
std::vector< double > c
The coefficients ci of the HKF equation of state of the mineral species for each phase region (in uni...
Definition: ThermoData.hpp:161
A type for storing the thermodynamic data of an aqueous species.
Definition: ThermoData.hpp:224
std::optional< MineralSpeciesThermoParamsHKF > hkf
The thermodynamic parameters of the HKF model for a mineral species.
Definition: ThermoData.hpp:243
std::vector< double > a
The coefficients ai of the HKF equation of state of the mineral species for each phase region (in uni...
Definition: ThermoData.hpp:155
std::optional< ReactionThermoInterpolatedProperties > reaction
The interpolated thermodynamic properties of general species given in terms of reaction.
Definition: ThermoData.hpp:215
Define a type that describes the equation of a reaction.
Definition: ReactionEquation.hpp:36
double Hf
The apparent standard molal enthalpy of formation of the species from its elements (in units of cal/m...
Definition: ThermoData.hpp:81
A type for storing the parameters of the HKF equation of state for a aqueous species.
Definition: ThermoData.hpp:76
A type for storing thermodynamic properties of a reaction over a range of temperatures and pressures.
Definition: ThermoData.hpp:66
BilinearInterpolator enthalpy
The interpolator of the standard molar enthalpy of the species (in units of J/mol)
Definition: ThermoData.hpp:46
double a
The coefficient a of the HKF equation of state of the fluid species (in units of cal/(mol�K))
Definition: ThermoData.hpp:121
std::optional< FluidSpeciesThermoParamsHKF > hkf
The thermodynamic parameters of the HKF model for a fluid (gaseous or liquid) species.
Definition: ThermoData.hpp:233
double Gf
The apparent standard molal Gibbs free energy of formation of the species from its elements (in units...
Definition: ThermoData.hpp:140
double a3
The coefficient a3 of the HKF equation of state of the aqueous species (in units of (cal*K)/(mol*bar)...
Definition: ThermoData.hpp:93
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
std::vector< double > b
The coefficients bi of the HKF equation of state of the mineral species for each phase region (in uni...
Definition: ThermoData.hpp:158
double c
The coefficient c of the HKF equation of state of the fluid species (in units of (cal�K)/mol)
Definition: ThermoData.hpp:127
ReactionEquation equation
The reaction equation defining the Phreeqc species in terms of master species.
Definition: ThermoData.hpp:185
BilinearInterpolator heat_capacity_cp
The interpolator of the standard molar isobaric heat capacity of the species (in units of J/(mol*K))
Definition: ThermoData.hpp:55
std::optional< AqueousSpeciesThermoParamsHKF > hkf
The thermodynamic parameters of the HKF model for an aqueous species.
Definition: ThermoData.hpp:226
double Gf
The apparent standard molal Gibbs free energy of formation of the species from its elements (in units...
Definition: ThermoData.hpp:112
BilinearInterpolator lnk
The interpolator of the equilibrium constant of the reaction.
Definition: ThermoData.hpp:71
std::optional< SpeciesThermoParamsPhreeqc > phreeqc
The thermodynamic parameters of the species from a Phreeqc database.
Definition: ThermoData.hpp:218
double a2
The coefficient a2 of the HKF equation of state of the aqueous species (in units of cal/mol)
Definition: ThermoData.hpp:90
double wref
The conventional Born coefficient of the aqueous species at reference temperature 298....
Definition: ThermoData.hpp:105
double Vr
The standard molal volume of the mineral species at reference temperature and pressure (in units of c...
Definition: ThermoData.hpp:149
A type for storing the thermodynamic data of fluid (gaseous or liquid) species.
Definition: ThermoData.hpp:231
double Tmax
The maximum temperature at which the HKF equation of state can be applied for the mineral (in units o...
Definition: ThermoData.hpp:176
double a4
The coefficient a4 of the HKF equation of state of the aqueous species (in units of (cal*K)/mol)
Definition: ThermoData.hpp:96
int nptrans
The number of phase transitions that the mineral may undergo.
Definition: ThermoData.hpp:152
BilinearInterpolator gibbs_energy
The interpolator of the standard molar Gibbs free energy of the species (in units of J/mol)
Definition: ThermoData.hpp:37
A type for storing thermodynamic properties of a species over a range of temperatures and pressures.
Definition: ThermoData.hpp:35
A type for storing the thermodynamic data of general species.
Definition: ThermoData.hpp:210
double Sr
The standard molal entropy of the species at reference temperature and pressure (in units of cal/(mol...
Definition: ThermoData.hpp:146
std::vector< double > analytic
The coefficients of the analytical expression of the equilibrium constant of the reaction.
Definition: ThermoData.hpp:202
double Sr
The standard molal entropy of the species at reference temperature and pressure (in units of cal/(mol...
Definition: ThermoData.hpp:118
double c1
The coefficient c1 of the HKF equation of state of the aqueous species (in units of cal/(mol*K))
Definition: ThermoData.hpp:99
std::vector< double > Vtr
The change in the standard molal volume of each mineral phase transition (in units of cm^3/mol)
Definition: ThermoData.hpp:170
A type for storing Phreeqc parameters of a species.
Definition: ThermoData.hpp:181
double log_k
The equilibrium constant of the product species at 25 °C.
Definition: ThermoData.hpp:188
std::vector< double > dPdTtr
The Clapeyron slote at each mineral phase transition (in units of bar/K)
Definition: ThermoData.hpp:173
double a1
The coefficient a1 of the HKF equation of state of the aqueous species (in units of cal/(mol*bar))
Definition: ThermoData.hpp:87
BilinearInterpolator helmholtz_energy
The interpolator of the standard molar Helmholtz free energy of the species (in units of J/mol)
Definition: ThermoData.hpp:40
A class used to calculate bilinear interpolation of data in two dimensions.
Definition: BilinearInterpolator.hpp:29
BilinearInterpolator heat_capacity_cv
The interpolator of the standard molar isochoric heat capacity of the species (in units of J/(mol*K)...
Definition: ThermoData.hpp:58
BilinearInterpolator entropy
The interpolator of the standard molar entropy of the species (in units of J/K)
Definition: ThermoData.hpp:49