FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

liquidMixture.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::liquidMixture
00026 
00027 Description
00028     A mixture of liquids.
00029 
00030     The theory in this class is to a very large extent based on the book:
00031     'The Properties of Gases & Liquids' 4th ed.
00032     by Reid, Prausnitz and Poling
00033 
00034     For now it does not do much, since the perfect gas equation is used.
00035 
00036     The dictionary constructor searches for the entry @c liquidComponents,
00037     which is a wordList. The liquid properties of each component can either
00038     be contained within a @c liquidProperties sub-dictionary or (for legacy
00039     purposes) can be found directly in the dictionary.
00040     The @c liquidProperties sub-dictionary entry should be used when possible
00041     to avoid conflicts with identically named gas-phase entries.
00042 
00043     A simple example of a single-component liquidMixture:
00044     @verbatim
00045         liquidComponents
00046         (
00047             H2O
00048         );
00049 
00050         // the gas-phase species
00051         species
00052         (
00053             AIR H2O
00054         );
00055 
00056         // thermo values from BurcatCpData
00057         AIR
00058             AIR 1 28.96518      // specie: name/nMoles/MolWt
00059             200 6000 1000       // low/high/common temperature
00060             3.0879272 0.0012459718 -4.2371895e-07 6.7477479e-11 -3.9707697e-15 -995.26275 5.9596093   // 7 upper Temp. coeffs
00061             3.5683962 -0.00067872943 1.5537148e-06 -3.2993706e-12 -4.6639539e-13 -1062.3466 3.7158296 // 7 lower Temp. coeffs
00062             1.4792e-06 116      // sutherlandTransport for AIR (STAR-CD)
00063             ;
00064         H2O
00065             H2O 1 18.01528      // specie: name/nMoles/MolWt
00066             200 6000 1000       // low/high/common temperature
00067             2.6770389 0.0029731816 -7.7376889e-07 9.4433514e-11 -4.2689991e-15 -29885.894 6.88255    // 7 upper Temp. coeffs
00068             4.1986352 -0.0020364017 6.5203416e-06 -5.4879269e-09 1.771968e-12 -30293.726 -0.84900901 // 7 lower Temp. coeffs
00069             1.4792e-06 116      // sutherlandTransport for AIR (STAR-CD)
00070             ;
00071 
00072         liquidProperties
00073         {
00074             H2O H2O defaultCoeffs;
00075         }
00076     @endverbatim
00077 
00078 \*---------------------------------------------------------------------------*/
00079 
00080 #ifndef liquidMixture_H
00081 #define liquidMixture_H
00082 
00083 #include <OpenFOAM/word.H>
00084 #include <OpenFOAM/scalarField.H>
00085 #include <OpenFOAM/PtrList.H>
00086 #include <liquids/liquid.H>
00087 #include <OpenFOAM/autoPtr.H>
00088 
00089 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00090 
00091 namespace Foam
00092 {
00093 
00094 /*---------------------------------------------------------------------------*\
00095                        Class liquidMixture Declaration
00096 \*---------------------------------------------------------------------------*/
00097 
00098 class liquidMixture
00099 {
00100     // Private data
00101 
00102         // maximum reduced temperature
00103         static const scalar TrMax;
00104 
00105         //- The names of the liquids
00106         List<word> components_;
00107 
00108         //- The liquid properties
00109         PtrList<liquid> properties_;
00110 
00111 
00112 public:
00113 
00114 
00115     // Constructors
00116 
00117         //- Construct from dictionary
00118         liquidMixture
00119         (
00120             const dictionary&
00121         );
00122 
00123 
00124     // Selectors
00125 
00126         //- Select construct from dictionary
00127         static autoPtr<liquidMixture> New
00128         (
00129             const dictionary&
00130         );
00131 
00132 
00133     // Member Functions
00134 
00135         inline const List<word>& components() const
00136         {
00137             return components_;
00138         }
00139 
00140         //- Return the liquid properties
00141         inline const PtrList<liquid>& properties() const
00142         {
00143             return properties_;
00144         }
00145 
00146         //- Calculate the critical temperature of mixture
00147         scalar Tc(const scalarField& x) const;
00148 
00149         //- Return pseudocritical temperature according to Kay's rule
00150         scalar Tpc(const scalarField& x) const;
00151 
00152         //- Return pseudocritical pressure (modified Prausnitz and Gunn)
00153         scalar Ppc(const scalarField& x) const;
00154 
00155         //- Return mixture accentric factor
00156         scalar omega(const scalarField& x) const;
00157 
00158         //- Return the surface molar fractions
00159         scalarField Xs
00160         (
00161             const scalar p,
00162             const scalar Tg,
00163             const scalar Tl,
00164             const scalarField& xg,
00165             const scalarField& xl
00166         ) const;
00167 
00168 
00169         //- Calculate the mean molecular weight [kg/kmol]
00170         // from mole fractions
00171         scalar W(const scalarField& x) const;
00172 
00173         //- Returns the mass fractions, given mole fractions
00174         scalarField Y(const scalarField& X) const;
00175 
00176         //- Returns the mole fractions, given mass fractions
00177         scalarField X(const scalarField& Y) const;
00178 
00179         //- Calculate the mixture density [kg/m^3]
00180         scalar rho
00181         (
00182             const scalar p,
00183             const scalar T,
00184             const scalarField& x
00185         ) const;
00186 
00187         //- Calculate the mixture vapour pressure [Pa]
00188         scalar pv
00189         (
00190             const scalar p,
00191             const scalar T,
00192             const scalarField& x
00193         ) const;
00194 
00195         //- Calculate the mixture latent heat [J/kg]
00196         scalar hl
00197         (
00198             const scalar p,
00199             const scalar T,
00200             const scalarField& x
00201         ) const;
00202 
00203         //- Calculate the mixture heat capacity [J/(kg K)]
00204         scalar cp
00205         (
00206             const scalar p,
00207             const scalar T,
00208             const scalarField& x
00209         ) const;
00210 
00211         //- Estimate mixture surface tension [N/m]
00212         scalar sigma
00213         (
00214             const scalar p,
00215             const scalar T,
00216             const scalarField& x
00217         ) const;
00218 
00219         //- Calculate the mixture viscosity [Pa s]
00220         scalar mu
00221         (
00222             const scalar p,
00223             const scalar T,
00224             const scalarField& x
00225         ) const;
00226 
00227         //- Estimate thermal conductivity  [W/(m K)]
00228         // Li's method, Eq. 10-12.27 - 10.12-19
00229         scalar K
00230         (
00231             const scalar p,
00232             const scalar T,
00233             const scalarField& x
00234         ) const;
00235 
00236         scalar D
00237         (
00238             const scalar p,
00239             const scalar T,
00240             const scalarField& x
00241         ) const;
00242 };
00243 
00244 
00245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00246 
00247 } // End namespace Foam
00248 
00249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00250 
00251 #endif
00252 
00253 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines