version 3.10-dev
simpleco2.hh
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_SIMPLE_CO2_HH
14#define DUMUX_SIMPLE_CO2_HH
15
16#include <dune/common/stdstreams.hh>
17
20
21#include <cmath>
22
26
27namespace Dumux::Components {
28
35template <class Scalar>
37: public Components::Base<Scalar, SimpleCO2<Scalar> >
38, public Components::Gas<Scalar, SimpleCO2<Scalar> >
39{
42
43public:
45
49 static std::string name()
50 { return "SimpleCO2"; }
51
55 static constexpr Scalar molarMass()
56 { return 44.0e-3; /* [kg/mol] */ }
57
62 { return 273.15 + 30.95; /* [K] */ }
63
68 { return 73.8e5; /* [Pa] */ }
69
74 { return 273.15 - 56.35; /* [K] */ }
75
80 { return 5.11e5; /* [N/m^2] */ }
81
82
92 {
93 const auto h = shomateMethod.enthalpy(temperature); // KJ/mol
94 return h * 1e3 / molarMass(); // J/kg
95 }
96
110 {
111 // 1/molarMass: conversion from [J/(mol K)] to [J/(kg K)]
112 // R*T/molarMass: pressure *spec. volume for an ideal gas
115 }
116
120 static constexpr bool gasIsCompressible()
121 { return true; }
122
126 static constexpr bool gasViscosityIsConstant()
127 { return false; }
128
137
147
151 static constexpr bool gasIsIdeal()
152 { return true; }
153
162
172 {
173 constexpr double a0 = 0.235156;
174 constexpr double a1 = -0.491266;
175 constexpr double a2 = 5.211155E-2;
176 constexpr double a3 = 5.347906E-2;
177 constexpr double a4 = -1.537102E-2;
178
179 constexpr double d11 = 0.4071119E-2;
180 constexpr double d21 = 0.7198037E-4;
181 constexpr double d64 = 0.2411697E-16;
182 constexpr double d81 = 0.2971072E-22;
183 constexpr double d82 = -0.1627888E-22;
184
185 constexpr double ESP = 251.196;
186
187 if(temperature < 275.0) // regularisation
188 {
189 temperature = 275.0;
190 Dune::dgrave << "Temperature below 275K in viscosity function:"
191 << "Regularizing temperature to 275K. " << std::endl;
192 }
193
194
195 const double TStar = temperature/ESP;
196
197 /* mu0: viscosity in zero-density limit */
198 using std::exp;
199 using std::log;
200 using std::sqrt;
201 const double logTStar = log(TStar);
202 const double SigmaStar = exp(a0 + a1*logTStar
203 + a2*logTStar*logTStar
204 + a3*logTStar*logTStar*logTStar
205 + a4*logTStar*logTStar*logTStar*logTStar );
206 const double mu0 = 1.00697*sqrt(temperature) / SigmaStar;
207
208 /* dmu : excess viscosity at elevated density */
209 const double rho = gasDensity(temperature, pressure); /* CO2 mass density [kg/m^3] */
210
211 using Dune::power;
212 const double dmu = d11*rho + d21*rho*rho + d64*power(rho, 6)/(TStar*TStar*TStar)
213 + d81*power(rho, 8) + d82*power(rho, 8)/TStar;
214
215 return (mu0 + dmu)/1.0E6; /* conversion to [Pa s] */
216 }
217
218
229 {
230 return 0.087;
231 }
232
241 {
242 const auto cp = shomateMethod.heatCapacity(temperature); // J/(mol K)
243 return cp / molarMass(); // J/(kg K)
244 }
245
246};
247
253template <class Scalar>
254const typename SimpleCO2<Scalar>::ShomateMethod SimpleCO2<Scalar>::shomateMethod{
255 /*temperature*/{298.0, 1200.0, 6000.0},
257 {24.99735, 55.18696, -33.69137, 7.948387, -0.136638, -403.6075, 228.2431, -393.5224},
258 {58.16639, 2.720074, -0.492289, 0.038844, -6.447293, -425.9186, 263.6125, -393.5224}
259 }}
260};
261
262
263} // end namespace Dumux::Components
264
265#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:47
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:51
Interface for components that have a gas state.
Definition: gas.hh:29
A simple version of pure CO2.
Definition: simpleco2.hh:39
static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of CO2 . Shomate Equation is used for a temperature range of 298K to ...
Definition: simpleco2.hh:240
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: simpleco2.hh:151
static constexpr Scalar molarMass()
The mass in of one mole of CO2.
Definition: simpleco2.hh:55
static Scalar triplePressure()
Returns the pressure at CO2's triple point.
Definition: simpleco2.hh:79
static Scalar criticalPressure()
Returns the critical pressure of CO2.
Definition: simpleco2.hh:67
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of CO2. Equations given in: - Vesovic et al., 1990.
Definition: simpleco2.hh:171
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of CO2 at a given pressure and temperature.
Definition: simpleco2.hh:135
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of CO2 .
Definition: simpleco2.hh:108
static Scalar criticalTemperature()
Returns the critical temperature of CO2.
Definition: simpleco2.hh:61
static const ShomateMethod shomateMethod
Shomate parameters for carbon dioxide published by NIST https://webbook.nist.gov/cgi/cbook....
Definition: simpleco2.hh:44
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of CO2.
Definition: simpleco2.hh:228
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of CO2 in at a given density and temperature.
Definition: simpleco2.hh:160
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of CO2 in at a given pressure and temperature.
Definition: simpleco2.hh:145
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscostiy is constant.
Definition: simpleco2.hh:126
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: simpleco2.hh:120
static Scalar tripleTemperature()
Returns the temperature at CO2's triple point.
Definition: simpleco2.hh:73
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of CO2 . Shomate Equation is used for a temperature range of 298K to 6000K.
Definition: simpleco2.hh:90
static std::string name()
A human readable name for the CO2.
Definition: simpleco2.hh:49
Relations valid for an ideal gas.
Definition: idealgas.hh:25
static constexpr Scalar pressure(Scalar temperature, Scalar rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition: idealgas.hh:48
static constexpr Scalar R
The ideal gas constant .
Definition: idealgas.hh:28
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition: idealgas.hh:37
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:58
The Shomate method to compute enthalpy and heat capacity.
Definition: shomate.hh:50
Scalar heatCapacity(const Scalar temperature) const
Return heat capacity in J/(mol*K)
Definition: shomate.hh:88
std::conditional_t< intervals==-1, std::vector< CoefficientSet >, std::array< CoefficientSet, std::size_t(intervals)> > Coefficients
Definition: shomate.hh:56
Scalar enthalpy(const Scalar temperature) const
Return enthalpy in kJ/mol.
Definition: shomate.hh:75
Base class for all components Components provide the thermodynamic relations for the liquid,...
Interface for components that have a gas state.
Relations valid for an ideal gas.
Definition: air.hh:23
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Shomate equations for enthalpy and heat capacity.