OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

liquid.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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::liquid
00027 
00028 Description
00029     The thermophysical properties of a liquid
00030 
00031 SourceFiles
00032     liquid.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef liquid_H
00037 #define liquid_H
00038 
00039 #include "scalar.H"
00040 #include "IOstreams.H"
00041 #include "typeInfo.H"
00042 #include "autoPtr.H"
00043 #include "runTimeSelectionTables.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class liquid Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class liquid
00055 {
00056     // Private data
00057 
00058         //- Molecular weight [kg/kmol]
00059         scalar W_;
00060 
00061         //- Critical temperature [K]
00062         scalar Tc_;
00063 
00064         //- Critical pressure [Pa]
00065         scalar Pc_;
00066 
00067         //- Critical volume [m^3/mol]
00068         scalar Vc_;
00069 
00070         //- Critical compressibility factor []
00071         scalar Zc_;
00072 
00073         //- Triple point temperature [K]
00074         scalar Tt_;
00075 
00076         //- Triple point pressure [Pa]
00077         scalar Pt_;
00078 
00079         //- Normal boiling temperature [K]
00080         scalar Tb_;
00081 
00082         //- Dipole moment []
00083         scalar dipm_;
00084 
00085         //- Pitzer's accentric factor []
00086         scalar omega_;
00087 
00088         //- Solubility parameter [(J/m^3)^0.5]
00089         scalar delta_;
00090 
00091 
00092 public:
00093 
00094     TypeName("liquid");
00095 
00096 
00097     // Declare run-time constructor selection tables
00098 
00099         declareRunTimeSelectionTable
00100         (
00101             autoPtr,
00102             liquid,
00103             ,
00104             (),
00105             ()
00106         );
00107 
00108         declareRunTimeSelectionTable
00109         (
00110             autoPtr,
00111             liquid,
00112             Istream,
00113             (Istream& is),
00114             (is)
00115         );
00116 
00117 
00118     // Constructors
00119 
00120         //- Construct from components
00121         liquid
00122         (
00123             scalar W,
00124             scalar Tc,
00125             scalar Pc,
00126             scalar Vc,
00127             scalar Zc,
00128             scalar Tt,
00129             scalar Pt,
00130             scalar Tb,
00131             scalar dipm,
00132             scalar omega,
00133             scalar delta
00134         )
00135         :
00136             W_(W),
00137             Tc_(Tc),
00138             Pc_(Pc),
00139             Vc_(Vc),
00140             Zc_(Zc),
00141             Tt_(Tt),
00142             Pt_(Pt),
00143             Tb_(Tb),
00144             dipm_(dipm),
00145             omega_(omega),
00146             delta_(delta)
00147         {}
00148 
00149         //- Construct from Istream
00150         liquid(Istream& is)
00151         :
00152             W_(readScalar(is)),
00153             Tc_(readScalar(is)),
00154             Pc_(readScalar(is)),
00155             Vc_(readScalar(is)),
00156             dipm_(readScalar(is)),
00157             omega_(readScalar(is)),
00158             delta_(readScalar(is))
00159         {}
00160 
00161         //- Return a pointer to a new liquid created from input
00162         static autoPtr<liquid> New(Istream& is);
00163 
00164 
00165     //- Destructor
00166     virtual ~liquid()
00167     {}
00168 
00169 
00170     // Member Functions
00171 
00172         // Physical constants which define the specie
00173 
00174             //- Molecular weight [kg/kmol]
00175             inline scalar W() const;
00176 
00177             //- Critical temperature [K]
00178             inline scalar Tc() const;
00179 
00180             //- Critical pressure [Pa]
00181             inline scalar Pc() const;
00182 
00183             //- Critical volume [m^3/mol]
00184             inline scalar Vc() const;
00185 
00186             //- Critical compressibilty factor
00187             inline scalar Zc() const;
00188 
00189             //- Triple point temperature [K]
00190             inline scalar Tt() const;
00191 
00192             //- Triple point pressure [Pa]
00193             inline scalar Pt() const;
00194 
00195             //- Normal boiling temperature [K]
00196             inline scalar Tb() const;
00197 
00198             //- Dipole moment []
00199             inline scalar dipm() const;
00200 
00201             //- Pitzer's ascentric factor []
00202             inline scalar omega() const;
00203 
00204             //- Solubility parameter [(J/m^3)^(1/2)]
00205             inline scalar delta() const;
00206 
00207 
00208         // Physical property pure virtual functions
00209 
00210             //- Liquid rho [kg/m^3]
00211             virtual scalar rho(scalar p, scalar T) const = 0;
00212 
00213             //- Vapour pressure [Pa]
00214             virtual scalar pv(scalar p, scalar T) const = 0;
00215 
00216             //- Heat of vapourisation [J/kg]
00217             virtual scalar hl(scalar p, scalar T) const = 0;
00218 
00219             //- Liquid heat capacity [J/(kg K)]
00220             virtual scalar cp(scalar p, scalar T) const = 0;
00221 
00222             //- Liquid h [J/kg]
00223             virtual scalar h(scalar p, scalar T) const = 0;
00224 
00225             //- Ideal gas heat capacity [J/(kg K)]
00226             virtual scalar cpg(scalar p, scalar T) const = 0;
00227 
00228             //- Liquid viscosity [Pa s]
00229             virtual scalar mu(scalar p, scalar T) const = 0;
00230 
00231             //- Vapour viscosity [Pa s]
00232             virtual scalar mug(scalar p, scalar T) const = 0;
00233 
00234             //- Liquid thermal conductivity  [W/(m K)]
00235             virtual scalar K(scalar p, scalar T) const = 0;
00236 
00237             //- Vapour thermal conductivity  [W/(m K)]
00238             virtual scalar Kg(scalar p, scalar T) const = 0;
00239 
00240             //- Surface tension [N/m]
00241             virtual scalar sigma(scalar p, scalar T) const = 0;
00242 
00243             //- Vapour diffussivity [m2/s]
00244             virtual scalar D(scalar p, scalar T) const = 0;
00245 
00246 
00247     // I-O
00248 
00249         //- Write the function coefficients
00250         virtual void writeData(Ostream& os) const
00251         {
00252             os  << W_ << token::SPACE
00253                 << Tc_ << token::SPACE
00254                 << Pc_ << token::SPACE
00255                 << Vc_ << token::SPACE
00256                 << dipm_ << token::SPACE
00257                 << omega_<< token::SPACE
00258                 << delta_;
00259         }
00260 
00261         //- Ostream Operator
00262         friend Ostream& operator<<(Ostream& os, const liquid& l)
00263         {
00264             l.writeData(os);
00265             return os;
00266         }
00267 };
00268 
00269 
00270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00271 
00272 } // End namespace Foam
00273 
00274 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00275 
00276 #include "liquidI.H"
00277 
00278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00279 
00280 #endif
00281 
00282 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd