initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / liquidMixture / liquidMixture / liquidMixture.H
blob43ea40834915278bfbbd973f5cf46235f0f1e89c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::liquidMixture
28 Description
29     A mixture of liquids.
31     The theory in this class is to a very large extent based on the book:
32     'The Properties of Gases & Liquids' 4th ed.
33     by Reid, Prausnitz and Poling
35     For now it does not do much, since the perfect gas equation is used.
37     The dictionary constructor searches for the entry @c liquidComponents,
38     which is a wordList. The liquid properties of each component can either
39     be contained within a @c liquidProperties sub-dictionary or (for legacy
40     purposes) can be found directly in the dictionary.
41     The @c liquidProperties sub-dictionary entry should be used when possible
42     to avoid conflicts with identically named gas-phase entries.
44     A simple example of a single-component liquidMixture:
45     @verbatim
46         liquidComponents
47         (
48             H2O
49         );
51         // the gas-phase species
52         species
53         (
54             AIR H2O
55         );
57         // thermo values from BurcatCpData
58         AIR
59             AIR 1 28.96518      // specie: name/nMoles/MolWt
60             200 6000 1000       // low/high/common temperature
61             3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11 -3.9707697e-15 -995.26275 5.9596093   // 7 upper Temp. coeffs
62             3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12 -4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs
63             1.4792e-06 116      // sutherlandTransport for AIR (STAR-CD)
64             ;
65         H2O
66             H2O 1 18.01528      // specie: name/nMoles/MolWt
67             200 6000 1000       // low/high/common temperature
68             2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11 -4.2689991e-15 -29885.894 6.88255    // 7 upper Temp. coeffs
69             4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09 1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs
70             1.4792e-06 116      // sutherlandTransport for AIR (STAR-CD)
71             ;
73         liquidProperties
74         {
75             H2O H2O defaultCoeffs;
76         }
77     @endverbatim
79 \*---------------------------------------------------------------------------*/
81 #ifndef liquidMixture_H
82 #define liquidMixture_H
84 #include "word.H"
85 #include "scalarField.H"
86 #include "PtrList.H"
87 #include "liquid.H"
88 #include "autoPtr.H"
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 namespace Foam
95 /*---------------------------------------------------------------------------*\
96                        Class liquidMixture Declaration
97 \*---------------------------------------------------------------------------*/
99 class liquidMixture
101     // Private data
103         // maximum reduced temperature
104         static const scalar TrMax;
106         //- The names of the liquids
107         List<word> components_;
109         //- The liquid properties
110         PtrList<liquid> properties_;
113 public:
116     // Constructors
118         //- Construct from dictionary
119         liquidMixture
120         (
121             const dictionary&
122         );
125     // Selectors
127         //- Select construct from dictionary
128         static autoPtr<liquidMixture> New
129         (
130             const dictionary&
131         );
134     // Member Functions
136         inline const List<word>& components() const
137         {
138             return components_;
139         }
141         //- Return the liquid properties
142         inline const PtrList<liquid>& properties() const
143         {
144             return properties_;
145         }
147         //- Calculate the critical temperature of mixture
148         scalar Tc(const scalarField& x) const;
150         //- Return pseudocritical temperature according to Kay's rule
151         scalar Tpc(const scalarField& x) const;
153         //- Return pseudocritical pressure (modified Prausnitz and Gunn)
154         scalar Ppc(const scalarField& x) const;
156         //- Return mixture accentric factor
157         scalar omega(const scalarField& x) const;
159         //- Return the surface molar fractions
160         scalarField Xs
161         (
162             const scalar p,
163             const scalar Tg,
164             const scalar Tl,
165             const scalarField& xg,
166             const scalarField& xl
167         ) const;
170         //- Calculate the mean molecular weight [kg/kmol]
171         // from mole fractions
172         scalar W(const scalarField& x) const;
174         //- Returns the mass fractions, given mole fractions
175         scalarField Y(const scalarField& X) const;
177         //- Returns the mole fractions, given mass fractions
178         scalarField X(const scalarField& Y) const;
180         //- Calculate the mixture density [kg/m^3]
181         scalar rho
182         (
183             const scalar p,
184             const scalar T,
185             const scalarField& x
186         ) const;
188         //- Calculate the mixture vapour pressure [Pa]
189         scalar pv
190         (
191             const scalar p,
192             const scalar T,
193             const scalarField& x
194         ) const;
196         //- Calculate the mixture latent heat [J/kg]
197         scalar hl
198         (
199             const scalar p,
200             const scalar T,
201             const scalarField& x
202         ) const;
204         //- Calculate the mixture heat capacity [J/(kg K)]
205         scalar cp
206         (
207             const scalar p,
208             const scalar T,
209             const scalarField& x
210         ) const;
212         //- Estimate mixture surface tension [N/m]
213         scalar sigma
214         (
215             const scalar p,
216             const scalar T,
217             const scalarField& x
218         ) const;
220         //- Calculate the mixture viscosity [Pa s]
221         scalar mu
222         (
223             const scalar p,
224             const scalar T,
225             const scalarField& x
226         ) const;
228         //- Estimate thermal conductivity  [W/(m K)]
229         // Li's method, Eq. 10-12.27 - 10.12-19
230         scalar K
231         (
232             const scalar p,
233             const scalar T,
234             const scalarField& x
235         ) const;
237         scalar D
238         (
239             const scalar p,
240             const scalar T,
241             const scalarField& x
242         ) const;
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 } // End namespace Foam
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 #endif
254 // ************************************************************************* //