version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_SIMPLE_H2O_HH
13#define DUMUX_SIMPLE_H2O_HH
14
17
18#include <cmath>
19
23
24namespace Dumux::Components {
25
32template <class Scalar>
34: public Components::Base<Scalar, SimpleH2O<Scalar> >
35, public Components::Liquid<Scalar, SimpleH2O<Scalar> >
36, public Components::Gas<Scalar, SimpleH2O<Scalar> >
37{
39
40public:
44 static std::string name()
45 { return "SimpleH2O"; }
46
50 static constexpr Scalar molarMass()
51 { return 18e-3; }
52
57 { return 647.096; /* [K] */ }
58
63 { return 22.064e6; /* [N/m^2] */ }
64
69 { return 273.16; /* [K] */ }
70
75 { return 611.657; /* [N/m^2] */ }
76
90 {
91 if (T > criticalTemperature())
92 return criticalPressure();
93 if (T < tripleTemperature())
94 return 0; // water is solid: We don't take sublimation into account
95
96 constexpr Scalar n[10] = {
97 0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2,
98 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2,
99 -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849,
100 0.65017534844798e3
101 };
102
103 const Scalar sigma = T + n[8]/(T - n[9]);
104
105 const Scalar A = (sigma + n[0])*sigma + n[1];
106 const Scalar B = (n[2]*sigma + n[3])*sigma + n[4];
107 const Scalar C = (n[5]*sigma + n[6])*sigma + n[7];
108
109 using std::sqrt;
110 const Scalar term = 2.0*C/(sqrt(B*B - 4.0*A*C) - B);
111
112 return 1e6*term*term*term*term;
113 }
114
123 {
124 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15);
126 }
127
136 {
137 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15);
140 }
141
146 {
147 constexpr Scalar A = 2500.304;
148 constexpr Scalar B = -2.2521025;
149 constexpr Scalar C = -0.021465847;
150 constexpr Scalar D = 3.1750136e-4 ;
151 constexpr Scalar E = -2.8607959e-5;
152
153 //tRef in °C
154 static const Scalar tRef = getParam<Scalar>("SimpleH2O.ReferenceTemperature", 293.15) - 273.15;
155
156 using std::pow;
157 static const Scalar vaporizationEnthalpy = A + B*tRef + C*(pow(tRef, 1.5)) + D*(pow(tRef, 2.5)) + E*(pow(tRef, 3));
158 return vaporizationEnthalpy * 1e3; // kJ/kg to J/kg
159 }
160
161
175 {
176 // 1/molarMass: conversion from [J/(mol K)] to [J/(kg K)]
177 // R*T/molarMass: pressure *spec. volume for an ideal gas
180 }
181
190 {
193 }
194
198 static constexpr bool gasIsCompressible()
199 { return true; }
200
204 static constexpr bool liquidIsCompressible()
205 { return false; }
206
210 static constexpr bool gasViscosityIsConstant()
211 { return true; }
212
216 static constexpr bool liquidViscosityIsConstant()
217 { return true; }
218
226 {
227 // Assume an ideal gas
229 }
230
240
244 static constexpr bool gasIsIdeal()
245 { return true; }
246
254 {
255 // Assume an ideal gas
257 }
258
266 {
267 return 1000.0;
268 }
269
279
287 {
288 DUNE_THROW(Dune::InvalidStateException,
289 "The liquid pressure is undefined for incompressible fluids");
290 }
291
299 {
300 return 1e-05;
301 }
302
310 {
311 return 1e-03;
312 }
313
322 {
323 return 4180.0;
324 }
325
334 {
335 return 0.679;
336 }
337
346 {
347 return 0.025;
348 }
349
358 {
359 return 2.08e3;
360 }
361
362};
363
364template <class Scalar>
365struct IsAqueous<SimpleH2O<Scalar>> : public std::true_type {};
366
367} // end namespace Dumux::Components
368
369#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
Interface for components that have a liquid state.
Definition: liquid.hh:29
A simple implementation of pure water.
Definition: simpleh2o.hh:37
static Scalar criticalTemperature()
Returns the critical temperature of water.
Definition: simpleh2o.hh:56
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscosity is constant.
Definition: simpleh2o.hh:210
static std::string name()
A human readable name for the water.
Definition: simpleh2o.hh:44
static Scalar criticalPressure()
Returns the critical pressure of water.
Definition: simpleh2o.hh:62
static Scalar tripleTemperature()
Returns the temperature at water's triple point.
Definition: simpleh2o.hh:68
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure water in at a given pressure and temperature.
Definition: simpleh2o.hh:277
static constexpr bool liquidViscosityIsConstant()
Returns true if the liquid phase viscosity is constant.
Definition: simpleh2o.hh:216
static constexpr Scalar molarMass()
The molar mass in of water.
Definition: simpleh2o.hh:50
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: simpleh2o.hh:204
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of steam .
Definition: simpleh2o.hh:173
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:333
static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of water steam . source: http://webbook.nist.gov/cgi/fluid....
Definition: simpleh2o.hh:357
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of liquid water .
Definition: simpleh2o.hh:134
static Scalar liquidPressure(Scalar temperature, Scalar density)
The pressure of water in at a given density and temperature.
Definition: simpleh2o.hh:286
static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the component as a liquid. source: http://webbook....
Definition: simpleh2o.hh:321
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of steam in at a given density and temperature.
Definition: simpleh2o.hh:253
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure water.
Definition: simpleh2o.hh:309
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of water steam .
Definition: simpleh2o.hh:121
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:345
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of steam in at a given pressure and temperature.
Definition: simpleh2o.hh:238
static Scalar triplePressure()
Returns the pressure at water's triple point.
Definition: simpleh2o.hh:74
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: simpleh2o.hh:198
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure water at a given temperature.
Definition: simpleh2o.hh:89
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam.
Definition: simpleh2o.hh:298
static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of liquid water .
Definition: simpleh2o.hh:188
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure water at a given pressure and temperature .
Definition: simpleh2o.hh:265
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: simpleh2o.hh:244
static Scalar vaporizationEnthalpy()
The vaporization enthalpy in needed to vaporize one kilogram of the liquid water to the gaseous stat...
Definition: simpleh2o.hh:145
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of steam at a given pressure and temperature.
Definition: simpleh2o.hh:225
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.
Interface for components that have a liquid state.
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.
IsAqueous struct.
Definition: components/base.hh:35