Loading...
Searching...
No Matches
SimpleCO2.hpp
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef OPM_SIMPLE_CO2_HPP
#define OPM_SIMPLE_CO2_HPP
#include <opm/material/IdealGas.hpp>
#include <opm/material/components/Component.hpp>
#include <cmath>
#include <string_view>
namespace Opm {
template <class Scalar>
class SimpleCO2 : public Component<Scalar, SimpleCO2<Scalar> >
{
typedef ::Opm::IdealGas<Scalar> IdealGas;
public:
static std::string_view name()
{ return "CO2"; }
static Scalar molarMass()
{ return 44e-3; }
static Scalar criticalTemperature()
{ return 273.15 + 30.95; /* [K] */ }
static Scalar criticalPressure()
{ return 73.8e5; /* [N/m^2] */ }
static Scalar tripleTemperature()
{ return 273.15 - 56.35; /* [K] */ }
static Scalar acentricFactor() { return 0.224; }
// Critical volume [m3/kmol]
static Scalar criticalVolume() {return 9.412e-2; }
static Scalar triplePressure()
{ return 5.11e5; /* [N/m^2] */ }
static bool gasIsCompressible()
{ return true; }
static bool gasIsIdeal()
{ return true; }
template <class Evaluation>
static Evaluation gasEnthalpy(const Evaluation& temperature,
const Evaluation&)
{ return 350.0e3 + temperature*0.85e3; }
template <class Evaluation>
static Evaluation gasHeatCapacity(const Evaluation&,
const Evaluation&)
{ return 0.85e3; }
template <class Evaluation>
static Evaluation liquidEnthalpy(const Evaluation& temperature,
const Evaluation&)
{ return temperature*2e3; }
template <class Evaluation>
static Evaluation liquidHeatCapacity(const Evaluation&,
const Evaluation&)
{ return 2e3; /* TODO: UNKNOWN! */ }
template <class Evaluation>
static Evaluation gasInternalEnergy(const Evaluation& temperature,
const Evaluation& pressure)
{
return
gasEnthalpy(temperature, pressure) -
1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
}
template <class Evaluation>
static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
{
// Assume an ideal gas
return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
}
template <class Evaluation>
static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
{
const Scalar Tc = criticalTemperature();
const Scalar Vc = 93.9; // critical specific volume [cm^3/mol]
const Scalar omega = 0.239; // accentric factor
const Scalar M = molarMass() * 1e3; // molar mas [g/mol]
const Scalar dipole = 0.0; // dipole moment [debye]
Scalar mu_r4 = 131.3 * dipole / std::sqrt(Vc * Tc);
mu_r4 *= mu_r4;
mu_r4 *= mu_r4;
Scalar Fc = 1 - 0.2756*omega + 0.059035*mu_r4;
Evaluation Tstar = 1.2593 * temperature/Tc;
Evaluation Omega_v =
1.16145*pow(Tstar, -0.14874) +
0.52487*exp(- 0.77320*Tstar) +
2.16178*exp(- 2.43787*Tstar);
Evaluation mu = 40.785*Fc*sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
};
} // namespace Opm
#endif
Component.hpp
Abstract base class of a pure chemical species.
IdealGas.hpp
Relations valid for an ideal gas.
Opm::Component
Abstract base class of a pure chemical species.
Definition Component.hpp:44
Opm::IdealGas::density
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
Opm::IdealGas::R
static constexpr Scalar R
The ideal gas constant .
Definition IdealGas.hpp:42
Opm::SimpleCO2
A simplistic class representing the fluid properties.
Definition SimpleCO2.hpp:50
Opm::SimpleCO2::criticalVolume
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition SimpleCO2.hpp:93
Opm::SimpleCO2::liquidHeatCapacity
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition SimpleCO2.hpp:141
Opm::SimpleCO2::gasHeatCapacity
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition SimpleCO2.hpp:125
Opm::SimpleCO2::criticalTemperature
static Scalar criticalTemperature()
Returns the critical temperature of .
Definition SimpleCO2.hpp:69
Opm::SimpleCO2::triplePressure
static Scalar triplePressure()
Returns the pressure at the triple point of .
Definition SimpleCO2.hpp:98
Opm::SimpleCO2::acentricFactor
static Scalar acentricFactor()
Acentric factor of .
Definition SimpleCO2.hpp:87
Opm::SimpleCO2::liquidEnthalpy
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition SimpleCO2.hpp:133
Opm::SimpleCO2::gasIsCompressible
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition SimpleCO2.hpp:104
Opm::SimpleCO2::gasIsIdeal
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition SimpleCO2.hpp:110
Opm::SimpleCO2::tripleTemperature
static Scalar tripleTemperature()
Returns the temperature at the triple point of .
Definition SimpleCO2.hpp:81
Opm::SimpleCO2::criticalPressure
static Scalar criticalPressure()
Returns the critical pressure of .
Definition SimpleCO2.hpp:75
Opm::SimpleCO2::gasViscosity
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
Opm::SimpleCO2::gasEnthalpy
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition SimpleCO2.hpp:117
Opm::SimpleCO2::gasInternalEnergy
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the pure component in gas.
Definition SimpleCO2.hpp:149
Opm::SimpleCO2::gasDensity
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
Opm::SimpleCO2::name
static std::string_view name()
A human readable name for the component.
Definition SimpleCO2.hpp:57
Opm::SimpleCO2::molarMass
static Scalar molarMass()
The molar mass in of the component.
Definition SimpleCO2.hpp:63
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30