OpenFOAM logo
Open Source CFD Toolkit

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