3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
simpleh2o.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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_SIMPLE_H2O_HH
26#define DUMUX_SIMPLE_H2O_HH
27
30
31#include <cmath>
32
36
37namespace Dumux::Components {
38
45template <class Scalar>
47: public Components::Base<Scalar, SimpleH2O<Scalar> >
48, public Components::Liquid<Scalar, SimpleH2O<Scalar> >
49, public Components::Gas<Scalar, SimpleH2O<Scalar> >
50{
52
53 static const Scalar R; // specific gas constant of water
54
55public:
59 static std::string name()
60 { return "SimpleH2O"; }
61
65 static constexpr Scalar molarMass()
66 { return 18e-3; }
67
72 { return 647.096; /* [K] */ }
73
78 { return 22.064e6; /* [N/m^2] */ }
79
84 { return 273.16; /* [K] */ }
85
90 { return 611.657; /* [N/m^2] */ }
91
105 {
106 if (T > criticalTemperature())
107 return criticalPressure();
108 if (T < tripleTemperature())
109 return 0; // water is solid: We don't take sublimation into account
110
111 constexpr Scalar n[10] = {
112 0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2,
113 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2,
114 -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849,
115 0.65017534844798e3
116 };
117
118 const Scalar sigma = T + n[8]/(T - n[9]);
119
120 const Scalar A = (sigma + n[0])*sigma + n[1];
121 const Scalar B = (n[2]*sigma + n[3])*sigma + n[4];
122 const Scalar C = (n[5]*sigma + n[6])*sigma + n[7];
123
124 using std::sqrt;
125 const Scalar term = 2.0*C/(sqrt(B*B - 4.0*A*C) - B);
126
127 return 1e6*term*term*term*term;
128 }
129
138 {
139 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15);
141 }
142
151 {
152 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15);
155 }
156
161 {
162 constexpr Scalar A = 2500.304;
163 constexpr Scalar B = -2.2521025;
164 constexpr Scalar C = -0.021465847;
165 constexpr Scalar D = 3.1750136e-4 ;
166 constexpr Scalar E = -2.8607959e-5;
167
168 //tRef in °C
169 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15) - 273.15;
170
171 using std::pow;
172 static const Scalar vaporizationEnthalpy = A + B*tRef + C*(pow(tRef,1.5)) + D*(pow(tRef,2.5)) + E*(pow(tRef,3));
174 }
175
176
190 {
191 // 1/molarMass: conversion from [J/(mol K)] to [J/(kg K)]
192 // R*T/molarMass: pressure *spec. volume for an ideal gas
195 }
196
205 {
208 }
209
213 static constexpr bool gasIsCompressible()
214 { return true; }
215
219 static constexpr bool liquidIsCompressible()
220 { return false; }
221
225 static constexpr bool gasViscosityIsConstant()
226 { return true; }
227
231 static constexpr bool liquidViscosityIsConstant()
232 { return true; }
233
241 {
242 // Assume an ideal gas
244 }
245
255
259 static constexpr bool gasIsIdeal()
260 { return true; }
261
269 {
270 // Assume an ideal gas
272 }
273
281 {
282 return 1000.;
283 }
284
294
302 {
303 DUNE_THROW(Dune::InvalidStateException,
304 "The liquid pressure is undefined for incompressible fluids");
305 }
306
314 {
315 return 1e-05;
316 }
317
325 {
326 return 1e-03;
327 }
328
337 {
338 return 4180.0;
339 }
340
349 {
350 return 0.679;
351 }
352
361 {
362 return 0.025;
363 }
364
373 {
374 return 2.08e3;
375 }
376
377};
378
379template <class Scalar>
380struct IsAqueous<SimpleH2O<Scalar>> : public std::true_type {};
381
382template <class Scalar>
384
385} // end namespace Dumux::Components
386
387#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Interface for components that have a gas state.
Interface for components that have a liquid state.
Relations valid for an ideal gas.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Definition: air.hh:35
IsAqueous struct.
Definition: components/base.hh:47
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:59
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:63
Interface for components that have a gas state.
Definition: gas.hh:41
Interface for components that have a liquid state.
Definition: liquid.hh:41
A simple version of pure water.
Definition: simpleh2o.hh:50
static Scalar criticalTemperature()
Returns the critical temperature of water.
Definition: simpleh2o.hh:71
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscostiy is constant.
Definition: simpleh2o.hh:225
static std::string name()
A human readable name for the water.
Definition: simpleh2o.hh:59
static Scalar criticalPressure()
Returns the critical pressure of water.
Definition: simpleh2o.hh:77
static Scalar tripleTemperature()
Returns the temperature at water's triple point.
Definition: simpleh2o.hh:83
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure water in at a given pressure and temperature.
Definition: simpleh2o.hh:292
static constexpr bool liquidViscosityIsConstant()
Returns true if the liquid phase viscostiy is constant.
Definition: simpleh2o.hh:231
static constexpr Scalar molarMass()
The molar mass in of water.
Definition: simpleh2o.hh:65
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: simpleh2o.hh:219
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of steam .
Definition: simpleh2o.hh:188
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of water. source: http://webbook.nist.gov/cgi/fluid.cgi?ID=C7732185&Action=Page...
Definition: simpleh2o.hh:348
static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of water steam . source: http://webbook.nist.gov/cgi/fluid....
Definition: simpleh2o.hh:372
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of liquid water .
Definition: simpleh2o.hh:149
static Scalar liquidPressure(Scalar temperature, Scalar density)
The pressure of water in at a given density and temperature.
Definition: simpleh2o.hh:301
static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the component as a liquid. source: http://webbook....
Definition: simpleh2o.hh:336
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of steam in at a given density and temperature.
Definition: simpleh2o.hh:268
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure water.
Definition: simpleh2o.hh:324
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of water steam .
Definition: simpleh2o.hh:136
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of steam. source: http://webbook.nist.gov/cgi/fluid.cgi?ID=C7732185&Action=Page...
Definition: simpleh2o.hh:360
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of steam in at a given pressure and temperature.
Definition: simpleh2o.hh:253
static Scalar triplePressure()
Returns the pressure at water's triple point.
Definition: simpleh2o.hh:89
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: simpleh2o.hh:213
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure water at a given temperature.
Definition: simpleh2o.hh:104
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam.
Definition: simpleh2o.hh:313
static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of liquid water .
Definition: simpleh2o.hh:203
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure water at a given pressure and temperature .
Definition: simpleh2o.hh:280
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: simpleh2o.hh:259
static Scalar vaporizationEnthalpy()
The vaporization enthalpy in needed to vaporize one kilogram of the liquid water to the gaseous stat...
Definition: simpleh2o.hh:160
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of steam at a given pressure and temperature.
Definition: simpleh2o.hh:240
A central place for various physical constants occuring in some equations.
Definition: constants.hh:39
Relations valid for an ideal gas.
Definition: idealgas.hh:37
static constexpr Scalar pressure(Scalar temperature, Scalar rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition: idealgas.hh:60
static constexpr Scalar R
The ideal gas constant .
Definition: idealgas.hh:40
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:49
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:70
Base class for all components Components provide the thermodynamic relations for the liquid,...