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 
36 
37 #include <cmath>
38 
39 namespace Opm
40 {
41 
49 template <class Scalar>
50 class N2 : public Component<Scalar, N2<Scalar> >
51 {
52  typedef ::Opm::IdealGas<Scalar> IdealGas;
53 
54 public:
58  static const char* name()
59  { return "N2"; }
60 
64  static Scalar molarMass()
65  { return 28.0134e-3;}
66 
70  static Scalar criticalTemperature()
71  { return 126.192; /* [K] */ }
72 
76  static Scalar criticalPressure()
77  { return 3.39858e6; /* [N/m^2] */ }
78 
82  static Scalar tripleTemperature()
83  { return 63.151; /* [K] */ }
84 
88  static Scalar triplePressure()
89  { return 12.523e3; /* [N/m^2] */ }
90 
105  template <class Evaluation>
106  static Evaluation vaporPressure(const Evaluation& temperature)
107  {
108  if (temperature > criticalTemperature())
109  return criticalPressure();
110  if (temperature < tripleTemperature())
111  return 0; // N2 is solid: We don't take sublimation into
112  // account
113 
114  // note: this is the ancillary equation given on page 1368
115  const Evaluation& sigma = 1.0 - temperature/criticalTemperature();
116  const Evaluation& sqrtSigma = sqrt(sigma);
117  const Scalar N1 = -6.12445284;
118  const Scalar N2 = 1.26327220;
119  const Scalar N3 = -0.765910082;
120  const Scalar N4 = -1.77570564;
121  return
122  criticalPressure() *
123  exp(criticalTemperature()/temperature*
124  (sigma*(N1 +
125  sqrtSigma*N2 +
126  sigma*(sqrtSigma*N3 +
127  sigma*sigma*sigma*N4))));
128  }
129 
136  template <class Evaluation>
137  static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
138  {
139  // Assume an ideal gas
140  return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
141  }
142 
146  static bool gasIsCompressible()
147  { return true; }
148 
152  static bool gasIsIdeal()
153  { return true; }
154 
161  template <class Evaluation>
162  static Evaluation gasPressure(const Evaluation& temperature, const Evaluation& density)
163  {
164  // Assume an ideal gas
165  return IdealGas::pressure(temperature, density/molarMass());
166  }
167 
177  template <class Evaluation>
178  static Evaluation gasEnthalpy(const Evaluation& temperature,
179  const Evaluation&)
180  {
181  // method of Joback
182  const Scalar cpVapA = 31.15;
183  const Scalar cpVapB = -0.01357;
184  const Scalar cpVapC = 2.680e-5;
185  const Scalar cpVapD = -1.168e-8;
186 
187  // calculate: \int_0^T c_p dT
188  return
189  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
190 
191  temperature*(cpVapA + temperature*
192  (cpVapB/2 + temperature*
193  (cpVapC/3 + temperature*
194  (cpVapD/4))));
195  }
196 
210  template <class Evaluation>
211  static Evaluation gasInternalEnergy(const Evaluation& temperature,
212  const Evaluation& pressure)
213  {
214  return
215  gasEnthalpy(temperature, pressure) -
216  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
217  IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
218  }
219 
227  template <class Evaluation>
228  static Evaluation gasHeatCapacity(const Evaluation& temperature,
229  const Evaluation&)
230  {
231  // method of Joback
232  const Scalar cpVapA = 31.15;
233  const Scalar cpVapB = -0.01357;
234  const Scalar cpVapC = 2.680e-5;
235  const Scalar cpVapD = -1.168e-8;
236 
237  return
238  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
239 
240  cpVapA + temperature*
241  (cpVapB + temperature*
242  (cpVapC + temperature*
243  (cpVapD)));
244  }
258  template <class Evaluation>
259  static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
260  {
261  const Scalar Tc = criticalTemperature();
262  const Scalar Vc = 90.1; // critical specific volume [cm^3/mol]
263  const Scalar omega = 0.037; // accentric factor
264  const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
265  const Scalar dipole = 0.0; // dipole moment [debye]
266 
267  Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
268  mu_r4 *= mu_r4;
269  mu_r4 *= mu_r4;
270 
271  Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
272  const Evaluation& Tstar = 1.2593 * temperature/Tc;
273  const Evaluation& Omega_v =
274  1.16145*pow(Tstar, -0.14874) +
275  0.52487*exp(- 0.77320*Tstar) +
276  2.16178*exp(- 2.43787*Tstar);
277  const Evaluation& mu = 40.785*Fc*sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
278 
279  // convertion from micro poise to Pa s
280  return mu/1e6 / 10;
281  }
282 
294  template <class Evaluation>
295  static Evaluation gasThermalConductivity(const Evaluation& /*temperature*/,
296  const Evaluation& /*pressure*/)
297  { return 0.024572; }
298 };
299 
300 } // namespace Opm
301 
302 #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...
Provides the OPM_UNUSED macro.
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:51
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of pure molecular nitrogen at a given temperature.
Definition: N2.hpp:106
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition: N2.hpp:295
static Scalar tripleTemperature()
Returns the temperature at molecular nitrogen's triple point.
Definition: N2.hpp:82
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: N2.hpp:146
static const char * name()
A human readable name for nitrogen.
Definition: N2.hpp:58
static Evaluation gasPressure(const Evaluation &temperature, const Evaluation &density)
The pressure of gaseous in at a given density and temperature.
Definition: N2.hpp:162
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature.
Definition: N2.hpp:137
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of pure nitrogen gas.
Definition: N2.hpp:211
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: N2.hpp:152
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition: N2.hpp:76
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition: N2.hpp:70
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition: N2.hpp:259
static Scalar triplePressure()
Returns the pressure at molecular nitrogen's triple point.
Definition: N2.hpp:88
static Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition: N2.hpp:64
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &)
Specific isobaric heat capacity of pure nitrogen gas.
Definition: N2.hpp:228
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of pure nitrogen gas.
Definition: N2.hpp:178