1 #ifndef THERMOPROPERTIES_H
2 #define THERMOPROPERTIES_H
3 
4 // TCorPT includes
5 #include "GlobalVariables.h"
6 #include "Common/ThermoScalar.hpp"
7 
8 namespace ThermoFun {
9 
10 struct ThermoVariables
11 {
12     /// the temperature T (in units of Kelvin)
13     Reaktoro_::Temperature temperature;
14 
15     /// the pressure P (in units of Pascal)
16     Reaktoro_::Pressure pressure;
17 };
18 
19 /// Describe the thermodynamic state of a substance
20 struct ThermoPropertiesSubstance
21 {
22     /// The apparent standard molar Gibbs free energy @f$\Delta G_{f}^{\circ}@f$ of the species (in units of J/mol)
23     Reaktoro_::ThermoScalar gibbs_energy;
24 
25     /// The apparent standard molar Helmholtz free energy @f$\Delta A_{f}^{\circ}@f$ of the species (in units of J/mol)
26     Reaktoro_::ThermoScalar helmholtz_energy;
27 
28     /// The apparent standard molar internal energy @f$\Delta U_{f}^{\circ}@f$ of the species (in units of J/mol)
29     Reaktoro_::ThermoScalar internal_energy;
30 
31     /// The apparent standard molar enthalpy @f$\Delta H_{f}^{\circ}@f$ of the species (in units of J/mol)
32     Reaktoro_::ThermoScalar enthalpy;
33 
34     /// The standard molar entropy @f$ S^{\circ}@f$ of the species (in units of J/(mol*K))
35     Reaktoro_::ThermoScalar entropy;
36 
37     /// The standard molar volume @f$ V^{\circ}@f$ of the species (in units of J/bar)
38     Reaktoro_::ThermoScalar volume;
39 
40     /// The standard molar isobaric heat capacity @f$ C_{P}^{\circ}@f$ of the species (in units of J/(mol*K))
41     Reaktoro_::ThermoScalar heat_capacity_cp;
42 
43     /// The standard molar isochoric heat capacity @f$ C_{V}^{\circ}@f$ of the species (in units of J/(mol*K))
44     Reaktoro_::ThermoScalar heat_capacity_cv;
45 };
46 
47 
48 /// Describes the thermodynamic state of a reaction
49 struct ThermoPropertiesReaction
50 {
51     /// The natural logarithm of the equilibirum constant of the reaction
52     Reaktoro_::ThermoScalar ln_equilibrium_constant;
53 
54     /// The logarithm of the equilibirum constant of the reaction in base 10
55     Reaktoro_::ThermoScalar log_equilibrium_constant;
56 
57     /// The apparent standard molar Gibbs free energy @f$\Delta G_{f}^{\circ}@f$ of the species (in units of J/mol)
58     Reaktoro_::ThermoScalar reaction_gibbs_energy;
59 
60     /// The apparent standard molar Helmholtz free energy @f$\Delta A_{f}^{\circ}@f$ of the species (in units of J/mol)
61     Reaktoro_::ThermoScalar reaction_helmholtz_energy;
62 
63     /// The apparent standard molar internal energy @f$\Delta U_{f}^{\circ}@f$ of the species (in units of J/mol)
64     Reaktoro_::ThermoScalar reaction_internal_energy;
65 
66     /// The apparent standard molar enthalpy @f$\Delta H_{f}^{\circ}@f$ of the species (in units of J/mol)
67     Reaktoro_::ThermoScalar reaction_enthalpy;
68 
69     /// The standard molar entropy @f$ S^{\circ}@f$ of the species (in units of J/(mol*K))
70     Reaktoro_::ThermoScalar reaction_entropy;
71 
72     /// The standard molar volume @f$ V^{\circ}@f$ of the species (in units of J/bar)
73     Reaktoro_::ThermoScalar reaction_volume;
74 
75     /// The standard molar isobaric heat capacity @f$ C_{P}^{\circ}@f$ of the species (in units of J/(mol*K))
76     Reaktoro_::ThermoScalar reaction_heat_capacity_cp;
77 
78     /// The standard molar isochoric heat capacity @f$ C_{V}^{\circ}@f$ of the species (in units of J/(mol*K))
79     Reaktoro_::ThermoScalar reaction_heat_capacity_cv;
80 };
81 
82 /// Describes the thermodynamic properties specific to a solvent
83 struct PropertiesSolvent
84 {
85     /// speed of sound
86     double speed_of_sound,
87 //       Alpha,            /// constant pressure expansion (alpha)
88 //       Beta,             /// constant temperature compressibility (beta)
89     /// dynamic viscosity
90        dynamic_viscosity,
91     /// thermal conductivity
92        thermal_conductivity,
93     /// surface tension
94        surface_tension,
95     /// not clear (currently not used)
96        Tdiff,
97     /// Prandtl number (currently not used)
98        Prndtl,
99     /// kinetic viscosity (currently not used)
100        Visck;
101 //       Albe,             /// alpha/beta ratio
102 //       dAldT;            /// T derivative of isobaric expansion
103     /// constant pressure expansion (alpha) (in units of 1/K)
104     Reaktoro_::ThermoScalar Alpha;
105 
106     /// first order derivative of alpha with T
107     Reaktoro_::ThermoScalar dAldT;
108 
109     /// constant temperature compressibility (beta) (in units of (1/Pa)
110     Reaktoro_::ThermoScalar Beta;
111 
112     /// alpha/beta ratio (in units of K/Pa)
113     Reaktoro_::ThermoScalar Albe;
114 
115 //    /// ideal gas Gibbs energy (in units of J/mol)
116 //    Reaktoro_::ThermoScalar gibbsIdealGas;
117 
118 //    /// ideal gas entropy (in units of J/(mol K))
119 //    Reaktoro_::ThermoScalar entropyIdealGas;
120 
121 //    /// ideal gas isobaric heat capacity (in units of J/(mol*K))
122 //    Reaktoro_::ThermoScalar cpIdealGas;
123 
124     /// The specific density of solvent (in units of kg/m3)
125     Reaktoro_::ThermoScalar density;
126 
127     /// The first-order partial derivative of density with respect to temperature (in units of (kg/m3)/K)
128     Reaktoro_::ThermoScalar densityT;
129 
130     /// The first-order partial derivative of density with respect to pressure (in units of (kg/m3)/Pa)
131     Reaktoro_::ThermoScalar densityP;
132 
133     /// The second-order partial derivative of density with respect to temperature (in units of (kg/m3)/(K*K))
134     Reaktoro_::ThermoScalar densityTT;
135 
136     /// The second-order partial derivative of density with respect to temperature and pressure (in units of (kg/m3)/(K*Pa))
137     Reaktoro_::ThermoScalar densityTP;
138 
139     /// The second-order partial derivative of density with respect to pressure (in units of (kg/m3)/(Pa*Pa))
140     Reaktoro_::ThermoScalar densityPP;
141 
142     /// The pressure of solvent (in units of Pa)
143     Reaktoro_::ThermoScalar pressure;
144 
145     /// The first-order partial derivative of pressure with respect to temperature (in units of Pa/K)
146     Reaktoro_::ThermoScalar pressureT;
147 
148     /// The first-order partial derivative of pressure with respect to density (in units of Pa/(kg/m3))
149     Reaktoro_::ThermoScalar pressureD;
150 
151     /// The second-order partial derivative of pressure with respect to temperature (in units of Pa/(K*K))
152     Reaktoro_::ThermoScalar pressureTT;
153 
154     /// The second-order partial derivative of pressure with respect to temperature and density (in units of Pa/(K*kg/m3))
155     Reaktoro_::ThermoScalar pressureTD;
156 
157     /// The second-order partial derivative of pressure with respect to density (in units of Pa/((kg/m3)*(kg/m3)))
158     Reaktoro_::ThermoScalar pressureDD;
159 
160 };
161 
162 /**
163  * @brief The ElectroPropertiesSolvent struct holds the electro-chemical properties of a solvent
164  */
165 struct ElectroPropertiesSolvent
166 {
167     /// The dielectric constant of water
168     Reaktoro_::ThermoScalar epsilon;
169 
170     /// The first-order partial derivative of the dielectric constant with respect to temperature
171     Reaktoro_::ThermoScalar epsilonT;
172 
173     /// The first-order partial derivative of the dielectric constant with respect to pressure
174     Reaktoro_::ThermoScalar epsilonP;
175 
176     /// The second-order partial derivative of the dielectric constant with respect to temperature
177     Reaktoro_::ThermoScalar epsilonTT;
178 
179     /// The second-order partial derivative of the dielectric constant with respect to temperature and pressure
180     Reaktoro_::ThermoScalar epsilonTP;
181 
182     /// The second-order partial derivative of the dielectric constant with respect to pressure
183     Reaktoro_::ThermoScalar epsilonPP;
184 
185     /// The Born function \f$ Z\equiv-\frac{1}{\epsilon} \f$ (see Helgeson and Kirkham, 1974)
186     Reaktoro_::ThermoScalar bornZ;
187 
188     /// The Born function \f$ Y\equiv\left[\frac{\partial Z}{\partial T}\right]_{P} \f$ in units of 1/K (see Helgeson and Kirkham, 1974)
189     Reaktoro_::ThermoScalar bornY;
190 
191     /// The Born function \f$ Q\equiv\left[\frac{\partial Z}{\partial P}\right]_{T} \f$ in units of 1/Pa (see Helgeson and Kirkham, 1974)
192     Reaktoro_::ThermoScalar bornQ;
193 
194     /// The Born function \f$ N\equiv\left[\frac{\partial Q}{\partial P}\right]_{T} \f$ in units of 1/Pa*Pa (see Helgeson and Kirkham, 1974)
195     Reaktoro_::ThermoScalar bornN;
196 
197     /// The Born function \f$ U\equiv\left[\frac{\partial Q}{\partial T}\right]_{P} \f$ in units of 1/Pa*K (see Helgeson and Kirkham, 1974)
198     Reaktoro_::ThermoScalar bornU;
199 
200     /// The Born function \f$ X\equiv\left[\frac{\partial Y}{\partial T}\right]_{P} \f$ in units of 1/K*K (see Helgeson and Kirkham, 1974)
201     Reaktoro_::ThermoScalar bornX;
202 };
203 
204 /**
205  * @brief The ElectroPropertiesSubstance struct holds the electro-chemical properties of an solute
206  */
207 struct ElectroPropertiesSubstance
208 {
209     /// The effective electrostatic radius of the solute species at referente temperature 298.15 K and pressure 1 bar
210     Reaktoro_::ThermoScalar reref;
211 
212     /// The effective electrostatic radius of the solute species
213     Reaktoro_::ThermoScalar re;
214 
215     /// The Born coefficient of the solute species
216     Reaktoro_::ThermoScalar w;
217 
218     /// The first-order partial derivative of the Born coefficient of the solute species with respect to temperature
219     Reaktoro_::ThermoScalar wT;
220 
221     /// The first-order partial derivative of the Born coefficient of the solute species with respect to pressure
222     Reaktoro_::ThermoScalar wP;
223 
224     /// The second-order partial derivative of the Born coefficient of the solute species with respect to temperature
225     Reaktoro_::ThermoScalar wTT;
226 
227     /// The second-order partial derivative of the Born coefficient of the solute species with respect to temperature and pressure
228     Reaktoro_::ThermoScalar wTP;
229 
230     /// The second-order partial derivative of the Born coefficient of the solute species with respect to pressure
231     Reaktoro_::ThermoScalar wPP;
232 };
233 
234 /// A type used to describe the function g of the HKF model and its partial temperature and pressure derivatives
235 struct FunctionG
236 {
237     /// The function g at temperature T and pressure P
238     Reaktoro_::ThermoScalar g;
239 
240     /// The first-order partial derivative of function g with respect to temperature
241     Reaktoro_::ThermoScalar gT;
242 
243     /// The first-order partial derivative of function g with respect to pressure
244     Reaktoro_::ThermoScalar gP;
245 
246     /// The second-order partial derivative of function g with respect to temperature
247     Reaktoro_::ThermoScalar gTT;
248 
249     /// The second-order partial derivative of function g with respect to temperature and pressure
250     Reaktoro_::ThermoScalar gTP;
251 
252     /// The second-order partial derivative of function g with respect to pressure
253     Reaktoro_::ThermoScalar gPP;
254 };
255 
256 } // namespace ThermoFun
257 
258 #endif // THERMOPROPERTIES_H
259 
260