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

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