My Project
Loading...
Searching...
No Matches
SimpleH2.hpp
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 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
31#ifndef OPM_SIMPLE_H2_HPP
32#define OPM_SIMPLE_H2_HPP
33
36
38
39#include <cmath>
40
41namespace Opm {
42
50template <class Scalar>
51class SimpleH2 : public Component<Scalar, SimpleH2<Scalar> >
52{
54
55public:
59 static std::string name()
60 { return "H2"; }
61
65 static constexpr Scalar molarMass()
66 { return 2.01588e-3; }
67
71 static Scalar criticalTemperature()
72 { return 33.2; /* [K] */ }
73
77 static Scalar criticalPressure()
78 { return 13.0e5; /* [N/m^2] */ }
79
83 static Scalar criticalDensity()
84 { return 15.508e-3; /* [mol/cm^3] */ }
85
89 static Scalar tripleTemperature()
90 { return 14.0; /* [K] */ }
91
95 static Scalar criticalVolume() {return 6.45e-2; }
96
100 static Scalar acentricFactor() { return -0.22; }
101
114 template <class Evaluation>
115 static Evaluation vaporPressure(Evaluation temperature)
116 {
117 if (temperature > criticalTemperature())
118 return criticalPressure();
119 if (temperature < tripleTemperature())
120 return 0; // H2 is solid: We don't take sublimation into
121 // account
122
123 // antoine equation
124 const Scalar A = -7.76451;
125 const Scalar B = 1.45838;
126 const Scalar C = -2.77580;
127
128 return 1e5 * exp(A - B/(temperature + C));
129 }
130
137 template <class Evaluation>
138 static Evaluation gasDensity(Evaluation temperature, Evaluation pressure)
139 {
140 // Assume an ideal gas
141 return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
142 }
143
150 template <class Evaluation>
151 static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure)
152 { return IdealGas::molarDensity(temperature, pressure); }
153
157 static constexpr bool gasIsCompressible()
158 { return true; }
159
163 static constexpr bool gasIsIdeal()
164 { return true; }
165
172 template <class Evaluation>
173 static Evaluation gasPressure(Evaluation temperature, Evaluation density)
174 {
175 // Assume an ideal gas
176 return IdealGas::pressure(temperature, density/molarMass());
177 }
178
182 template <class Evaluation>
183 static Evaluation gasInternalEnergy(const Evaluation& temperature,
184 const Evaluation& pressure)
185 {
186 const Evaluation& h = gasEnthalpy(temperature, pressure);
187 const Evaluation& rho = gasDensity(temperature, pressure);
188
189 return h - (pressure / rho);
190 }
191
205 template <class Evaluation>
206 static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
207 {
208 const Scalar Tc = criticalTemperature();
209 const Scalar Vc = 64.2; // critical specific volume [cm^3/mol]
210 const Scalar omega = -0.217; // accentric factor
211 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
212 const Scalar dipole = 0.0; // dipole moment [debye]
213
214 Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
215 mu_r4 *= mu_r4;
216 mu_r4 *= mu_r4;
217
218 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
219 const Evaluation& Tstar = 1.2593 * temperature/Tc;
220 const Evaluation& Omega_v =
221 1.16145*pow(Tstar, -0.14874) +
222 0.52487*exp(- 0.77320*Tstar) +
223 2.16178*exp(- 2.43787*Tstar);
224 const Evaluation& mu = 40.785*Fc*sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
225
226 // convertion from micro poise to Pa s
227 return mu/1e6 / 10;
228 }
229
236 template <class Evaluation>
237 static const Evaluation gasEnthalpy(Evaluation temperature,
238 Evaluation pressure)
239 {
240 return gasHeatCapacity(temperature, pressure) * temperature;
241 }
242
254 template <class Evaluation>
255 static const Evaluation gasHeatCapacity(Evaluation T,
256 Evaluation pressure)
257 {
258 // method of Joback
259 const Scalar cpVapA = 27.14;
260 const Scalar cpVapB = 9.273e-3;
261 const Scalar cpVapC = -1.381e-5;
262 const Scalar cpVapD = 7.645e-9;
263
264 return
265 1/molarMass()* // conversion from [J/(mol*K)] to [J/(kg*K)]
266 (cpVapA + T*
267 (cpVapB/2 + T*
268 (cpVapC/3 + T*
269 (cpVapD/4))));
270 }
271};
272
273} // end namespace Opm
274
275#endif
Abstract base class of a pure chemical species.
Relations valid for an ideal gas.
A number of commonly used algebraic functions for the localized OPM automatic differentiation (AD) fr...
Abstract base class of a pure chemical species.
Definition Component.hpp:44
Relations valid for an ideal gas.
Definition IdealGas.hpp:38
static Evaluation pressure(const Evaluation &temperature, const Evaluation &rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition IdealGas.hpp:58
static Evaluation density(const Evaluation &avgMolarMass, const Evaluation &temperature, const Evaluation &pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition IdealGas.hpp:48
static Evaluation molarDensity(const Evaluation &temperature, const Evaluation &pressure)
The molar density of the gas , depending on pressure and temperature.
Definition IdealGas.hpp:67
Properties of pure molecular hydrogen .
Definition SimpleH2.hpp:52
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of H2 [J/kg].
Definition SimpleH2.hpp:183
static const Evaluation gasEnthalpy(Evaluation temperature, Evaluation pressure)
Specific enthalpy of pure hydrogen gas.
Definition SimpleH2.hpp:237
static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure)
The molar density of in , depending on pressure and temperature.
Definition SimpleH2.hpp:151
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition SimpleH2.hpp:206
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition SimpleH2.hpp:163
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure)
The density of at a given pressure and temperature.
Definition SimpleH2.hpp:138
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition SimpleH2.hpp:65
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition SimpleH2.hpp:95
static std::string name()
A human readable name for the .
Definition SimpleH2.hpp:59
static Scalar acentricFactor()
Acentric factor of .
Definition SimpleH2.hpp:100
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition SimpleH2.hpp:157
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition SimpleH2.hpp:77
static const Evaluation gasHeatCapacity(Evaluation T, Evaluation pressure)
Specific isobaric heat capacity of pure hydrogen gas.
Definition SimpleH2.hpp:255
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition SimpleH2.hpp:115
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition SimpleH2.hpp:89
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition SimpleH2.hpp:71
static Scalar criticalDensity()
Returns the critical density of molecular hydrogen.
Definition SimpleH2.hpp:83
static Evaluation gasPressure(Evaluation temperature, Evaluation density)
The pressure of gaseous in at a given density and temperature.
Definition SimpleH2.hpp:173
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30