All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
32 
33 #include "Component.hpp"
34 
35 #include <cmath>
36 
37 namespace Opm
38 {
39 
47 template <class Scalar>
48 class N2 : public Component<Scalar, N2<Scalar> >
49 {
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 tripleTemperature()
81  { return 63.151; /* [K] */ }
82 
86  static Scalar triplePressure()
87  { return 12.523e3; /* [N/m^2] */ }
88 
103  template <class Evaluation>
104  static Evaluation vaporPressure(const Evaluation& temperature)
105  {
106  if (temperature > criticalTemperature())
107  return criticalPressure();
108  if (temperature < tripleTemperature())
109  return 0; // N2 is solid: We don't take sublimation into
110  // account
111 
112  // note: this is the ancillary equation given on page 1368
113  const Evaluation& sigma = 1.0 - temperature/criticalTemperature();
114  const Evaluation& sqrtSigma = Opm::sqrt(sigma);
115  const Scalar N1 = -6.12445284;
116  const Scalar N2 = 1.26327220;
117  const Scalar N3 = -0.765910082;
118  const Scalar N4 = -1.77570564;
119  return
120  criticalPressure() *
121  Opm::exp(criticalTemperature()/temperature*
122  (sigma*(N1 +
123  sqrtSigma*N2 +
124  sigma*(sqrtSigma*N3 +
125  sigma*sigma*sigma*N4))));
126  }
127 
134  template <class Evaluation>
135  static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
136  {
137  // Assume an ideal gas
138  return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
139  }
140 
144  static bool gasIsCompressible()
145  { return true; }
146 
150  static bool gasIsIdeal()
151  { return true; }
152 
159  template <class Evaluation>
160  static Evaluation gasPressure(const Evaluation& temperature, const Evaluation& density)
161  {
162  // Assume an ideal gas
163  return IdealGas::pressure(temperature, density/molarMass());
164  }
165 
175  template <class Evaluation>
176  static Evaluation gasEnthalpy(const Evaluation& temperature,
177  const Evaluation& /*pressure*/)
178  {
179  // method of Joback
180  const Scalar cpVapA = 31.15;
181  const Scalar cpVapB = -0.01357;
182  const Scalar cpVapC = 2.680e-5;
183  const Scalar cpVapD = -1.168e-8;
184 
185  // calculate: \int_0^T c_p dT
186  return
187  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
188 
189  temperature*(cpVapA + temperature*
190  (cpVapB/2 + temperature*
191  (cpVapC/3 + temperature*
192  (cpVapD/4))));
193 
194 //#warning NIST DATA STUPID INTERPOLATION
195 // Scalar T2 = 300.;
196 // Scalar T1 = 285.;
197 // Scalar h2 = 311200.;
198 // Scalar h1 = 295580.;
199 // Scalar h = h1+ (h2-h1) / (T2-T1) * (T-T1);
200 // return h ;
201  }
202 
216  template <class Evaluation>
217  static Evaluation gasInternalEnergy(const Evaluation& temperature,
218  const Evaluation& pressure)
219  {
220  return
221  gasEnthalpy(temperature, pressure) -
222  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
223  IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
224  }
225 
233  template <class Evaluation>
234  static Evaluation gasHeatCapacity(const Evaluation& temperature,
235  const Evaluation& /*pressure*/)
236  {
237  // method of Joback
238  const Scalar cpVapA = 31.15;
239  const Scalar cpVapB = -0.01357;
240  const Scalar cpVapC = 2.680e-5;
241  const Scalar cpVapD = -1.168e-8;
242 
243  return
244  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
245 
246  cpVapA + temperature*
247  (cpVapB + temperature*
248  (cpVapC + temperature*
249  (cpVapD)));
250  }
251 
265  template <class Evaluation>
266  static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
267  {
268  const Scalar Tc = criticalTemperature();
269  const Scalar Vc = 90.1; // critical specific volume [cm^3/mol]
270  const Scalar omega = 0.037; // accentric factor
271  const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
272  const Scalar dipole = 0.0; // dipole moment [debye]
273 
274  Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
275  mu_r4 *= mu_r4;
276  mu_r4 *= mu_r4;
277 
278  Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
279  const Evaluation& Tstar = 1.2593 * temperature/Tc;
280  const Evaluation& Omega_v =
281  1.16145*Opm::pow(Tstar, -0.14874) +
282  0.52487*Opm::exp(- 0.77320*Tstar) +
283  2.16178*Opm::exp(- 2.43787*Tstar);
284  const Evaluation& mu = 40.785*Fc*Opm::sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
285 
286  // convertion from micro poise to Pa s
287  return mu/1e6 / 10;
288  }
289 
301  template <class Evaluation>
302  static Evaluation gasThermalConductivity(const Evaluation& /*temperature*/,
303  const Evaluation& /*pressure*/)
304  { return 0.024572; }
305 };
306 
307 } // namespace Opm
308 
309 #endif
static const char * name()
A human readable name for nitrogen.
Definition: N2.hpp:56
A traits class which provides basic mathematical functions for arbitrary scalar floating point values...
Relations valid for an ideal gas.
Abstract base class of a pure chemical species.
Definition: Component.hpp:43
Properties of pure molecular nitrogen .
Definition: N2.hpp:48
static Evaluation gasPressure(const Evaluation &temperature, const Evaluation &density)
The pressure of gaseous in at a given density and temperature.
Definition: N2.hpp:160
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of pure molecular nitrogen at a given temperature.
Definition: N2.hpp:104
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition: N2.hpp:302
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition: N2.hpp:74
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of pure nitrogen gas.
Definition: N2.hpp:217
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &)
Specific isobaric heat capacity of pure nitrogen gas.
Definition: N2.hpp:234
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature.
Definition: N2.hpp:135
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 gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of pure nitrogen gas.
Definition: N2.hpp:176
static const Scalar R
The ideal gas constant .
Definition: IdealGas.hpp:41
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
Abstract base class of a pure chemical species.
Relations valid for an ideal gas.
Definition: IdealGas.hpp:37
static Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition: N2.hpp:62
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition: N2.hpp:266
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: N2.hpp:144
static Scalar tripleTemperature()
Returns the temperature at molecular nitrogen&#39;s triple point.
Definition: N2.hpp:80
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: N2.hpp:150
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition: N2.hpp:68
static Scalar triplePressure()
Returns the pressure at molecular nitrogen&#39;s triple point.
Definition: N2.hpp:86