version 3.11-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
xylene.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_XYLENE_HH
13#define DUMUX_XYLENE_HH
14
15#include <cmath>
18
22
23namespace Dumux::Components {
24
31template <class Scalar>
32class Xylene
33: public Components::Base<Scalar, Xylene<Scalar> >
34, public Components::Liquid<Scalar, Xylene<Scalar> >
35, public Components::Gas<Scalar, Xylene<Scalar> >
36{
39
40public:
44 static std::string name()
45 { return "xylene"; }
46
50 constexpr static Scalar molarMass()
51 { return 0.106; }
52
56 constexpr static Scalar criticalTemperature()
57 { return 617.1; }
58
62 constexpr static Scalar criticalPressure()
63 { return 35.4e5; }
64
68 constexpr static Scalar boilingTemperature()
69 { return 412.3; }
70
75 {
76 DUNE_THROW(Dune::NotImplemented, "tripleTemperature for xylene");
77 }
78
83 {
84 DUNE_THROW(Dune::NotImplemented, "triplePressure for xylene");
85 }
86
94 {
95 const Scalar A = 7.00909;
96 const Scalar B = 1462.266;
97 const Scalar C = 215.110;
98
99 Scalar T = temperature - 273.15;
100
101 using std::pow;
102 Scalar psat = 1.334*pow(10.0, (A - (B/(T + C)))); // in [mbar]
103 psat *= 100.0; // in [Pa] (0.001*1.E5)
104
105 return psat;
106 }
107
117 {
118 Scalar CH3,C6H5,H;
119 // after Reid et al. : Missenard group contrib. method (s. example 5-8) \cite reid1987 <BR>
120 // Xylene: C9H12 : 3* CH3 ; 1* C6H5 (phenyl-ring) ; -2* H (this was too much!)
121 // linear interpolation between table values [J/(mol K)]
122
123 if(temp < 298.0){ // take care: extrapolation for Temp<273
124 H = 13.4 + 1.2*(temp - 273.0)/25.0; // 13.4 + 1.2 = 14.6 = H(T=298K) i.e. interpolation of table values 273<T<298
125 CH3 = 40.0 + 1.6*(temp - 273.0)/25.0; // 40 + 1.6 = 41.6 = CH3(T=298K)
126 C6H5 = 113.0 + 4.2*(temp - 273.0)/25.0; // 113 + 4.2 = 117.2 = C6H5(T=298K)
127 }
128 else if(temp < 323.0){
129 H = 14.6 + 0.9*(temp - 298.0)/25.0; // i.e. interpolation of table values 298<T<323
130 CH3 = 41.6 + 1.9*(temp - 298.0)/25.0;
131 C6H5 = 117.2 + 6.2*(temp - 298.0)/25.0;
132 }
133 else if(temp < 348.0){
134 H = 15.5 + 1.2*(temp - 323.0)/25.0; // i.e. interpolation of table values 323<T<348
135 CH3 = 43.5 + 2.3*(temp - 323.0)/25.0;
136 C6H5 = 123.4 + 6.3*(temp - 323.0)/25.0;
137 }
138 else {
139 H = 16.7 + 2.1*(temp - 348.0)/25.0; // i.e. interpolation of table values 348<T<373
140 CH3 = 45.8 + 2.5*(temp - 348.0)/25.0; // take care: extrapolation for Temp>373
141 C6H5 = 129.7 + 6.3*(temp - 348.0)/25.0; // most likely leads to underestimation
142 }
143
144 return (C6H5 + 2*CH3 - H)/molarMass();// J/(mol K) -> J/(kg K)
145 }
146
147
155 const Scalar pressure)
156 {
157 // Gauss quadrature rule:
158 // Interval: [0K; temperature (K)]
159 // Gauss-Legendre-Integration with variable transformation:
160 // \int_a^b f(T) dT \approx (b-a)/2 \sum_i=1^n \alpha_i f( (b-a)/2 x_i + (a+b)/2 )
161 // with: n=2, legendre -> x_i = +/- \sqrt(1/3), \apha_i=1
162 // here: a=273.15K, b=actual temperature in Kelvin
163 // \leadsto h(T) = \int_273.15^T c_p(T) dT
164 // \approx 0.5 (T-273.15) * (cp( 0.5(temperature-273.15)sqrt(1/3) ) + cp(0.5(temperature-273.15)(-1)sqrt(1/3))
165
166 // Enthalpy may have arbitrary reference state, but the empirical/fitted heatCapacity function needs Kelvin as input and is
167 // fit over a certain temperature range. This suggests choosing an interval of integration being in the actual fit range.
168 // I.e. choosing T=273.15K as reference point for liquid enthalpy.
169 using std::sqrt;
170 const Scalar sqrt1over3 = sqrt(1./3.);
171 // evaluation points according to Gauss-Legendre integration
172 const Scalar TEval1 = 0.5*(temperature-273.15)* sqrt1over3 + 0.5*(273.15+temperature);
173 // evaluation points according to Gauss-Legendre integration
174 const Scalar TEval2 = 0.5*(temperature-273.15)* (-1)* sqrt1over3 + 0.5*(273.15+temperature);
175
176 const Scalar h_n = 0.5 * (temperature-273.15) * ( liquidHeatCapacity(TEval1, pressure) + liquidHeatCapacity(TEval2, pressure) );
177
178 return h_n;
179 }
180
190 const Scalar pressure)
191 {
192 using std::min;
193 using std::max;
194 temperature = min(temperature, criticalTemperature()); // regularization
195 temperature = max(temperature, 0.0); // regularization
196
197 constexpr Scalar T_crit = criticalTemperature();
199 constexpr Scalar p_crit = criticalPressure();
200
201 // Chen method, eq. 7-11.4 (at boiling)
202 using std::log;
203 const Scalar DH_v_boil = Consts::R * T_crit * Tr1
204 * (3.978 * Tr1 - 3.958 + 1.555*log(p_crit * 1e-5 /*Pa->bar*/ ) )
205 / (1.07 - Tr1); /* [J/mol] */
206
207 /* Variation with temp according to Watson relation eq 7-12.1*/
208 using std::pow;
210 const Scalar n = 0.375;
211 const Scalar DH_vap = DH_v_boil * pow(((1.0 - Tr2)/(1.0 - Tr1)), n);
212
213 return (DH_vap/molarMass()); // we need [J/kg]
214 }
215
226 {
228 }
229
237 {
240 pressure);
241 }
242
251
262 {
263 // saturated molar volume according to Lide, CRC Handbook of
264 // Thermophysical and Thermochemical Data, CRC Press, 1994
265 // valid for 245 < Temp < 600
266 using std::min;
267 using std::max;
268 temp = min(temp, 500.0); // regularization
269 temp = max(temp, 250.0); // regularization
270
271 using std::pow;
272 const Scalar A1 = 0.25919; // from table
273 const Scalar A2 = 0.0014569; // from table
274 const Scalar expo = 1.0 + pow((1.0 - temp/criticalTemperature()), (2.0/7.0));
275 const Scalar V = A2*pow(A1, expo); // liquid molar volume [m^3/mol]
276
277 return 1.0/V; // molar density [mol/m^3]
278 }
279
287 {
289 }
290
294 static constexpr bool gasIsCompressible()
295 { return true; }
296
300 static constexpr bool gasIsIdeal()
301 { return true; }
302
306 static constexpr bool liquidIsCompressible()
307 { return false; }
308
316 {
317 using std::min;
318 using std::max;
319 temp = min(temp, 500.0); // regularization
320 temp = max(temp, 250.0); // regularization
321
322 using std::pow;
323 using std::exp;
324 const Scalar Tr = max(temp/criticalTemperature(), 1e-10);
325 const Scalar Fp0 = 1.0;
326 const Scalar xi = 0.004623;
327 const Scalar eta_xi = Fp0*(0.807*pow(Tr, 0.618)
328 - 0.357*exp(-0.449*Tr)
329 + 0.34*exp(-4.058*Tr)
330 + 0.018);
331 Scalar r = eta_xi/xi; // [1e-6 P]
332 r /= 1.0e7; // [Pa s]
333
334 return r;
335 }
336
344 {
345 using std::min;
346 using std::max;
347 temp = min(temp, 500.0); // regularization
348 temp = max(temp, 250.0); // regularization
349
350 const Scalar A = -3.82;
351 const Scalar B = 1027.0;
352 const Scalar C = -6.38e-4;
353 const Scalar D = 4.52e-7;
354
355 using std::exp;
356 Scalar r = exp(A + B/temp + C*temp + D*temp*temp); // in [cP]
357 r *= 1.0e-3; // in [Pa s]
358
359 return r; // [Pa s]
360 }
361
372 {
373 return 0.13;
374 }
375};
376
377} // end namespace Dumux::Components
378
379#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:46
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:50
Interface for components that have a gas state.
Definition: gas.hh:28
Interface for components that have a liquid state.
Definition: liquid.hh:28
Properties of xylene.
Definition: xylene.hh:36
static Scalar gasViscosity(Scalar temp, Scalar pressure)
The dynamic viscosity of xylene vapor.
Definition: xylene.hh:315
static std::string name()
A human readable name for the xylene.
Definition: xylene.hh:44
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure xylene at a given pressure and temperature .
Definition: xylene.hh:286
static constexpr Scalar criticalPressure()
Returns the critical pressure of xylene.
Definition: xylene.hh:62
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid xylene .
Definition: xylene.hh:154
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar gas density of xylene gas at a given pressure and temperature.
Definition: xylene.hh:249
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: xylene.hh:300
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of pure xylene at a given temperature according to Antoine after Be...
Definition: xylene.hh:93
static Scalar tripleTemperature()
Returns the temperature at xylene's triple point.
Definition: xylene.hh:74
static constexpr Scalar boilingTemperature()
Returns the temperature at xylene's boiling point (1 atm).
Definition: xylene.hh:68
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of xylene.
Definition: xylene.hh:371
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: xylene.hh:306
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of xylene vapor .
Definition: xylene.hh:225
static constexpr Scalar criticalTemperature()
Returns the critical temperature of xylene.
Definition: xylene.hh:56
static Scalar triplePressure()
Returns the pressure at xylene's triple point.
Definition: xylene.hh:82
static Scalar heatVap(Scalar temperature, const Scalar pressure)
Latent heat of vaporization for xylene .
Definition: xylene.hh:189
static Scalar liquidHeatCapacity(Scalar temp, Scalar pressure)
Specific heat cap of liquid xylene .
Definition: xylene.hh:116
static constexpr Scalar molarMass()
The molar mass in of xylene.
Definition: xylene.hh:50
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of xylene gas at a given pressure and temperature.
Definition: xylene.hh:236
static Scalar liquidMolarDensity(Scalar temp, Scalar pressure)
The molar liquid density of pure xylene at a given pressure and temperature .
Definition: xylene.hh:261
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: xylene.hh:294
static Scalar liquidViscosity(Scalar temp, Scalar pressure)
The dynamic viscosity of pure xylene.
Definition: xylene.hh:343
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
static constexpr Scalar R
The ideal gas constant .
Definition: constants.hh:32
Relations valid for an ideal gas.
Definition: idealgas.hh:25
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition: idealgas.hh:37
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:58
Base class for all components Components provide the thermodynamic relations for the liquid,...
A central place for various physical constants occurring in some equations.
Interface for components that have a gas state.
Relations valid for an ideal gas.
Interface for components that have a liquid state.
Definition: air.hh:22
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22