OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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