Loading...
Searching...
No Matches
SimpleH2.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_H2_HPP
#define OPM_SIMPLE_H2_HPP
#include <opm/material/IdealGas.hpp>
#include <opm/material/components/Component.hpp>
#include <opm/material/densead/Math.hpp>
#include <cmath>
namespace Opm {
template <class Scalar>
class SimpleH2 : public Component<Scalar, SimpleH2<Scalar> >
{
using IdealGas = Opm::IdealGas<Scalar>;
public:
static std::string name()
{ return "H2"; }
static constexpr Scalar molarMass()
{ return 2.01588e-3; }
static Scalar criticalTemperature()
{ return 33.2; /* [K] */ }
static Scalar criticalPressure()
{ return 13.0e5; /* [N/m^2] */ }
static Scalar criticalDensity()
{ return 15.508e-3; /* [mol/cm^3] */ }
static Scalar tripleTemperature()
{ return 14.0; /* [K] */ }
static Scalar criticalVolume() {return 6.45e-2; }
static Scalar acentricFactor() { return -0.22; }
template <class Evaluation>
static Evaluation vaporPressure(Evaluation temperature)
{
if (temperature > criticalTemperature())
return criticalPressure();
if (temperature < tripleTemperature())
return 0; // H2 is solid: We don't take sublimation into
// account
// antoine equation
const Scalar A = -7.76451;
const Scalar B = 1.45838;
const Scalar C = -2.77580;
return 1e5 * exp(A - B/(temperature + C));
}
template <class Evaluation>
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure)
{
// Assume an ideal gas
return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
}
template <class Evaluation>
static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure)
{ return IdealGas::molarDensity(temperature, pressure); }
static constexpr bool gasIsCompressible()
{ return true; }
static constexpr bool gasIsIdeal()
{ return true; }
template <class Evaluation>
static Evaluation gasPressure(Evaluation temperature, Evaluation density)
{
// Assume an ideal gas
return IdealGas::pressure(temperature, density/molarMass());
}
template <class Evaluation>
static Evaluation gasInternalEnergy(const Evaluation& temperature,
const Evaluation& pressure)
{
const Evaluation& h = gasEnthalpy(temperature, pressure);
const Evaluation& rho = gasDensity(temperature, pressure);
return h - (pressure / rho);
}
template <class Evaluation>
static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
{
const Scalar Tc = criticalTemperature();
const Scalar Vc = 64.2; // critical specific volume [cm^3/mol]
const Scalar omega = -0.217; // 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;
const Evaluation& Tstar = 1.2593 * temperature/Tc;
const Evaluation& Omega_v =
1.16145*pow(Tstar, -0.14874) +
0.52487*exp(- 0.77320*Tstar) +
2.16178*exp(- 2.43787*Tstar);
const 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;
}
template <class Evaluation>
static const Evaluation gasEnthalpy(Evaluation temperature,
Evaluation pressure)
{
return gasHeatCapacity(temperature, pressure) * temperature;
}
template <class Evaluation>
static const Evaluation gasHeatCapacity(Evaluation T,
Evaluation pressure)
{
// method of Joback
const Scalar cpVapA = 27.14;
const Scalar cpVapB = 9.273e-3;
const Scalar cpVapC = -1.381e-5;
const Scalar cpVapD = 7.645e-9;
return
1/molarMass()* // conversion from [J/(mol*K)] to [J/(kg*K)]
(cpVapA + T*
(cpVapB/2 + T*
(cpVapC/3 + T*
(cpVapD/4))));
}
};
} // end namespace Opm
#endif
Component.hpp
Abstract base class of a pure chemical species.
IdealGas.hpp
Relations valid for an ideal gas.
Math.hpp
A number of commonly used algebraic functions for the localized OPM automatic differentiation (AD) fr...
Opm::Component
Abstract base class of a pure chemical species.
Definition Component.hpp:44
Opm::IdealGas
Relations valid for an ideal gas.
Definition IdealGas.hpp:39
Opm::IdealGas::pressure
static OPM_HOST_DEVICE Evaluation pressure(const Evaluation &temperature, const Evaluation &rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition IdealGas.hpp:59
Opm::IdealGas::molarDensity
static OPM_HOST_DEVICE Evaluation molarDensity(const Evaluation &temperature, const Evaluation &pressure)
The molar density of the gas , depending on pressure and temperature.
Definition IdealGas.hpp:68
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::SimpleH2
Properties of pure molecular hydrogen .
Definition SimpleH2.hpp:52
Opm::SimpleH2::gasInternalEnergy
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of H2 [J/kg].
Definition SimpleH2.hpp:183
Opm::SimpleH2::gasEnthalpy
static const Evaluation gasEnthalpy(Evaluation temperature, Evaluation pressure)
Specific enthalpy of pure hydrogen gas.
Definition SimpleH2.hpp:237
Opm::SimpleH2::gasMolarDensity
static Evaluation gasMolarDensity(Evaluation temperature, Evaluation pressure)
The molar density of in , depending on pressure and temperature.
Definition SimpleH2.hpp:151
Opm::SimpleH2::gasViscosity
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition SimpleH2.hpp:206
Opm::SimpleH2::gasIsIdeal
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition SimpleH2.hpp:163
Opm::SimpleH2::gasDensity
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure)
The density of at a given pressure and temperature.
Definition SimpleH2.hpp:138
Opm::SimpleH2::molarMass
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition SimpleH2.hpp:65
Opm::SimpleH2::criticalVolume
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition SimpleH2.hpp:95
Opm::SimpleH2::name
static std::string name()
A human readable name for the .
Definition SimpleH2.hpp:59
Opm::SimpleH2::acentricFactor
static Scalar acentricFactor()
Acentric factor of .
Definition SimpleH2.hpp:100
Opm::SimpleH2::gasIsCompressible
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition SimpleH2.hpp:157
Opm::SimpleH2::criticalPressure
static Scalar criticalPressure()
Returns the critical pressure of molecular hydrogen.
Definition SimpleH2.hpp:77
Opm::SimpleH2::gasHeatCapacity
static const Evaluation gasHeatCapacity(Evaluation T, Evaluation pressure)
Specific isobaric heat capacity of pure hydrogen gas.
Definition SimpleH2.hpp:255
Opm::SimpleH2::vaporPressure
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure molecular hydrogen at a given temperature.
Definition SimpleH2.hpp:115
Opm::SimpleH2::tripleTemperature
static Scalar tripleTemperature()
Returns the temperature at molecular hydrogen's triple point.
Definition SimpleH2.hpp:89
Opm::SimpleH2::criticalTemperature
static Scalar criticalTemperature()
Returns the critical temperature of molecular hydrogen.
Definition SimpleH2.hpp:71
Opm::SimpleH2::criticalDensity
static Scalar criticalDensity()
Returns the critical density of molecular hydrogen.
Definition SimpleH2.hpp:83
Opm::SimpleH2::gasPressure
static Evaluation gasPressure(Evaluation temperature, Evaluation density)
The pressure of gaseous in at a given density and temperature.
Definition SimpleH2.hpp:173
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30