opm-common
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 
36 #include <cmath>
37 #include <string_view>
38 
39 namespace Opm {
40 
48 template <class Scalar>
49 class SimpleCO2 : public Component<Scalar, SimpleCO2<Scalar> >
50 {
51  typedef ::Opm::IdealGas<Scalar> IdealGas;
52 
53 public:
57  static std::string_view name()
58  { return "CO2"; }
59 
63  static Scalar molarMass()
64  { return 44e-3; }
65 
69  static Scalar criticalTemperature()
70  { return 273.15 + 30.95; /* [K] */ }
71 
75  static Scalar criticalPressure()
76  { return 73.8e5; /* [N/m^2] */ }
77 
81  static Scalar tripleTemperature()
82  { return 273.15 - 56.35; /* [K] */ }
83 
87  static Scalar acentricFactor() { return 0.224; }
88 
92  // Critical volume [m3/kmol]
93  static Scalar criticalVolume() {return 9.412e-2; }
94 
98  static Scalar triplePressure()
99  { return 5.11e5; /* [N/m^2] */ }
100 
104  static bool gasIsCompressible()
105  { return true; }
106 
110  static bool gasIsIdeal()
111  { return true; }
112 
116  template <class Evaluation>
117  static Evaluation gasEnthalpy(const Evaluation& temperature,
118  const Evaluation&)
119  { return 350.0e3 + temperature*0.85e3; }
120 
124  template <class Evaluation>
125  static Evaluation gasHeatCapacity(const Evaluation&,
126  const Evaluation&)
127  { return 0.85e3; }
128 
132  template <class Evaluation>
133  static Evaluation liquidEnthalpy(const Evaluation& temperature,
134  const Evaluation&)
135  { return temperature*2e3; }
136 
140  template <class Evaluation>
141  static Evaluation liquidHeatCapacity(const Evaluation&,
142  const Evaluation&)
143  { return 2e3; /* TODO: UNKNOWN! */ }
144 
148  template <class Evaluation>
149  static Evaluation gasInternalEnergy(const Evaluation& temperature,
150  const Evaluation& pressure)
151  {
152  return
153  gasEnthalpy(temperature, pressure) -
154  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
155  IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
156  }
157 
161  template <class Evaluation>
162  static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
163  {
164  // Assume an ideal gas
165  return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
166  }
167 
176  template <class Evaluation>
177  static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
178  {
179  const Scalar Tc = criticalTemperature();
180  const Scalar Vc = 93.9; // critical specific volume [cm^3/mol]
181  const Scalar omega = 0.239; // accentric factor
182  const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
183  const Scalar dipole = 0.0; // dipole moment [debye]
184 
185  Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
186  mu_r4 *= mu_r4;
187  mu_r4 *= mu_r4;
188 
189  Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
190  Evaluation Tstar = 1.2593 * temperature/Tc;
191  Evaluation Omega_v =
192  1.16145*pow(Tstar, -0.14874) +
193  0.52487*exp(- 0.77320*Tstar) +
194  2.16178*exp(- 2.43787*Tstar);
195  Evaluation mu = 40.785*Fc*sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
196 
197  // convertion from micro poise to Pa s
198  return mu/1e6 / 10;
199  }
200 };
201 
202 } // namespace Opm
203 
204 #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:177
Relations valid for an ideal gas.
Abstract base class of a pure chemical species.
Definition: Component.hpp:43
static Scalar acentricFactor()
Acentric factor of .
Definition: SimpleCO2.hpp:87
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: SimpleCO2.hpp:117
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: SimpleCO2.hpp:133
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: SimpleCO2.hpp:104
static constexpr Scalar R
The ideal gas constant .
Definition: IdealGas.hpp:42
static std::string_view name()
A human readable name for the component.
Definition: SimpleCO2.hpp:57
static Scalar criticalPressure()
Returns the critical pressure of .
Definition: SimpleCO2.hpp:75
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition: SimpleCO2.hpp:125
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: SimpleCO2.hpp:110
static Scalar criticalTemperature()
Returns the critical temperature of .
Definition: SimpleCO2.hpp:69
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the pure component in gas.
Definition: SimpleCO2.hpp:149
Abstract base class of a pure chemical species.
Relations valid for an ideal gas.
Definition: IdealGas.hpp:38
static Scalar molarMass()
The molar mass in of the component.
Definition: SimpleCO2.hpp:63
static Scalar triplePressure()
Returns the pressure at the triple point of .
Definition: SimpleCO2.hpp:98
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: SimpleCO2.hpp:141
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:162
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition: SimpleCO2.hpp:93
static Scalar tripleTemperature()
Returns the temperature at the triple point of .
Definition: SimpleCO2.hpp:81
static OPM_HOST_DEVICE 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:49
A simplistic class representing the fluid properties.
Definition: SimpleCO2.hpp:49