version 3.8
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
25
26namespace Dumux::Components {
27
34template <class Scalar>
36: public Components::Base<Scalar, SimpleCO2<Scalar> >
37, public Components::Gas<Scalar, SimpleCO2<Scalar> >
38{
40
41public:
45 static std::string name()
46 { return "SimpleCO2"; }
47
51 static constexpr Scalar molarMass()
52 { return 44.0e-3; /* [kg/mol] */ }
53
58 { return 273.15 + 30.95; /* [K] */ }
59
64 { return 73.8e5; /* [Pa] */ }
65
70 { return 273.15 - 56.35; /* [K] */ }
71
76 { return 5.11e5; /* [N/m^2] */ }
77
78
89 {
90 const Scalar t = temperature/1000;
91 constexpr double a = 24.99735;
92 constexpr double b = 55.18696;
93 constexpr double c = -33.69137;
94 constexpr double d = 7.948387;
95 constexpr double e = -0.136638;
96 constexpr double f = -403.6075;
97 constexpr double h = -393.5224;
98 return (a*t + b*t*t/2 + c*t*t*t/3 + d*t*t*t*t/4 - e/t +f -h)*1000/molarMass(); //conversion from kJ/mol to J/kg
99 }
100
114 {
115 // 1/molarMass: conversion from [J/(mol K)] to [J/(kg K)]
116 // R*T/molarMass: pressure *spec. volume for an ideal gas
119 }
120
124 static constexpr bool gasIsCompressible()
125 { return true; }
126
130 static constexpr bool gasViscosityIsConstant()
131 { return false; }
132
141
151
155 static constexpr bool gasIsIdeal()
156 { return true; }
157
166
176 {
177 constexpr double a0 = 0.235156;
178 constexpr double a1 = -0.491266;
179 constexpr double a2 = 5.211155E-2;
180 constexpr double a3 = 5.347906E-2;
181 constexpr double a4 = -1.537102E-2;
182
183 constexpr double d11 = 0.4071119E-2;
184 constexpr double d21 = 0.7198037E-4;
185 constexpr double d64 = 0.2411697E-16;
186 constexpr double d81 = 0.2971072E-22;
187 constexpr double d82 = -0.1627888E-22;
188
189 constexpr double ESP = 251.196;
190
191 if(temperature < 275.0) // regularisation
192 {
193 temperature = 275.0;
194 Dune::dgrave << "Temperature below 275K in viscosity function:"
195 << "Regularizing temperature to 275K. " << std::endl;
196 }
197
198
199 const double TStar = temperature/ESP;
200
201 /* mu0: viscosity in zero-density limit */
202 using std::exp;
203 using std::log;
204 using std::sqrt;
205 const double logTStar = log(TStar);
206 const double SigmaStar = exp(a0 + a1*logTStar
207 + a2*logTStar*logTStar
208 + a3*logTStar*logTStar*logTStar
209 + a4*logTStar*logTStar*logTStar*logTStar );
210 const double mu0 = 1.00697*sqrt(temperature) / SigmaStar;
211
212 /* dmu : excess viscosity at elevated density */
213 const double rho = gasDensity(temperature, pressure); /* CO2 mass density [kg/m^3] */
214
215 using Dune::power;
216 const double dmu = d11*rho + d21*rho*rho + d64*power(rho, 6)/(TStar*TStar*TStar)
217 + d81*power(rho, 8) + d82*power(rho, 8)/TStar;
218
219 return (mu0 + dmu)/1.0E6; /* conversion to [Pa s] */
220 }
221
222
233 {
234 return 0.087;
235 }
236
246 {
247 const Scalar t = temperature/1000;
248 constexpr double a = 24.99735;
249 constexpr double b = 55.18696;
250 constexpr double c = -33.69137;
251 constexpr double d = 7.948387;
252 constexpr double e = -0.136638;
253 return (a + b*t + c*t*t + d*t*t*t + e/(t*t))/molarMass();
254 }
255
256};
257
258} // end namespace Dumux::Components
259
260#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:38
static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of CO2 . source: Shomate Equation for a temperature range of 298....
Definition: simpleco2.hh:245
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: simpleco2.hh:155
static constexpr Scalar molarMass()
The mass in of one mole of CO2.
Definition: simpleco2.hh:51
static Scalar triplePressure()
Returns the pressure at CO2's triple point.
Definition: simpleco2.hh:75
static Scalar criticalPressure()
Returns the critical pressure of CO2.
Definition: simpleco2.hh:63
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of CO2. Equations given in: - Vesovic et al., 1990.
Definition: simpleco2.hh:175
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of CO2 at a given pressure and temperature.
Definition: simpleco2.hh:139
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of CO2 .
Definition: simpleco2.hh:112
static Scalar criticalTemperature()
Returns the critical temperature of CO2.
Definition: simpleco2.hh:57
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of CO2.
Definition: simpleco2.hh:232
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of CO2 in at a given density and temperature.
Definition: simpleco2.hh:164
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of CO2 in at a given pressure and temperature.
Definition: simpleco2.hh:149
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscostiy is constant.
Definition: simpleco2.hh:130
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: simpleco2.hh:124
static Scalar tripleTemperature()
Returns the temperature at CO2's triple point.
Definition: simpleco2.hh:69
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of CO2 . source: Shomate Equation for a temperature range of 298....
Definition: simpleco2.hh:87
static std::string name()
A human readable name for the CO2.
Definition: simpleco2.hh:45
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
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.