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 | Copyright (C) 2011-2013 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::liquidProperties
26 
27 Description
28  The thermophysical properties of a liquidProperties
29 
30 SourceFiles
31  liquidProperties.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef liquidProperties_H
36 #define liquidProperties_H
37 
38 #include "scalar.H"
39 #include "IOstreams.H"
40 #include "typeInfo.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 #include "dictionary.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class liquidProperties Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class liquidProperties
55 {
56  // Private data
57 
58  //- Molecular weight [kg/kmol]
59  scalar W_;
60 
61  //- Critical temperature [K]
62  scalar Tc_;
63 
64  //- Critical pressure [Pa]
65  scalar Pc_;
66 
67  //- Critical volume [m^3/kmol]
68  scalar Vc_;
69 
70  //- Critical compressibility factor []
71  scalar Zc_;
72 
73  //- Triple point temperature [K]
74  scalar Tt_;
75 
76  //- Triple point pressure [Pa]
77  scalar Pt_;
78 
79  //- Normal boiling temperature [K]
80  scalar Tb_;
81 
82  //- Dipole moment []
83  scalar dipm_;
84 
85  //- Pitzer's accentric factor []
86  scalar omega_;
87 
88  //- Solubility parameter [(J/m^3)^0.5]
89  scalar delta_;
90 
91 
92 public:
93 
94  TypeName("liquidProperties");
95 
96 
97  // Declare run-time constructor selection tables
98 
100  (
101  autoPtr,
103  ,
104  (),
105  ()
106  );
107 
109  (
110  autoPtr,
112  Istream,
113  (Istream& is),
114  (is)
115  );
116 
118  (
119  autoPtr,
121  dictionary,
122  (const dictionary& dict),
123  (dict)
124  );
125 
126 
127  // Constructors
128 
129  //- Construct from components
131  (
132  scalar W,
133  scalar Tc,
134  scalar Pc,
135  scalar Vc,
136  scalar Zc,
137  scalar Tt,
138  scalar Pt,
139  scalar Tb,
140  scalar dipm,
141  scalar omega,
142  scalar delta
143  );
144 
145  //- Construct from Istream
147 
148  //- Construct from dictionary
149  liquidProperties(const dictionary& dict);
150 
151  //- Construct copy
153 
154  //- Construct and return clone
155  virtual autoPtr<liquidProperties> clone() const
156  {
157  return autoPtr<liquidProperties>(new liquidProperties(*this));
158  }
159 
160 
161  // Selectors
162 
163  //- Return a pointer to a new liquidProperties created from input
165 
166  //- Return a pointer to a new liquidProperties created from dictionary
167  static autoPtr<liquidProperties> New(const dictionary& dict);
168 
169 
170  //- Destructor
171  virtual ~liquidProperties()
172  {}
173 
174 
175  // Member Functions
176 
177  // Physical constants which define the specie
178 
179  //- Molecular weight [kg/kmol]
180  inline scalar W() const;
181 
182  //- Critical temperature [K]
183  inline scalar Tc() const;
184 
185  //- Critical pressure [Pa]
186  inline scalar Pc() const;
187 
188  //- Critical volume [m^3/kmol]
189  inline scalar Vc() const;
190 
191  //- Critical compressibilty factor
192  inline scalar Zc() const;
193 
194  //- Triple point temperature [K]
195  inline scalar Tt() const;
196 
197  //- Triple point pressure [Pa]
198  inline scalar Pt() const;
199 
200  //- Normal boiling temperature [K]
201  inline scalar Tb() const;
202 
203  //- Dipole moment []
204  inline scalar dipm() const;
205 
206  //- Pitzer's ascentric factor []
207  inline scalar omega() const;
208 
209  //- Solubility parameter [(J/m^3)^(1/2)]
210  inline scalar delta() const;
211 
212 
213  // Physical property pure virtual functions
214 
215  //- Liquid rho [kg/m^3]
216  virtual scalar rho(scalar p, scalar T) const;
217 
218  //- Vapour pressure [Pa]
219  virtual scalar pv(scalar p, scalar T) const;
220 
221  //- Heat of vapourisation [J/kg]
222  virtual scalar hl(scalar p, scalar T) const;
223 
224  //- Liquid heat capacity [J/(kg K)]
225  virtual scalar Cp(scalar p, scalar T) const;
226 
227  //- Liquid enthalpy [J/kg] - reference to 298.15 K
228  virtual scalar h(scalar p, scalar T) const;
229 
230  //- Ideal gas heat capacity [J/(kg K)]
231  virtual scalar Cpg(scalar p, scalar T) const;
232 
233  //- Liquid viscosity [Pa s]
234  virtual scalar mu(scalar p, scalar T) const;
235 
236  //- Vapour viscosity [Pa s]
237  virtual scalar mug(scalar p, scalar T) const;
238 
239  //- Liquid thermal conductivity [W/(m K)]
240  virtual scalar K(scalar p, scalar T) const;
241 
242  //- Vapour thermal conductivity [W/(m K)]
243  virtual scalar Kg(scalar p, scalar T) const;
244 
245  //- Surface tension [N/m]
246  virtual scalar sigma(scalar p, scalar T) const;
247 
248  //- Vapour diffussivity [m2/s]
249  virtual scalar D(scalar p, scalar T) const;
250 
251  //- Vapour diffussivity [m2/s] with specified binary pair
252  virtual scalar D(scalar p, scalar T, scalar Wb) const;
253 
254  //- Invert the vapour pressure relationship to retrieve the
255  // boiling temperuture as a function of pressure
256  virtual scalar pvInvert(scalar p) const;
257 
258 
259  // I-O
260 
261  //- Write the function coefficients
262  virtual void writeData(Ostream& os) const;
263 
264  //- Ostream Operator
265  friend Ostream& operator<<(Ostream& os, const liquidProperties& l)
266  {
267  l.writeData(os);
268  return os;
269  }
270 };
271 
272 
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 
275 } // End namespace Foam
276 
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
278 
279 #include "liquidPropertiesI.H"
280 
281 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
282 
283 #endif
284 
285 // ************************************************************************* //
scalar Vc() const
Critical volume [m^3/kmol].
dictionary dict
scalar Tt() const
Triple point temperature [K].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual scalar h(scalar p, scalar T) const
Liquid enthalpy [J/kg] - reference to 298.15 K.
scalar Pt() const
Triple point pressure [Pa].
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.
virtual ~liquidProperties()
Destructor.
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
virtual scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
virtual scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
declareRunTimeSelectionTable(autoPtr, liquidProperties,,(),())
virtual scalar Kg(scalar p, scalar T) const
Vapour thermal conductivity [W/(m K)].
virtual scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/(kg K)].
liquidProperties(scalar W, scalar Tc, scalar Pc, scalar Vc, scalar Zc, scalar Tt, scalar Pt, scalar Tb, scalar dipm, scalar omega, scalar delta)
Construct from components.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
friend Ostream & operator<<(Ostream &os, const liquidProperties &l)
Ostream Operator.
scalar dipm() const
Dipole moment [].
TypeName("liquidProperties")
virtual scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
The thermophysical properties of a liquidProperties.
virtual scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/(kg K)].
scalar Pc() const
Critical pressure [Pa].
virtual scalar rho(scalar p, scalar T) const
Liquid rho [kg/m^3].
virtual scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual scalar K(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
virtual scalar pvInvert(scalar p) const
Invert the vapour pressure relationship to retrieve the.
static autoPtr< liquidProperties > New(Istream &is)
Return a pointer to a new liquidProperties created from input.
scalar W() const
Molecular weight [kg/kmol].
scalar delta() const
Solubility parameter [(J/m^3)^(1/2)].
scalar Tb() const
Normal boiling temperature [K].
scalar Zc() const
Critical compressibilty factor.
virtual scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
virtual scalar D(scalar p, scalar T) const
Vapour diffussivity [m2/s].
Macros to ease declaration of run-time selection tables.
volScalarField & p
scalar omega() const
Pitzer&#39;s ascentric factor [].
scalar Tc() const
Critical temperature [K].
Namespace for OpenFOAM.