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