My Project
Loading...
Searching...
No Matches
N2.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*/
27#ifndef OPM_N2_HPP
28#define OPM_N2_HPP
29
30#include "Component.hpp"
31
34
35#include <cmath>
36#include <string_view>
37
38namespace Opm
39{
40
48template <class Scalar>
49class N2 : public Component<Scalar, N2<Scalar> >
50{
51 typedef ::Opm::IdealGas<Scalar> IdealGas;
52
53public:
57 static std::string_view name()
58 { return "N2"; }
59
63 static Scalar molarMass()
64 { return 28.0134e-3;}
65
69 static Scalar criticalTemperature()
70 { return 126.192; /* [K] */ }
71
75 static Scalar criticalPressure()
76 { return 3.39858e6; /* [N/m^2] */ }
77
81 static Scalar criticalVolume() {return 8.94e-2; }
82
86 static Scalar acentricFactor() { return 0.039; }
87
91 static Scalar tripleTemperature()
92 { return 63.151; /* [K] */ }
93
97 static Scalar triplePressure()
98 { return 12.523e3; /* [N/m^2] */ }
99
114 template <class Evaluation>
115 static Evaluation vaporPressure(const Evaluation& temperature)
116 {
117 if (temperature > criticalTemperature())
118 return criticalPressure();
119 if (temperature < tripleTemperature())
120 return 0; // N2 is solid: We don't take sublimation into
121 // account
122
123 // note: this is the ancillary equation given on page 1368
124 const Evaluation& sigma = 1.0 - temperature/criticalTemperature();
125 const Evaluation& sqrtSigma = sqrt(sigma);
126 const Scalar N1 = -6.12445284;
127 const Scalar N2 = 1.26327220;
128 const Scalar N3 = -0.765910082;
129 const Scalar N4 = -1.77570564;
130 return
132 exp(criticalTemperature()/temperature*
133 (sigma*(N1 +
134 sqrtSigma*N2 +
135 sigma*(sqrtSigma*N3 +
136 sigma*sigma*sigma*N4))));
137 }
138
145 template <class Evaluation>
146 static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
147 {
148 // Assume an ideal gas
149 return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
150 }
151
155 static bool gasIsCompressible()
156 { return true; }
157
161 static bool gasIsIdeal()
162 { return true; }
163
170 template <class Evaluation>
171 static Evaluation gasPressure(const Evaluation& temperature, const Evaluation& density)
172 {
173 // Assume an ideal gas
174 return IdealGas::pressure(temperature, density/molarMass());
175 }
176
186 template <class Evaluation>
187 static Evaluation gasEnthalpy(const Evaluation& temperature,
188 const Evaluation&)
189 {
190 // method of Joback
191 const Scalar cpVapA = 31.15;
192 const Scalar cpVapB = -0.01357;
193 const Scalar cpVapC = 2.680e-5;
194 const Scalar cpVapD = -1.168e-8;
195
196 // calculate: \int_0^T c_p dT
197 return
198 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
199
200 temperature*(cpVapA + temperature*
201 (cpVapB/2 + temperature*
202 (cpVapC/3 + temperature*
203 (cpVapD/4))));
204 }
205
219 template <class Evaluation>
220 static Evaluation gasInternalEnergy(const Evaluation& temperature,
221 const Evaluation& pressure)
222 {
223 return
224 gasEnthalpy(temperature, pressure) -
225 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
226 IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
227 }
228
236 template <class Evaluation>
237 static Evaluation gasHeatCapacity(const Evaluation& temperature,
238 const Evaluation&)
239 {
240 // method of Joback
241 const Scalar cpVapA = 31.15;
242 const Scalar cpVapB = -0.01357;
243 const Scalar cpVapC = 2.680e-5;
244 const Scalar cpVapD = -1.168e-8;
245
246 return
247 1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
248
249 cpVapA + temperature*
250 (cpVapB + temperature*
251 (cpVapC + temperature*
252 (cpVapD)));
253 }
267 template <class Evaluation>
268 static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
269 {
270 const Scalar Tc = criticalTemperature();
271 const Scalar Vc = 90.1; // critical specific volume [cm^3/mol]
272 const Scalar omega = 0.037; // accentric factor
273 const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
274 const Scalar dipole = 0.0; // dipole moment [debye]
275
276 Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
277 mu_r4 *= mu_r4;
278 mu_r4 *= mu_r4;
279
280 Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
281 const Evaluation& Tstar = 1.2593 * temperature/Tc;
282 const Evaluation& Omega_v =
283 1.16145*pow(Tstar, -0.14874) +
284 0.52487*exp(- 0.77320*Tstar) +
285 2.16178*exp(- 2.43787*Tstar);
286 const Evaluation& mu = 40.785*Fc*sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
287
288 // convertion from micro poise to Pa s
289 return mu/1e6 / 10;
290 }
291
303 template <class Evaluation>
304 static Evaluation gasThermalConductivity(const Evaluation& /*temperature*/,
305 const Evaluation& /*pressure*/)
306 { return 0.024572; }
307};
308
309} // namespace Opm
310
311#endif
Abstract base class of a pure chemical species.
Relations valid for an ideal gas.
A traits class which provides basic mathematical functions for arbitrary scalar floating point values...
Abstract base class of a pure chemical species.
Definition Component.hpp:44
Relations valid for an ideal gas.
Definition IdealGas.hpp:38
static const Scalar R
The ideal gas constant .
Definition IdealGas.hpp:41
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
Properties of pure molecular nitrogen .
Definition N2.hpp:50
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of pure molecular nitrogen at a given temperature.
Definition N2.hpp:115
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition N2.hpp:304
static Scalar tripleTemperature()
Returns the temperature at molecular nitrogen's triple point.
Definition N2.hpp:91
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition N2.hpp:155
static Evaluation gasPressure(const Evaluation &temperature, const Evaluation &density)
The pressure of gaseous in at a given density and temperature.
Definition N2.hpp:171
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature.
Definition N2.hpp:146
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of pure nitrogen gas.
Definition N2.hpp:220
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition N2.hpp:161
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition N2.hpp:75
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition N2.hpp:69
static std::string_view name()
A human readable name for nitrogen.
Definition N2.hpp:57
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition N2.hpp:268
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition N2.hpp:81
static Scalar triplePressure()
Returns the pressure at molecular nitrogen's triple point.
Definition N2.hpp:97
static Scalar acentricFactor()
Acentric factor of .
Definition N2.hpp:86
static Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition N2.hpp:63
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &)
Specific isobaric heat capacity of pure nitrogen gas.
Definition N2.hpp:237
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of pure nitrogen gas.
Definition N2.hpp:187
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30