OpenFOAM logo
Open Source CFD Toolkit

MB.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    MB
00027 
00028 Description
00029     nC3H7COOCH3 or (MB) methyl butyrate (used for biodiesel surrogate)
00030 
00031 SourceFiles
00032     MB.C
00033 
00034 */
00035 // ------------------------------------------------------------------------- //
00036 
00037 #ifndef MB_H
00038 #define MB_H
00039 
00040 #include "liquid.H"
00041 #include "NSRDSfunc0.H"
00042 #include "NSRDSfunc1.H"
00043 #include "NSRDSfunc2.H"
00044 #include "NSRDSfunc3.H"
00045 #include "NSRDSfunc4.H"
00046 #include "NSRDSfunc5.H"
00047 #include "NSRDSfunc6.H"
00048 #include "NSRDSfunc7.H"
00049 #include "NSRDSfunc14.H"
00050 #include "APIdiffCoefFunc.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                            Class MB Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class MB
00062 :
00063     public liquid
00064 {
00065     // Private data
00066 
00067         NSRDSfunc5 rho_;
00068         NSRDSfunc1 pv_;
00069         NSRDSfunc6 hl_;
00070         NSRDSfunc0 cp_;
00071         NSRDSfunc0 h_;
00072         NSRDSfunc7 cpg_;
00073         NSRDSfunc4 B_;
00074         NSRDSfunc1 mu_;
00075         NSRDSfunc2 mug_;
00076         NSRDSfunc0 K_;
00077         NSRDSfunc2 Kg_;
00078         NSRDSfunc6 sigma_;
00079         APIdiffCoefFunc D_;
00080 
00081 
00082 public:
00083 
00084     //- Runtime type information
00085     TypeName("MB");
00086 
00087 
00088     // Constructors
00089 
00090         //- Construct null
00091         MB()
00092         :
00093             liquid(102.133, 554.5, 3.4734e+6, 0.34, 0.256, 187.35, 1.0102e-1, 375.90, 5.7373e-30, 0.3807, 1.7713e+4),
00094             rho_(76.6099633, 0.257, 554.5, 0.2772),
00095             pv_(107.51, -8112.9, -12.77, 9.2919e-06, 2),
00096             hl_(554.5, 508307.794738233, 0.392, 0, 0, 0),
00097             cp_(1135.77394182096, 2.89818178257762, 0, 0, 0, 0),
00098             // NN: enthalpy, h_, is not used in the sprayModel.
00099             // For consistency, the enthalpy is derived from hlat and hl.
00100             // It is, however, convenient to have it available.
00101             h_(-5255966.14542938, 1135.77394182096, 1.44909089128881, 0, 0, 0),
00102             cpg_(875.329227575808, 2849.22600922327, 1570, 2029.70636327142, 678.3),
00103             B_(0.00220496803188, -2.42184210783978, -401045.695318849, -2.85079259397061e+17, -3.57377145486767e+19),
00104             mu_(-12.206, 1141.7, 0.15014, 0, 0),
00105             mug_(3.733e-07, 0.6177, 256.5, 0),
00106             K_(0.2298, -0.0003002, 0, 0, 0, 0),
00107             Kg_(1333.1, 0.9962, 12317000000.0, 0),
00108             sigma_(554.5, 0.064084, 1.2418, 0, 0, 0),
00109             D_(147.18, 20.1, 102.133, 28) // NN: Same as nHeptane
00110         {}
00111         MB
00112         (
00113             const liquid& l,
00114             const NSRDSfunc5& density,
00115             const NSRDSfunc1& vapourPressure,
00116             const NSRDSfunc6& heatOfVapourisation,
00117             const NSRDSfunc0& heatCapacity,
00118             const NSRDSfunc0& enthalpy,
00119             const NSRDSfunc7& idealGasHeatCapacity,
00120             const NSRDSfunc4& secondVirialCoeff,
00121             const NSRDSfunc1& dynamicViscosity,
00122             const NSRDSfunc2& vapourDynamicViscosity,
00123             const NSRDSfunc0& thermalConductivity,
00124             const NSRDSfunc2& vapourThermalConductivity,
00125             const NSRDSfunc6& surfaceTension,
00126             const APIdiffCoefFunc& vapourDiffussivity
00127         )
00128         :
00129             liquid(l),
00130             rho_(density),
00131             pv_(vapourPressure),
00132             hl_(heatOfVapourisation),
00133             cp_(heatCapacity),
00134             h_(enthalpy),
00135             cpg_(idealGasHeatCapacity),
00136             B_(secondVirialCoeff),
00137             mu_(dynamicViscosity),
00138             mug_(vapourDynamicViscosity),
00139             K_(thermalConductivity),
00140             Kg_(vapourThermalConductivity),
00141             sigma_(surfaceTension),
00142             D_(vapourDiffussivity)
00143         {}
00144 
00145         //- Construct from Istream
00146         MB(Istream& is)
00147         :
00148             liquid(is),
00149             rho_(is),
00150             pv_(is),
00151             hl_(is),
00152             cp_(is),
00153             h_(is),
00154             cpg_(is),
00155             B_(is),
00156             mu_(is),
00157             mug_(is),
00158             K_(is),
00159             Kg_(is),
00160             sigma_(is),
00161             D_(is)
00162         {}
00163 
00164 
00165     // Member Functions
00166 
00167         //- Liquid density [kg/m^3]
00168         scalar rho(scalar p, scalar T) const
00169         {
00170             return rho_.f(p, T);
00171         }
00172 
00173         //- Vapour pressure [Pa]
00174         scalar pv(scalar p, scalar T) const
00175         {
00176             return pv_.f(p, T);
00177         }
00178 
00179         //- Heat of vapourisation [J/kg]
00180         scalar hl(scalar p, scalar T) const
00181         {
00182             return hl_.f(p, T);
00183         }
00184 
00185         //- Liquid heat capacity [J/(kg K)]
00186         scalar cp(scalar p, scalar T) const
00187         {
00188             return cp_.f(p, T);
00189         }
00190 
00191         //- Liquid Enthalpy [J/(kg)]
00192         scalar h(scalar p, scalar T) const
00193         {
00194             return h_.f(p, T);
00195         }
00196 
00197         //- Ideal gas heat capacity [J/(kg K)]
00198         scalar cpg(scalar p, scalar T) const
00199         {
00200             return cpg_.f(p, T);
00201         }
00202 
00203         //- Second Virial Coefficient [m^3/kg]
00204         scalar B(scalar p, scalar T) const
00205         {
00206             return B_.f(p, T);
00207         }
00208 
00209         //- Liquid viscosity [Pa s]
00210         scalar mu(scalar p, scalar T) const
00211         {
00212             return mu_.f(p, T);
00213         }
00214 
00215         //- Vapour viscosity [Pa s]
00216         scalar mug(scalar p, scalar T) const
00217         {
00218             return mug_.f(p, T);
00219         }
00220 
00221         //- Liquid thermal conductivity  [W/(m K)]
00222         scalar K(scalar p, scalar T) const
00223         {
00224             return K_.f(p, T);
00225         }
00226 
00227         //- Vapour thermal conductivity  [W/(m K)]
00228         scalar Kg(scalar p, scalar T) const
00229         {
00230             return Kg_.f(p, T);
00231         }
00232 
00233         //- Surface tension [N/m]
00234         scalar sigma(scalar p, scalar T) const
00235         {
00236             return sigma_.f(p, T);
00237         }
00238 
00239         //- Vapour diffussivity [m2/s]
00240         scalar D(scalar p, scalar T) const
00241         {
00242             return D_.f(p, T);
00243         }
00244 
00245 
00246         //- Write the function coefficients
00247         void writeData(Ostream& os) const
00248         {
00249             liquid::writeData(os); os << nl;
00250             rho_.writeData(os); os << nl;
00251             pv_.writeData(os); os << nl;
00252             hl_.writeData(os); os << nl;
00253             cp_.writeData(os); os << nl;
00254             cpg_.writeData(os); os << nl;
00255             B_.writeData(os); os << nl;
00256             mu_.writeData(os); os << nl;
00257             mug_.writeData(os); os << nl;
00258             K_.writeData(os); os << nl;
00259             Kg_.writeData(os); os << nl;
00260             sigma_.writeData(os); os << nl;
00261             D_.writeData(os); os << endl;
00262         }
00263 
00264 
00265     // Ostream Operator
00266 
00267         friend Ostream& operator<<(Ostream& os, const MB& l)
00268         {
00269             l.writeData(os);
00270             return os;
00271         }
00272 };
00273 
00274 
00275 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00276 
00277 } // End namespace Foam
00278 
00279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00280 
00281 #endif
00282 
00283 // ************************************************************************* //
For further information go to www.openfoam.org