version 3.8
heavyoil.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_HEAVYOIL_HH
13#define DUMUX_HEAVYOIL_HH
14
15#include <algorithm>
16
17#include <dune/common/math.hh>
18
24
25namespace Dumux::Components {
26
33template <class Scalar>
35: public Components::Base<Scalar, HeavyOil<Scalar> >
36, public Components::Liquid<Scalar, HeavyOil<Scalar> >
37, public Components::Gas<Scalar, HeavyOil<Scalar> >
38{
41public:
45 static std::string name()
46 { return "heavyoil"; }
47
51 constexpr static Scalar molarMass()
52 { return .350; }
53
58 { return .400; }
59
64 constexpr static Scalar molecularWeight()
65 { return .350; }
66
70 constexpr static Scalar specificGravity()
71 { return 0.91; }
72
77 {
78 DUNE_THROW(Dune::NotImplemented, "tripleTemperature for heavyoil");
79 }
80
85 {
86 DUNE_THROW(Dune::NotImplemented, "triplePressure for heavyoil");
87 }
88
90 {
91 constexpr Scalar A = 0.83;
92 constexpr Scalar B = 89.9513;
93 constexpr Scalar C = 139.6612;
94 constexpr Scalar D = 3.2033;
95 constexpr Scalar E = 1.0564;
96
97 const Scalar mW = refComponentMolecularWeight() *1000. ; // in [g/mol];
98
99 using std::pow;
100 return A+(B/mW)-(C/pow((mW+D),E));
101 }
102
104 {
105 constexpr Scalar A = -7.4120e-2; //All factors for 1 atm / 101325 pascals [760 mmHg]
106 constexpr Scalar B = -7.5041e-3;
107 constexpr Scalar C = -2.6031;
108 constexpr Scalar D = 9.0180e-2;
109 constexpr Scalar E = -1.0482;
110
111 using std::log;
112 const Scalar deltaSpecificGravity = log(refComponentSpecificGravity()/specificGravity());
113 const Scalar deltaMolecularWeight = log(refComponentMolecularWeight()/molecularWeight());
114
115 using Dune::power;
116 return A*power(deltaSpecificGravity,2) + B*deltaSpecificGravity + C*power(deltaMolecularWeight,2) + D*deltaMolecularWeight
117 + E*deltaSpecificGravity*deltaMolecularWeight;
118 }
119
121 {
122 constexpr Scalar A = -6.1294e-2;
123 constexpr Scalar B = -7.0862e-2;
124 constexpr Scalar C = 6.1976e-1;
125 constexpr Scalar D = -5.7090e-2;
126 constexpr Scalar E = -8.4583e-2;
127
128 using std::log;
129 const Scalar deltaSpecificGravity = log(refComponentSpecificGravity()/specificGravity());
130 const Scalar deltaMolecularWeight = log(refComponentMolecularWeight()/molecularWeight());
131
132 using Dune::power;
133 return A*power(deltaSpecificGravity,2) + B*deltaSpecificGravity + C*power(deltaMolecularWeight,2) + D*deltaMolecularWeight
134 + E*deltaSpecificGravity*deltaMolecularWeight;
135 }
136
138 {
139 constexpr Scalar A = 1.8270e-1;
140 constexpr Scalar B = -2.4864e-1;
141 constexpr Scalar C = 8.3611;
142 constexpr Scalar D = -2.2389e-1;
143 constexpr Scalar E = 2.6984;
144
145 using std::log;
146 const Scalar deltaSpecificGravity = log(refComponentSpecificGravity()/specificGravity());
147 const Scalar deltaMolecularWeight = log(refComponentMolecularWeight()/molecularWeight());
148
149 using Dune::power;
150 return A*power(deltaSpecificGravity,2) + B*deltaSpecificGravity + C*power(deltaMolecularWeight,2) + D*deltaMolecularWeight
151 + E*deltaSpecificGravity*deltaMolecularWeight;
152 }
153
155 {
156 constexpr Scalar A = 477.63; //All factors for 1 atm / 101325 pascals [760 mmHg]
157 constexpr Scalar B = 88.51;
158 constexpr Scalar C = 1007;
159 constexpr Scalar D = 1214.40;
160
161 using std::log;
162 return A*log((1000.*refComponentMolecularWeight() + B)/(1000.*refComponentMolecularWeight()+C)) + D;
163 }
164
166 {
167 constexpr Scalar A = 226.50;
168 constexpr Scalar B = 6.78;
169 constexpr Scalar C = 1.282e6;
170 constexpr Scalar D = 2668;
171
172 using std::log;
173 return A*log((1000.*refComponentMolecularWeight() + B)/(1000.*refComponentMolecularWeight()+C)) + D ;
174 }
175
177 {
178 constexpr Scalar A = 141.20;
179 constexpr Scalar B = 45.66e-2;
180 constexpr Scalar C = 16.59e-3;
181 constexpr Scalar D = 2.19;
182
183 using std::pow;
184 return (A*1000.*molecularWeight())/(pow(B + (C*1000.*molecularWeight()),D)) ;
185 }
186
191 {
192 using Dune::power;
194 }
195
200 {
201 using Dune::power;
203 }
204
209 {
210 using Dune::power;
212 }
213
220 {
221 constexpr Scalar A = 8.25990;
222 constexpr Scalar B = 2830.065;
223 constexpr Scalar C = 42.95101;
224
225 const Scalar T = temperature - 273.15;
226
227 using std::pow;
228 return 100*1.334*pow(10.0, (A - (B/(T + C)))); // in [Pa]
229 }
230
232 {
233 constexpr Scalar A = 8.25990;
234 constexpr Scalar B = 2830.065;
235 constexpr Scalar C = 42.95101;
236
237 const Scalar P = pressure;
238
239 using std::log10;
240 return Scalar ((B/(A-log10(P/100*1.334)))-C);
241 }
242
250 const Scalar pressure)
251 {
252 // Gauss quadrature rule:
253 // Interval: [0K; temperature (K)]
254 // Gauss-Legendre-Integration with variable transformation:
255 // \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 )
256 // with: n=2, legendre -> x_i = +/- \sqrt(1/3), \apha_i=1
257 // here: a=273.15K, b=actual temperature in Kelvin
258 // \leadsto h(T) = \int_273.15^T c_p(T) dT
259 // \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))
260
261 // Enthalpy may have arbitrary reference state, but the empirical/fitted heatCapacity function needs Kelvin as input and is
262 // fit over a certain temperature range. This suggests choosing an interval of integration being in the actual fit range.
263 // I.e. choosing T=273.15K as reference point for liquid enthalpy.
264 using std::sqrt;
265 const Scalar sqrt1over3 = sqrt(1./3.);
266 const Scalar TEval1 = 0.5*(temperature-273.15)* sqrt1over3 + 0.5*(273.15+temperature) ; // evaluation points according to Gauss-Legendre integration
267 const Scalar TEval2 = 0.5*(temperature-273.15)* (-1)* sqrt1over3 + 0.5*(273.15+temperature) ; // evaluation points according to Gauss-Legendre integration
268
269 const Scalar h_n = 0.5 * (temperature-273.15) * ( liquidHeatCapacity(TEval1, pressure) + liquidHeatCapacity(TEval2, pressure) ) ;
270
271 return h_n;
272 }
273
283 const Scalar pressure)
284 {
285 using std::clamp;
286 temperature = clamp(temperature, 0.0, criticalTemperature()); // regularization
287
288 const Scalar T_crit = criticalTemperature();
290 const Scalar p_crit = criticalPressure();
291
292 // Chen method, eq. 7-11.4 (at boiling)
293 using std::log;
294 const Scalar DH_v_boil = Consts::R * T_crit * Tr1
295 * (3.978 * Tr1 - 3.958 + 1.555*log(p_crit * 1e-5 /*Pa->bar*/ ) )
296 / (1.07 - Tr1); /* [J/mol] */
297
298 /* Variation with temp according to Watson relation eq 7-12.1*/
299 using std::pow;
301 const Scalar n = 0.375;
302 const Scalar DH_vap = DH_v_boil * pow(((1.0 - Tr2)/(1.0 - Tr1)), n);
303
304 return (DH_vap/molarMass()); // we need [J/kg]
305 }
306
307
318 {
320 }
321
329 {
331 }
332
341
349 {
350
351 /* according to Lashanizadegan et al (2008) in Chemical Engineering Communications: */
352 /* Simultaneous Heat and Fluid Flow in Porous Media: Case Study: Steam Injection for Tertiary Oil Recovery */
353 constexpr Scalar rhoReference = 906.; // [kg/m^3] at reference pressure and temperature
354 constexpr Scalar compressCoeff = 1.e-8; // just a value without justification
355 constexpr Scalar expansCoeff = 1.e-7; // also just a value
356 return rhoReference * (1. + (pressure - 1.e5)*compressCoeff) * (1. - (temperature - 293.)*expansCoeff);
357 }
358
368
372 static constexpr bool gasIsCompressible()
373 { return true; }
374
378 static constexpr bool gasIsIdeal()
379 { return true; }
380
384 static constexpr bool liquidIsCompressible()
385 { return true; }
386
394 {
395 using std::clamp;
396 temperature = clamp(temperature, 250.0, 500.0); // regularization
397
398 // reduced temperature
400
401 using std::pow;
402 using std::exp;
403 constexpr Scalar Fp0 = 1.0;
404 constexpr Scalar xi = 0.00474;
405 const Scalar eta_xi =
406 Fp0*(0.807*pow(Tr,0.618)
407 - 0.357*exp(-0.449*Tr)
408 + 0.34*exp(-4.058*Tr)
409 + 0.018);
410
411 return eta_xi/xi/1e7; // [Pa s]
412 }
413
423 {
424
425 /* according to Lashanizadegan et al (2008) in Chemical Engineering Communications: */
426 /* Simultaneous Heat and Fluid Flow in Porous Media: Case Study: Steam Injection for Tertiary Oil Recovery */
427
428 //using std::exp;
429 //return 1027919.422*exp(-0.04862*temperature); // [Pa s]
430
431 //according to http://www.ecltechnology.com/subsur/reports/pvt_tgb.pdf [Page 10]
432 const Scalar temperatureFahrenheit = (9/5)*(temperature-273.15)+32;
433 constexpr Scalar API = 9;
434
435 using std::pow;
436 using Dune::power;
437 return ((pow(10,0.10231*power(API,2)-3.9464*API+46.5037))*(pow(temperatureFahrenheit,-0.04542*power(API,2)+1.70405*API-19.18)))*0.001;
438
439 }
450 const Scalar pressure)
451 {
452 return 618.; // J/(kg K)
453 }
454
464 {
465 return 0.127;
466 }
467};
468
469} // end namespace Dumux::Components
470
471#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:47
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:51
Interface for components that have a gas state.
Definition: gas.hh:29
Properties of the component heavyoil.
Definition: heavyoil.hh:38
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure heavyoil.
Definition: heavyoil.hh:422
static constexpr Scalar molarMass()
The molar mass in of heavyoil.
Definition: heavyoil.hh:51
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of.
Definition: heavyoil.hh:219
static constexpr Scalar refComponentMolecularWeight()
The MolecularWeight in of refComponent.
Definition: heavyoil.hh:57
static Scalar perbutationFactorCriticalTemperature()
Definition: heavyoil.hh:120
static Scalar liquidHeatCapacity(const Scalar temperature, const Scalar pressure)
Specific heat cap of liquid heavyoil .
Definition: heavyoil.hh:449
static constexpr Scalar molecularWeight()
The molar mass in of heavyoil.
Definition: heavyoil.hh:64
static Scalar refComponentCriticalPressure()
Definition: heavyoil.hh:176
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: heavyoil.hh:378
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in at a given pressure and temperature.
Definition: heavyoil.hh:366
static Scalar perbutationFactorBoilingTemperature()
Definition: heavyoil.hh:103
static Scalar tripleTemperature()
Returns the temperature at heavyoil's triple point.
Definition: heavyoil.hh:76
static Scalar criticalPressure()
Returns the critical pressure of heavyoil.
Definition: heavyoil.hh:208
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in , depending on pressure and temperature.
Definition: heavyoil.hh:339
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of heavyoil vapor.
Definition: heavyoil.hh:393
static Scalar vaporTemperature(Scalar pressure)
Definition: heavyoil.hh:231
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: heavyoil.hh:372
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of heavy oil.
Definition: heavyoil.hh:463
static constexpr Scalar specificGravity()
The Specific Gravity of heavyoil.
Definition: heavyoil.hh:70
static Scalar criticalTemperature()
Returns the critical temperature of heavyoil.
Definition: heavyoil.hh:199
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The (ideal) gas density of heavyoil vapor at a given temperature and pressure .
Definition: heavyoil.hh:328
static Scalar triplePressure()
Returns the pressure at heavyoil's triple point.
Definition: heavyoil.hh:84
static Scalar refComponentCriticalTemperature()
Definition: heavyoil.hh:165
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: heavyoil.hh:384
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid heavyoil .
Definition: heavyoil.hh:249
static Scalar refComponentBoilingTemperature()
Definition: heavyoil.hh:154
static std::string name()
A human readable name for heavyoil.
Definition: heavyoil.hh:45
static Scalar perbutationFactorCriticalPressure()
Definition: heavyoil.hh:137
static Scalar refComponentSpecificGravity()
Definition: heavyoil.hh:89
static Scalar heatVap(Scalar temperature, const Scalar pressure)
Latent heat of vaporization for heavyoil .
Definition: heavyoil.hh:282
static Scalar boilingTemperature()
Returns the temperature at heavyoil's boiling point (1 atm)
Definition: heavyoil.hh:190
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of heavyoil vapor .
Definition: heavyoil.hh:317
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure heavyoil at a given pressure and temperature .
Definition: heavyoil.hh:348
Interface for components that have a liquid state.
Definition: liquid.hh:29
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:23
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