FreeFOAM The Cross-Platform CFD Toolkit
liquidMixture.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) 1991-2010 OpenCFD Ltd.
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::liquidMixture
26 
27 Description
28  A mixture of liquids.
29 
30  The theory in this class is to a very large extent based on the book:
31  'The Properties of Gases & Liquids' 4th ed.
32  by Reid, Prausnitz and Poling
33 
34  For now it does not do much, since the perfect gas equation is used.
35 
36  The dictionary constructor searches for the entry @c liquidComponents,
37  which is a wordList. The liquid properties of each component can either
38  be contained within a @c liquidProperties sub-dictionary or (for legacy
39  purposes) can be found directly in the dictionary.
40  The @c liquidProperties sub-dictionary entry should be used when possible
41  to avoid conflicts with identically named gas-phase entries.
42 
43  A simple example of a single-component liquidMixture:
44  @verbatim
45  liquidComponents
46  (
47  H2O
48  );
49 
50  // the gas-phase species
51  species
52  (
53  AIR H2O
54  );
55 
56  // thermo values from BurcatCpData
57  AIR
58  AIR 1 28.96518 // specie: name/nMoles/MolWt
59  200 6000 1000 // low/high/common temperature
60  3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11 -3.9707697e-15 -995.26275 5.9596093 // 7 upper Temp. coeffs
61  3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12 -4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs
62  1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
63  ;
64  H2O
65  H2O 1 18.01528 // specie: name/nMoles/MolWt
66  200 6000 1000 // low/high/common temperature
67  2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11 -4.2689991e-15 -29885.894 6.88255 // 7 upper Temp. coeffs
68  4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09 1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs
69  1.4792e-06 116 // sutherlandTransport for AIR (STAR-CD)
70  ;
71 
72  liquidProperties
73  {
74  H2O H2O defaultCoeffs;
75  }
76  @endverbatim
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef liquidMixture_H
81 #define liquidMixture_H
82 
83 #include <OpenFOAM/word.H>
84 #include <OpenFOAM/scalarField.H>
85 #include <OpenFOAM/PtrList.H>
86 #include <liquids/liquid.H>
87 #include <OpenFOAM/autoPtr.H>
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 
94 /*---------------------------------------------------------------------------*\
95  Class liquidMixture Declaration
96 \*---------------------------------------------------------------------------*/
97 
99 {
100  // Private data
101 
102  // maximum reduced temperature
103  static const scalar TrMax;
104 
105  //- The names of the liquids
106  List<word> components_;
107 
108  //- The liquid properties
109  PtrList<liquid> properties_;
110 
111 
112 public:
113 
114 
115  // Constructors
116 
117  //- Construct from dictionary
119  (
120  const dictionary&
121  );
122 
123 
124  // Selectors
125 
126  //- Select construct from dictionary
128  (
129  const dictionary&
130  );
131 
132 
133  // Member Functions
134 
135  inline const List<word>& components() const
136  {
137  return components_;
138  }
139 
140  //- Return the liquid properties
141  inline const PtrList<liquid>& properties() const
142  {
143  return properties_;
144  }
145 
146  //- Calculate the critical temperature of mixture
147  scalar Tc(const scalarField& x) const;
148 
149  //- Return pseudocritical temperature according to Kay's rule
150  scalar Tpc(const scalarField& x) const;
151 
152  //- Return pseudocritical pressure (modified Prausnitz and Gunn)
153  scalar Ppc(const scalarField& x) const;
154 
155  //- Return mixture accentric factor
156  scalar omega(const scalarField& x) const;
157 
158  //- Return the surface molar fractions
160  (
161  const scalar p,
162  const scalar Tg,
163  const scalar Tl,
164  const scalarField& xg,
165  const scalarField& xl
166  ) const;
167 
168 
169  //- Calculate the mean molecular weight [kg/kmol]
170  // from mole fractions
171  scalar W(const scalarField& x) const;
172 
173  //- Returns the mass fractions, given mole fractions
174  scalarField Y(const scalarField& X) const;
175 
176  //- Returns the mole fractions, given mass fractions
177  scalarField X(const scalarField& Y) const;
178 
179  //- Calculate the mixture density [kg/m^3]
180  scalar rho
181  (
182  const scalar p,
183  const scalar T,
184  const scalarField& x
185  ) const;
186 
187  //- Calculate the mixture vapour pressure [Pa]
188  scalar pv
189  (
190  const scalar p,
191  const scalar T,
192  const scalarField& x
193  ) const;
194 
195  //- Calculate the mixture latent heat [J/kg]
196  scalar hl
197  (
198  const scalar p,
199  const scalar T,
200  const scalarField& x
201  ) const;
202 
203  //- Calculate the mixture heat capacity [J/(kg K)]
204  scalar cp
205  (
206  const scalar p,
207  const scalar T,
208  const scalarField& x
209  ) const;
210 
211  //- Estimate mixture surface tension [N/m]
212  scalar sigma
213  (
214  const scalar p,
215  const scalar T,
216  const scalarField& x
217  ) const;
218 
219  //- Calculate the mixture viscosity [Pa s]
220  scalar mu
221  (
222  const scalar p,
223  const scalar T,
224  const scalarField& x
225  ) const;
226 
227  //- Estimate thermal conductivity [W/(m K)]
228  // Li's method, Eq. 10-12.27 - 10.12-19
229  scalar K
230  (
231  const scalar p,
232  const scalar T,
233  const scalarField& x
234  ) const;
235 
236  scalar D
237  (
238  const scalar p,
239  const scalar T,
240  const scalarField& x
241  ) const;
242 };
243 
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 } // End namespace Foam
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 #endif
252 
253 // ************************ vim: set sw=4 sts=4 et: ************************ //