H2O.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 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 Class
25  Foam::H2O
26 
27 Description
28  water
29 
30 SourceFiles
31  H2O.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef H2O_H
36 #define H2O_H
37 
38 #include "liquidProperties.H"
39 #include "NSRDSfunc0.H"
40 #include "NSRDSfunc1.H"
41 #include "NSRDSfunc2.H"
42 #include "NSRDSfunc3.H"
43 #include "NSRDSfunc4.H"
44 #include "NSRDSfunc5.H"
45 #include "NSRDSfunc6.H"
46 #include "NSRDSfunc7.H"
47 #include "APIdiffCoefFunc.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class H2O Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class H2O
59 :
60  public liquidProperties
61 {
62  // Private data
63 
64  NSRDSfunc5 rho_;
65  NSRDSfunc1 pv_;
66  NSRDSfunc6 hl_;
67  NSRDSfunc0 Cp_;
68  NSRDSfunc0 h_;
69  NSRDSfunc7 Cpg_;
70  NSRDSfunc4 B_;
71  NSRDSfunc1 mu_;
72  NSRDSfunc2 mug_;
73  NSRDSfunc0 K_;
74  NSRDSfunc2 Kg_;
75  NSRDSfunc6 sigma_;
76  APIdiffCoefFunc D_;
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("H2O");
83 
84 
85  // Constructors
86 
87  //- Construct null
88  H2O();
89 
90  //- Construct from components
91  H2O
92  (
93  const liquidProperties& l,
94  const NSRDSfunc5& density,
95  const NSRDSfunc1& vapourPressure,
96  const NSRDSfunc6& heatOfVapourisation,
97  const NSRDSfunc0& heatCapacity,
98  const NSRDSfunc0& enthalpy,
99  const NSRDSfunc7& idealGasHeatCapacity,
100  const NSRDSfunc4& secondVirialCoeff,
101  const NSRDSfunc1& dynamicViscosity,
102  const NSRDSfunc2& vapourDynamicViscosity,
103  const NSRDSfunc0& thermalConductivity,
104  const NSRDSfunc2& vapourThermalConductivity,
105  const NSRDSfunc6& surfaceTension,
106  const APIdiffCoefFunc& vapourDiffussivity
107  );
108 
109  //- Construct from Istream
110  H2O(Istream& is);
111 
112  //- Construct from dictionary
113  H2O(const dictionary& dict);
114 
115  //- Construct copy
116  H2O(const H2O& liq);
117 
118  //- Construct and return clone
119  virtual autoPtr<liquidProperties> clone() const
120  {
121  return autoPtr<liquidProperties>(new H2O(*this));
122  }
123 
124 
125  // Member Functions
126 
127  //- Liquid density [kg/m^3]
128  inline scalar rho(scalar p, scalar T) const;
129 
130  //- Vapour pressure [Pa]
131  inline scalar pv(scalar p, scalar T) const;
132 
133  //- Heat of vapourisation [J/kg]
134  inline scalar hl(scalar p, scalar T) const;
135 
136  //- Liquid heat capacity [J/(kg K)]
137  inline scalar Cp(scalar p, scalar T) const;
138 
139  //- Liquid Enthalpy [J/(kg)]
140  inline scalar h(scalar p, scalar T) const;
141 
142  //- Ideal gas heat capacity [J/(kg K)]
143  inline scalar Cpg(scalar p, scalar T) const;
144 
145  //- Second Virial Coefficient [m^3/kg]
146  inline scalar B(scalar p, scalar T) const;
147 
148  //- Liquid viscosity [Pa s]
149  inline scalar mu(scalar p, scalar T) const;
150 
151  //- Vapour viscosity [Pa s]
152  inline scalar mug(scalar p, scalar T) const;
153 
154  //- Liquid thermal conductivity [W/(m K)]
155  inline scalar K(scalar p, scalar T) const;
156 
157  //- Vapour thermal conductivity [W/(m K)]
158  inline scalar Kg(scalar p, scalar T) const;
159 
160  //- Surface tension [N/m]
161  inline scalar sigma(scalar p, scalar T) const;
162 
163  //- Vapour diffussivity [m2/s]
164  inline scalar D(scalar p, scalar T) const;
165 
166  //- Vapour diffussivity [m2/s] with specified binary pair
167  inline scalar D(scalar p, scalar T, scalar Wb) const;
168 
169 
170  // I-O
171 
172  //- Write the function coefficients
173  void writeData(Ostream& os) const
174  {
175  liquidProperties::writeData(os); os << nl;
176  rho_.writeData(os); os << nl;
177  pv_.writeData(os); os << nl;
178  hl_.writeData(os); os << nl;
179  Cp_.writeData(os); os << nl;
180  h_.writeData(os); os << nl;
181  Cpg_.writeData(os); os << nl;
182  B_.writeData(os); os << nl;
183  mu_.writeData(os); os << nl;
184  mug_.writeData(os); os << nl;
185  K_.writeData(os); os << nl;
186  Kg_.writeData(os); os << nl;
187  sigma_.writeData(os); os << nl;
188  D_.writeData(os); os << endl;
189  }
190 
191 
192  //- Ostream Operator
193  friend Ostream& operator<<(Ostream& os, const H2O& l)
194  {
195  l.writeData(os);
196  return os;
197  }
198 };
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #include "H2OI.H"
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
dictionary dict
scalar K(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
Definition: H2OI.H:80
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: H2OI.H:68
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc0.H:112
NSRDS function number 102.
Definition: NSRDSfunc2.H:67
H2O()
Construct null.
Definition: H2O.C:41
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual void writeData(Ostream &os) const
Write the function coefficients.
water
Definition: H2O.H:57
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
Definition: H2OI.H:92
NSRDS-AICHE function number 107.
Definition: NSRDSfunc7.H:67
scalar Kg(scalar p, scalar T) const
Vapour thermal conductivity [W/(m K)].
Definition: H2OI.H:86
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: H2OI.H:38
NSRDS function number 104.
Definition: NSRDSfunc4.H:67
scalar h(scalar p, scalar T) const
Liquid Enthalpy [J/(kg)].
Definition: H2OI.H:50
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc5.H:110
The thermophysical properties of a liquidProperties.
NSRDS function number 105.
Definition: NSRDSfunc5.H:67
void writeData(Ostream &os) const
Write the function coefficients.
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: H2OI.H:32
TypeName("H2O")
Runtime type information.
scalar D(scalar p, scalar T) const
Vapour diffussivity [m2/s].
Definition: H2OI.H:98
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc6.H:113
scalar B(scalar p, scalar T) const
Second Virial Coefficient [m^3/kg].
Definition: H2OI.H:62
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
static const char nl
Definition: Ostream.H:262
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
friend Ostream & operator<<(Ostream &os, const H2O &l)
Ostream Operator.
Definition: H2O.H:192
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/(kg K)].
Definition: H2OI.H:44
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc1.H:111
NSRDS function number 100.
Definition: NSRDSfunc0.H:67
NSRDS function number 106.
Definition: NSRDSfunc6.H:67
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc4.H:111
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/(kg K)].
Definition: H2OI.H:56
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: H2OI.H:26
API function for vapour mass diffusivity.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
volScalarField & p
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: H2O.H:118
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc7.H:111
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: H2OI.H:74
NSRDS function number 101.
Definition: NSRDSfunc1.H:67
void writeData(Ostream &os) const
Write the function coefficients.
Definition: H2O.H:172
void writeData(Ostream &os) const
Write the function coefficients.
Definition: NSRDSfunc2.H:110
Namespace for OpenFOAM.