OpenFOAM logo
Open Source CFD Toolkit

basicThermo.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     basicThermo
00027 
00028 Description
00029 
00030 SourceFiles
00031     basicThermo.C
00032     newBasicThermo.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef basicThermo_H
00037 #define basicThermo_H
00038 
00039 #include "volFields.H"
00040 #include "typeInfo.H"
00041 #include "IOdictionary.H"
00042 #include "autoPtr.H"
00043 #include "runTimeSelectionTables.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class basicThermo Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class basicThermo
00055 :
00056     public IOdictionary
00057 {
00058 
00059 protected:
00060 
00061     // Protected data
00062 
00063         volScalarField p_;
00064         volScalarField T_;
00065         volScalarField psi_;
00066 
00067         volScalarField mu_;
00068         volScalarField alpha_;
00069 
00070 
00071     // Protected member functions
00072 
00073         wordList hBoundaryTypes();
00074         void hBoundaryCorrection(volScalarField& h);
00075 
00076         //- Construct as copy (not implemented)
00077         basicThermo(const basicThermo&);
00078 
00079 
00080 public:
00081 
00082     //- Runtime type information
00083     TypeName("basicThermo");
00084 
00085 
00086     // Declare run-time constructor selection table
00087 
00088         declareRunTimeSelectionTable
00089         (
00090             autoPtr,
00091             basicThermo,
00092             fvMesh,
00093             (const fvMesh& mesh),
00094             (mesh)
00095         );
00096 
00097 
00098     // Constructors
00099 
00100         //- Construct from mesh
00101         basicThermo(const fvMesh&);
00102 
00103 
00104     // Selectors
00105 
00106         static autoPtr<basicThermo> New(const fvMesh&);
00107 
00108 
00109     // Destructor
00110 
00111         virtual ~basicThermo();
00112 
00113 
00114     // Member functions
00115 
00116         //- Update properties
00117         virtual void correct() = 0;
00118 
00119 
00120         // Access to thermodynamic state variables.
00121 
00122             //- Pressure [Pa]
00123             //  Non-const access allowed for transport equations
00124             volScalarField& p()
00125             {
00126                 return p_;
00127             }
00128 
00129             //- Pressure [Pa]
00130             const volScalarField& p() const
00131             {
00132                 return p_;
00133             }
00134 
00135             //- Enthalpy [J/kg]
00136             //  Non-const access allowed for transport equations
00137             virtual volScalarField& h()
00138             {
00139                 notImplemented("basicThermo::h()");
00140                 return volScalarField::null();
00141             }
00142 
00143             //- Enthalpy [J/kg]
00144             virtual const volScalarField& h() const
00145             {
00146                 notImplemented("basicThermo::h() const");
00147                 return volScalarField::null();
00148             }
00149 
00150             //- Enthalpy for cell-set [J/kg]
00151             virtual tmp<scalarField> h
00152             (
00153                 const scalarField& T,
00154                 const labelList& cells
00155             ) const
00156             {
00157                 notImplemented
00158                 (
00159                     "basicThermo::h"
00160                     "(const scalarField& T, const labelList& cells) const"
00161                 );
00162                 return tmp<scalarField>(NULL);
00163             }
00164 
00165             //- Enthalpy for patch [J/kg]
00166             virtual tmp<scalarField> h
00167             (
00168                 const scalarField& T,
00169                 const label patchi
00170             ) const
00171             {
00172                 notImplemented
00173                 (
00174                     "basicThermo::h"
00175                     "(const scalarField& T, const label patchi) const"
00176                 );
00177                 return tmp<scalarField>(NULL);
00178             }
00179 
00180             //- Internal energy [J/kg]
00181             //  Non-const access allowed for transport equations
00182             virtual volScalarField& e()
00183             {
00184                 notImplemented("basicThermo::e()");
00185                 return volScalarField::null();
00186             }
00187 
00188             //- Internal energy [J/kg]
00189             virtual const volScalarField& e() const
00190             {
00191                 notImplemented("basicThermo::e()");
00192                 return volScalarField::null();
00193             }
00194 
00195 
00196         // Fields derived from thermodynamic state variables
00197 
00198             //- Temperature [K]
00199             const volScalarField& T() const
00200             {
00201                 return T_;
00202             }
00203 
00204             //- Density [kg/m^3]
00205             tmp<volScalarField> rho() const
00206             {
00207                 return p_*psi();
00208             }
00209 
00210             //- Compressibility [s^2/m^2]
00211             const volScalarField& psi() const
00212             {
00213                 return psi_;
00214             }
00215 
00216             //- Heat capacity at constant pressure for patch [J/kg/K]
00217             virtual tmp<scalarField> Cp
00218             (
00219                 const scalarField& T,
00220                 const label patchi
00221             ) const
00222             {
00223                 notImplemented
00224                 (
00225                     "basicThermo::Cp"
00226                     "(const scalarField& T, const label patchi) const"
00227                 );
00228                 return tmp<scalarField>(NULL);
00229             }
00230 
00231             //- Heat capacity at constant pressure [J/kg/K]
00232             virtual tmp<volScalarField> Cp() const
00233             {
00234                 notImplemented("basicThermo::Cp() const");
00235                 return volScalarField::null();
00236             }
00237 
00238             //- Heat capacity at constant volume [J/kg/K]
00239             virtual tmp<volScalarField> Cv() const
00240             {
00241                 notImplemented("basicThermo::Cv() const");
00242                 return volScalarField::null();
00243             }
00244 
00245 
00246         // Access to transport state variables
00247 
00248             //- Dynamic viscosity of mixture [kg/ms]
00249             const volScalarField& mu() const
00250             {
00251                 return mu_;
00252             }
00253 
00254             //- Thermal diffusivity for enthalpy of mixture [W/mK]
00255             const volScalarField& alpha() const
00256             {
00257                 return alpha_;
00258             }
00259 
00260 
00261         //- Read thermophysicalProperties dictionary
00262         virtual bool read() = 0;
00263 };
00264 
00265 
00266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00267 
00268 } // End namespace Foam
00269 
00270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00271 
00272 #endif
00273 
00274 // ************************************************************************* //
For further information go to www.openfoam.org