H2O.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "H2O.H"
28 
29 #include "thermodynamicConstants.H"
30 using namespace Foam::constant::thermodynamic;
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(H2O, 0);
37  addToRunTimeSelectionTable(liquidProperties, H2O,);
38  addToRunTimeSelectionTable(liquidProperties, H2O, dictionary);
39 }
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 :
46  (
47  typeName,
48  18.015,
49  647.13,
50  2.2055e+7,
51  0.05595,
52  0.229,
53  273.16,
54  6.113e+2,
55  373.15,
56  6.1709e-30,
57  0.3449,
58  4.7813e+4
59  ),
60  rho_("rho", 98.343885, 0.30542, 647.13, 0.081),
61  pv_("pv", 73.649, -7258.2, -7.3037, 4.1653e-06, 2),
62  hl_("hl", 647.13, 2889425.47876769, 0.3199, -0.212, 0.25795, 0),
63  Cp_
64  (
65  "Cp",
66  15341.1046350264,
67  -116.019983347211,
68  0.451013044684985,
69  -0.000783569247849015,
70  5.20127671384957e-07,
71  0
72  ),
73  h_
74  (
75  "h",
76  -17957283.7993676,
77  15341.1046350264,
78  -58.0099916736053,
79  0.150337681561662,
80  -0.000195892311962254,
81  1.04025534276991e-07
82  ),
83  Cpg_
84  (
85  "Cpg",
86  1851.73466555648,
87  1487.53816264224,
88  2609.3,
89  493.366638912018,
90  1167.6
91  ),
92  B_
93  (
94  "B",
95  -0.0012789342214821,
96  1.4909797391063,
97  -1563696.91923397,
98  1.85445462114904e+19,
99  -7.68082153760755e+21
100  ),
101  mu_("mu", -51.964, 3670.6, 5.7331, -5.3495e-29, 10),
102  mug_("mug", 2.6986e-06, 0.498, 1257.7, -19570),
103  kappa_("kappa", -0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0, 0),
104  kappag_("kappag", 6.977e-05, 1.1243, 844.9, -148850),
105  sigma_("sigma", 647.13, 0.18548, 2.717, -3.554, 2.047, 0),
106  D_("D", 15.0, 15.0, 18.015, 28),
107  Hf_(h_.value(Tstd))
108 {}
109 
110 
112 (
113  const liquidProperties& l,
114  const Function1s::NSRDS5& density,
115  const Function1s::NSRDS1& vapourPressure,
116  const Function1s::NSRDS6& heatOfVapourisation,
117  const Function1s::NSRDS0& heatCapacity,
118  const Function1s::NSRDS0& enthalpy,
119  const Function1s::NSRDS7& idealGasHeatCapacity,
120  const Function1s::NSRDS4& secondVirialCoeff,
121  const Function1s::NSRDS1& dynamicViscosity,
122  const Function1s::NSRDS2& vapourDynamicViscosity,
123  const Function1s::NSRDS0& thermalConductivity,
124  const Function1s::NSRDS2& vapourThermalConductivity,
125  const Function1s::NSRDS6& surfaceTension,
126  const Function2s::APIdiffCoef& vapourDiffusivity
127 )
128 :
129  liquidProperties(l),
130  rho_(density),
131  pv_(vapourPressure),
132  hl_(heatOfVapourisation),
133  Cp_(heatCapacity),
134  h_(enthalpy),
135  Cpg_(idealGasHeatCapacity),
136  B_(secondVirialCoeff),
137  mu_(dynamicViscosity),
138  mug_(vapourDynamicViscosity),
139  kappa_(thermalConductivity),
140  kappag_(vapourThermalConductivity),
141  sigma_(surfaceTension),
142  D_(vapourDiffusivity),
143  Hf_(h_.value(Tstd))
144 {}
145 
146 
148 :
149  H2O()
150 {
151  readIfPresent(*this, dict);
152 }
153 
154 
155 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
156 
157 void Foam::H2O::write(Ostream& os) const
158 {
159  liquidProperties::write(*this, os);
160 }
161 
162 
163 // ************************************************************************* //
dictionary dict
NSRDS function number 100.
Definition: NSRDS0.H:69
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const dimensionedScalar Tstd
Standard temperature.
NSRDS function number 105.
Definition: NSRDS5.H:69
H2O()
Construct null.
Definition: H2O.C:43
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
water
Definition: H2O.H:57
Thermodynamic scalar constants.
void write(Ostream &os) const
Write the function coefficients.
Definition: H2O.C:157
Macros for easy insertion into run-time selection tables.
virtual scalar value(scalar T) const
Evaluate the function and return the result.
Definition: NSRDS0.H:116
const scalar & Tstd
Standard temperature (default in [K])
NSRDS function number 104.
Definition: NSRDS4.H:69
NSRDS function number 102.
Definition: NSRDS2.H:69
The thermophysical properties of a liquid.
friend class liquidProperties
Definition: H2O.H:83
NSRDS-AICHE function number 107.
Definition: NSRDS7.H:69
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
NSRDS function number 101.
Definition: NSRDS1.H:69
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
NSRDS function number 106.
Definition: NSRDS6.H:69
virtual void write(Ostream &os) const =0
Write the function coefficients.
Namespace for OpenFOAM.