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

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