All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SimpleCO2.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 */
30 #ifndef OPM_SIMPLE_CO2_HPP
31 #define OPM_SIMPLE_CO2_HPP
32 
35 
37 
38 #include <cmath>
39 
40 namespace Opm {
41 
49 template <class Scalar>
50 class SimpleCO2 : public Component<Scalar, SimpleCO2<Scalar> >
51 {
53 
54 public:
58  static const char* name()
59  { return "CO2"; }
60 
64  static Scalar molarMass()
65  { return 44e-3; }
66 
70  static Scalar criticalTemperature()
71  { return 273.15 + 30.95; /* [K] */ }
72 
76  static Scalar criticalPressure()
77  { return 73.8e5; /* [N/m^2] */ }
78 
82  static Scalar tripleTemperature()
83  { return 273.15 - 56.35; /* [K] */ }
84 
88  static Scalar triplePressure()
89  { return 5.11e5; /* [N/m^2] */ }
90 
94  static bool gasIsCompressible()
95  { return true; }
96 
100  static bool gasIsIdeal()
101  { return true; }
102 
106  template <class Evaluation>
107  static Evaluation gasEnthalpy(const Evaluation& temperature,
108  const Evaluation& /*pressure*/)
109  { return 571.3e3 + (temperature - 298.15)*0.85e3; }
110 
114  template <class Evaluation>
115  static Evaluation liquidEnthalpy(const Evaluation& temperature,
116  const Evaluation& /*pressure*/)
117  { return (temperature - 298.15)*5e3; }
118 
122  template <class Evaluation>
123  static Evaluation gasInternalEnergy(const Evaluation& temperature,
124  const Evaluation& pressure)
125  {
126  return
127  gasEnthalpy(temperature, pressure) -
128  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
129  IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
130  }
131 
135  template <class Evaluation>
136  static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
137  {
138  // Assume an ideal gas
139  return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
140  }
141 
150  template <class Evaluation>
151  static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
152  {
153  const Scalar Tc = criticalTemperature();
154  const Scalar Vc = 93.9; // critical specific volume [cm^3/mol]
155  const Scalar omega = 0.239; // accentric factor
156  const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
157  const Scalar dipole = 0.0; // dipole moment [debye]
158 
159  Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
160  mu_r4 *= mu_r4;
161  mu_r4 *= mu_r4;
162 
163  Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
164  Evaluation Tstar = 1.2593 * temperature/Tc;
165  Evaluation Omega_v =
166  1.16145*Opm::pow(Tstar, -0.14874) +
167  0.52487*Opm::exp(- 0.77320*Tstar) +
168  2.16178*Opm::exp(- 2.43787*Tstar);
169  Evaluation mu = 40.785*Fc*Opm::sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
170 
171  // convertion from micro poise to Pa s
172  return mu/1e6 / 10;
173  }
174 };
175 
176 } // namespace Opm
177 
178 #endif
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of the pure component at a given pressure in and temperature in ...
Definition: SimpleCO2.hpp:151
Relations valid for an ideal gas.
Abstract base class of a pure chemical species.
Definition: Component.hpp:43
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: SimpleCO2.hpp:107
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: SimpleCO2.hpp:115
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: SimpleCO2.hpp:94
static Scalar criticalPressure()
Returns the critical pressure of .
Definition: SimpleCO2.hpp:76
static const Scalar R
The ideal gas constant .
Definition: IdealGas.hpp:41
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: SimpleCO2.hpp:100
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 Scalar criticalTemperature()
Returns the critical temperature of .
Definition: SimpleCO2.hpp:70
A number of commonly used algebraic functions for the localized OPM automatic differentiation (AD) fr...
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the pure component in gas.
Definition: SimpleCO2.hpp:123
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 the component.
Definition: SimpleCO2.hpp:64
static Scalar triplePressure()
Returns the pressure at the triple point of .
Definition: SimpleCO2.hpp:88
static const char * name()
A human readable name for the component.
Definition: SimpleCO2.hpp:58
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density in of the component at a given pressure in and temperature in .
Definition: SimpleCO2.hpp:136
static Scalar tripleTemperature()
Returns the temperature at the triple point of .
Definition: SimpleCO2.hpp:82
A simplistic class representing the fluid properties.
Definition: SimpleCO2.hpp:50