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  Copyright (C) 2009-2013 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
28 #ifndef OPM_SIMPLE_CO2_HPP
29 #define OPM_SIMPLE_CO2_HPP
30 
33 
34 #include <cmath>
35 
36 namespace Opm {
37 
45 template <class Scalar>
46 class SimpleCO2 : public Component<Scalar, SimpleCO2<Scalar> >
47 {
49 
50 public:
54  static const char *name()
55  { return "CO2"; }
56 
60  static Scalar molarMass()
61  { return 44e-3; }
62 
67  { return 273.15 + 30.95; /* [K] */ }
68 
73  { return 73.8e5; /* [N/m^2] */ }
74 
79  { return 273.15 - 56.35; /* [K] */ }
80 
85  { return 5.11e5; /* [N/m^2] */ }
86 
90  static bool gasIsCompressible()
91  { return true; }
92 
96  static bool gasIsIdeal()
97  { return true; }
98 
102  template <class Evaluation>
103  static Evaluation gasEnthalpy(const Evaluation& temperature,
104  const Evaluation& /*pressure*/)
105  { return 571.3e3 + (temperature - 298.15)*0.85e3; }
106 
110  template <class Evaluation>
111  static Evaluation liquidEnthalpy(const Evaluation& temperature,
112  const Evaluation& /*pressure*/)
113  { return (temperature - 298.15)*5e3; }
114 
118  template <class Evaluation>
119  static Evaluation gasInternalEnergy(const Evaluation& temperature,
120  const Evaluation& pressure)
121  {
122  return
123  gasEnthalpy(temperature, pressure) -
124  1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
125  IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
126  }
127 
131  template <class Evaluation>
132  static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
133  {
134  // Assume an ideal gas
135  return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
136  }
137 
146  template <class Evaluation>
147  static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
148  {
149  const Scalar Tc = criticalTemperature();
150  const Scalar Vc = 93.9; // critical specific volume [cm^3/mol]
151  const Scalar omega = 0.239; // accentric factor
152  const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
153  const Scalar dipole = 0.0; // dipole moment [debye]
154 
155  Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
156  mu_r4 *= mu_r4;
157  mu_r4 *= mu_r4;
158 
159  Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
160  Scalar Tstar = 1.2593 * temperature/Tc;
161  Scalar Omega_v =
162  1.16145*std::pow(Tstar, -0.14874) +
163  0.52487*std::exp(- 0.77320*Tstar) +
164  2.16178*std::exp(- 2.43787*Tstar);
165  Scalar mu = 40.785*Fc*std::sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
166 
167  // convertion from micro poise to Pa s
168  return mu/1e6 / 10;
169  }
170 };
171 
172 } // namespace Opm
173 
174 #endif
Abstract base class of a pure chemical species.
Definition: Component.hpp:42
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: SimpleCO2.hpp:111
Definition: Air_Mesitylene.hpp:31
Scalar Scalar
Definition: Component.hpp:45
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the pure component in gas.
Definition: SimpleCO2.hpp:119
Evaluation< Scalar, VarSetTag, numVars > sqrt(const Evaluation< Scalar, VarSetTag, numVars > &x)
Definition: Math.hpp:278
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: SimpleCO2.hpp:90
static Scalar criticalPressure()
Returns the critical pressure of .
Definition: SimpleCO2.hpp:72
static Scalar tripleTemperature()
Returns the temperature at the triple point of .
Definition: SimpleCO2.hpp:78
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: SimpleCO2.hpp:96
static Scalar triplePressure()
Returns the pressure at the triple point of .
Definition: SimpleCO2.hpp:84
static Scalar molarMass()
The molar mass in of the component.
Definition: SimpleCO2.hpp:60
Evaluation< Scalar, VarSetTag, numVars > exp(const Evaluation< Scalar, VarSetTag, numVars > &x)
Definition: Math.hpp:295
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: SimpleCO2.hpp:103
static const Scalar R
The ideal gas constant .
Definition: IdealGas.hpp:39
static const char * name()
A human readable name for the component.
Definition: SimpleCO2.hpp:54
Relations valid for an ideal gas.
Relations valid for an ideal gas.
Definition: IdealGas.hpp:35
Abstract base class of a pure chemical species.
Evaluation< Scalar, VarSetTag, numVars > pow(const Evaluation< Scalar, VarSetTag, numVars > &base, Scalar exp)
Definition: Math.hpp:312
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:46
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:132
static Scalar criticalTemperature()
Returns the critical temperature of .
Definition: SimpleCO2.hpp:66
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:147
A simplistic class representing the fluid properties.
Definition: SimpleCO2.hpp:46