Loading...
Searching...
No Matches
N2.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_N2_HPP
#define OPM_N2_HPP
#include "Component.hpp"
#include <opm/material/IdealGas.hpp>
#include <opm/material/common/MathToolbox.hpp>
#include <cmath>
#include <string_view>
namespace Opm
{
template <class Scalar>
class N2 : public Component<Scalar, N2<Scalar> >
{
typedef ::Opm::IdealGas<Scalar> IdealGas;
public:
static std::string_view name()
{ return "N2"; }
static Scalar molarMass()
{ return 28.0134e-3;}
static Scalar criticalTemperature()
{ return 126.192; /* [K] */ }
static Scalar criticalPressure()
{ return 3.39858e6; /* [N/m^2] */ }
static Scalar criticalVolume() {return 8.94e-2; }
static Scalar acentricFactor() { return 0.039; }
static Scalar tripleTemperature()
{ return 63.151; /* [K] */ }
static Scalar triplePressure()
{ return 12.523e3; /* [N/m^2] */ }
template <class Evaluation>
static Evaluation vaporPressure(const Evaluation& temperature)
{
if (temperature > criticalTemperature())
return criticalPressure();
if (temperature < tripleTemperature())
return 0; // N2 is solid: We don't take sublimation into
// account
// note: this is the ancillary equation given on page 1368
const Evaluation& sigma = 1.0 - temperature/criticalTemperature();
const Evaluation& sqrtSigma = sqrt(sigma);
const Scalar N1 = -6.12445284;
const Scalar N2 = 1.26327220;
const Scalar N3 = -0.765910082;
const Scalar N4 = -1.77570564;
return
criticalPressure() *
exp(criticalTemperature()/temperature*
(sigma*(N1 +
sqrtSigma*N2 +
sigma*(sqrtSigma*N3 +
sigma*sigma*sigma*N4))));
}
template <class Evaluation>
static Evaluation gasDensity(const Evaluation& temperature, const Evaluation& pressure)
{
// Assume an ideal gas
return IdealGas::density(Evaluation(molarMass()), temperature, pressure);
}
static bool gasIsCompressible()
{ return true; }
static bool gasIsIdeal()
{ return true; }
template <class Evaluation>
static Evaluation gasPressure(const Evaluation& temperature, const Evaluation& density)
{
// Assume an ideal gas
return IdealGas::pressure(temperature, density/molarMass());
}
template <class Evaluation>
static Evaluation gasEnthalpy(const Evaluation& temperature,
const Evaluation&)
{
// method of Joback
const Scalar cpVapA = 31.15;
const Scalar cpVapB = -0.01357;
const Scalar cpVapC = 2.680e-5;
const Scalar cpVapD = -1.168e-8;
// calculate: \int_0^T c_p dT
return
1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
temperature*(cpVapA + temperature*
(cpVapB/2 + temperature*
(cpVapC/3 + temperature*
(cpVapD/4))));
}
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 gasHeatCapacity(const Evaluation& temperature,
const Evaluation&)
{
// method of Joback
const Scalar cpVapA = 31.15;
const Scalar cpVapB = -0.01357;
const Scalar cpVapC = 2.680e-5;
const Scalar cpVapD = -1.168e-8;
return
1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)]
cpVapA + temperature*
(cpVapB + temperature*
(cpVapC + temperature*
(cpVapD)));
}
template <class Evaluation>
static Evaluation gasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
{
const Scalar Tc = criticalTemperature();
const Scalar Vc = 90.1; // critical specific volume [cm^3/mol]
const Scalar omega = 0.037; // 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 Evaluation gasThermalConductivity(const Evaluation& /*temperature*/,
const Evaluation& /*pressure*/)
{ return 0.024572; }
};
} // namespace Opm
#endif
Component.hpp
Abstract base class of a pure chemical species.
IdealGas.hpp
Relations valid for an ideal gas.
MathToolbox.hpp
A traits class which provides basic mathematical functions for arbitrary scalar floating point values...
Opm::Component
Abstract base class of a pure chemical species.
Definition Component.hpp:44
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::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::N2
Properties of pure molecular nitrogen .
Definition N2.hpp:50
Opm::N2::vaporPressure
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of pure molecular nitrogen at a given temperature.
Definition N2.hpp:115
Opm::N2::gasThermalConductivity
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition N2.hpp:304
Opm::N2::tripleTemperature
static Scalar tripleTemperature()
Returns the temperature at molecular nitrogen's triple point.
Definition N2.hpp:91
Opm::N2::gasIsCompressible
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition N2.hpp:155
Opm::N2::gasPressure
static Evaluation gasPressure(const Evaluation &temperature, const Evaluation &density)
The pressure of gaseous in at a given density and temperature.
Definition N2.hpp:171
Opm::N2::gasDensity
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature.
Definition N2.hpp:146
Opm::N2::gasInternalEnergy
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of pure nitrogen gas.
Definition N2.hpp:220
Opm::N2::gasIsIdeal
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition N2.hpp:161
Opm::N2::criticalPressure
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition N2.hpp:75
Opm::N2::criticalTemperature
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition N2.hpp:69
Opm::N2::name
static std::string_view name()
A human readable name for nitrogen.
Definition N2.hpp:57
Opm::N2::gasViscosity
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition N2.hpp:268
Opm::N2::criticalVolume
static Scalar criticalVolume()
Critical volume of [m2/kmol].
Definition N2.hpp:81
Opm::N2::triplePressure
static Scalar triplePressure()
Returns the pressure at molecular nitrogen's triple point.
Definition N2.hpp:97
Opm::N2::acentricFactor
static Scalar acentricFactor()
Acentric factor of .
Definition N2.hpp:86
Opm::N2::molarMass
static Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition N2.hpp:63
Opm::N2::gasHeatCapacity
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &)
Specific isobaric heat capacity of pure nitrogen gas.
Definition N2.hpp:237
Opm::N2::gasEnthalpy
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of pure nitrogen gas.
Definition N2.hpp:187
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30