liquidProperties.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::liquidProperties
29
30Description
31 The thermophysical properties of a liquid
32
33SourceFiles
34 liquidProperties.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef liquidProperties_H
39#define liquidProperties_H
40
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class liquidProperties Declaration
50\*---------------------------------------------------------------------------*/
53:
55{
56 // Private data
57
58 //- Critical temperature [K]
59 scalar Tc_;
60
61 //- Critical pressure [Pa]
62 scalar Pc_;
63
64 //- Critical volume [m^3/kmol]
65 scalar Vc_;
66
67 //- Critical compressibility factor []
68 scalar Zc_;
69
70 //- Triple point temperature [K]
71 scalar Tt_;
72
73 //- Triple point pressure [Pa]
74 scalar Pt_;
75
76 //- Normal boiling temperature [K]
77 scalar Tb_;
78
79 //- Dipole moment []
80 scalar dipm_;
81
82 //- Pitzer's accentric factor []
83 scalar omega_;
84
85 //- Solubility parameter [(J/m^3)^0.5]
86 scalar delta_;
87
88
89public:
91 TypeName("liquid");
92
93
94 // Declare run-time constructor selection tables
97 (
98 autoPtr,
100 ,
101 (),
102 ()
103 );
106 (
107 autoPtr,
110 (const dictionary& dict),
111 (dict)
112 );
113
114
115 // Constructors
116
117 //- Construct from components
119 (
120 scalar W,
121 scalar Tc,
122 scalar Pc,
123 scalar Vc,
124 scalar Zc,
125 scalar Tt,
126 scalar Pt,
127 scalar Tb,
128 scalar dipm,
129 scalar omega,
130 scalar delta
131 );
132
133 //- Construct from dictionary
135
136 //- Construct and return clone
137 virtual autoPtr<liquidProperties> clone() const = 0;
138
139
140 // Selectors
141
142 //- Return a pointer to a new liquidProperties created from name
143 static autoPtr<liquidProperties> New(const word& name);
144
145 //- Return a pointer to a new liquidProperties created from dictionary
147
148
149 //- Destructor
150 virtual ~liquidProperties() = default;
151
152
153 // Static data
154
155 //- Is the equation of state is incompressible i.e. rho != f(p)
156 static const bool incompressible = true;
157
158 //- Is the equation of state is isochoric i.e. rho = const
159 static const bool isochoric = false;
160
161
162 // Member Functions
163
164 // Physical constants which define the specie
165
166 //- No of moles of this species in mixture
167 // Note Mixing of liquidProperties is not currently supported
168 // so Y = 1
169 inline scalar Y() const;
170
171 //- Critical temperature [K]
172 inline scalar Tc() const;
173
174 //- Critical pressure [Pa]
175 inline scalar Pc() const;
176
177 //- Critical volume [m^3/kmol]
178 inline scalar Vc() const;
179
180 //- Critical compressibility factor
181 inline scalar Zc() const;
182
183 //- Triple point temperature [K]
184 inline scalar Tt() const;
185
186 //- Triple point pressure [Pa]
187 inline scalar Pt() const;
188
189 //- Normal boiling temperature [K]
190 inline scalar Tb() const;
191
192 //- Dipole moment []
193 inline scalar dipm() const;
194
195 //- Pitzer's acentric factor []
196 inline scalar omega() const;
197
198 //- Solubility parameter [(J/m^3)^(1/2)]
199 inline scalar delta() const;
200
201 //- Limit temperature to be within the range
202 inline scalar limit(const scalar T) const;
203
204
205 // Fundamental equation of state properties
206
207 //- Liquid compressibility rho/p [s^2/m^2]
208 // Note: currently it is assumed the liquid is incompressible
209 inline scalar psi(scalar p, scalar T) const;
210
211 //- Return (Cp - Cv) [J/(kg K]
212 // Note: currently it is assumed the liquid is incompressible
213 // so CpMCv = 0
214 inline scalar CpMCv(scalar p, scalar T) const;
215
216
217 // Fundamental thermodynamic properties
218
219 //- Absolute Enthalpy [J/kg]
220 inline scalar Ha(const scalar p, const scalar T) const;
221
222 //- Sensible enthalpy [J/kg]
223 inline scalar Hs(const scalar p, const scalar T) const;
224
225 //- Chemical enthalpy [J/kg]
226 inline scalar Hc() const;
227
228 // Entropy [J/(kg K)]
229 scalar S(const scalar p, const scalar T) const;
230
231
232 // Physical properties
233
234 //- Vapour pressure [Pa]
235 virtual scalar pv(scalar p, scalar T) const = 0;
236
237 //- Heat of vapourisation [J/kg]
238 virtual scalar hl(scalar p, scalar T) const = 0;
239
240 //- Liquid enthalpy [J/kg] - reference to 298.15 K
241 virtual scalar h(scalar p, scalar T) const = 0;
242
243 //- Vapour heat capacity [J/(kg K)]
244 virtual scalar Cpg(scalar p, scalar T) const = 0;
245
246 //- Liquid viscosity [Pa s]
247 virtual scalar mu(scalar p, scalar T) const = 0;
248
249 //- Vapour viscosity [Pa s]
250 virtual scalar mug(scalar p, scalar T) const = 0;
251
252 //- Liquid thermal conductivity [W/(m K)]
253 virtual scalar kappa(scalar p, scalar T) const = 0;
254
255 //- Liquid thermal diffusivity of enthalpy [kg/ms]
256 inline scalar alphah(const scalar p, const scalar T) const;
257
258 //- Vapour thermal conductivity [W/(m K)]
259 virtual scalar kappag(scalar p, scalar T) const = 0;
260
261 //- Surface tension [N/m]
262 virtual scalar sigma(scalar p, scalar T) const = 0;
263
264 //- Vapour diffusivity [m2/s]
265 virtual scalar D(scalar p, scalar T) const = 0;
266
267 //- Vapour diffusivity [m2/s] with specified binary pair
268 virtual scalar D(scalar p, scalar T, scalar Wb) const = 0;
269
270 //- Invert the vapour pressure relationship to retrieve the
271 // boiling temperature as a function of pressure
272 virtual scalar pvInvert(scalar p) const;
273
274
275 // I-O
276
277 //- Read and set the properties present it the given dictionary
278 void readIfPresent(const dictionary& dict);
279
280 //- Read and set the function coefficients
281 // if present it the given dictionary
282 template<class Func>
283 inline void readIfPresent
284 (
285 Func& f,
286 const word& name,
287 const dictionary& dict
288 );
289
290 //- Read and set the function coefficients
291 // if present it the given dictionary
292 template<class Liquid>
293 inline void readIfPresent(Liquid& l, const dictionary& dict);
294
295 //- Write the function coefficients
296 virtual void writeData(Ostream& os) const = 0;
297
298 //- Write the data for each of the property functions
299 template<class Liquid>
300 inline void writeData(const Liquid& l, Ostream& os) const;
301
302 //- Ostream Operator
303 friend Ostream& operator<<(Ostream& os, const liquidProperties& l);
304};
305
306
308
309
310// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
311
312} // End namespace Foam
313
314// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
315
316#include "liquidPropertiesI.H"
317
318// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
319
320#endif
321
322// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
The thermophysical properties of a liquid.
scalar Vc() const
Critical volume [m^3/kmol].
scalar limit(const scalar T) const
Limit temperature to be within the range.
virtual scalar mu(scalar p, scalar T) const =0
Liquid viscosity [Pa s].
virtual scalar D(scalar p, scalar T) const =0
Vapour diffusivity [m2/s].
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
virtual ~liquidProperties()=default
Destructor.
virtual scalar hl(scalar p, scalar T) const =0
Heat of vapourisation [J/kg].
virtual scalar sigma(scalar p, scalar T) const =0
Surface tension [N/m].
scalar Zc() const
Critical compressibility factor.
scalar delta() const
Solubility parameter [(J/m^3)^(1/2)].
virtual scalar kappag(scalar p, scalar T) const =0
Vapour thermal conductivity [W/(m K)].
virtual scalar h(scalar p, scalar T) const =0
Liquid enthalpy [J/kg] - reference to 298.15 K.
virtual scalar mug(scalar p, scalar T) const =0
Vapour viscosity [Pa s].
scalar Tb() const
Normal boiling temperature [K].
scalar Pc() const
Critical pressure [Pa].
virtual scalar D(scalar p, scalar T, scalar Wb) const =0
Vapour diffusivity [m2/s] with specified binary pair.
virtual scalar pv(scalar p, scalar T) const =0
Vapour pressure [Pa].
scalar Hc() const
Chemical enthalpy [J/kg].
declareRunTimeSelectionTable(autoPtr, liquidProperties, dictionary,(const dictionary &dict),(dict))
scalar Pt() const
Triple point pressure [Pa].
scalar S(const scalar p, const scalar T) const
scalar omega() const
Pitzer's acentric factor [].
scalar Ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kg].
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
scalar Tt() const
Triple point temperature [K].
scalar alphah(const scalar p, const scalar T) const
Liquid thermal diffusivity of enthalpy [kg/ms].
scalar dipm() const
Dipole moment [].
static const bool isochoric
Is the equation of state is isochoric i.e. rho = const.
virtual scalar Cpg(scalar p, scalar T) const =0
Vapour heat capacity [J/(kg K)].
declareRunTimeSelectionTable(autoPtr, liquidProperties,,(),())
friend Ostream & operator<<(Ostream &os, const liquidProperties &l)
Ostream Operator.
scalar Y() const
No of moles of this species in mixture.
static const bool incompressible
Is the equation of state is incompressible i.e. rho != f(p)
virtual void writeData(Ostream &os) const =0
Write the function coefficients.
static autoPtr< liquidProperties > New(const word &name)
Return a pointer to a new liquidProperties created from name.
virtual scalar pvInvert(scalar p) const
Invert the vapour pressure relationship to retrieve the.
virtual autoPtr< liquidProperties > clone() const =0
Construct and return clone.
scalar Tc() const
Critical temperature [K].
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
virtual scalar kappa(scalar p, scalar T) const =0
Liquid thermal conductivity [W/(m K)].
Base-class for thermophysical properties of solids, liquids and gases providing an interface compatib...
scalar W() const
Molecular weight [kg/kmol].
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & psi
const volScalarField & T
const volScalarField & mu
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
labelList f(nPoints)
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
volScalarField & h
const dimensionedScalar & D
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73