1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Basic thermodynamic properties
35 \*---------------------------------------------------------------------------*/
40 #include <finiteVolume/volFields.H>
41 #include <OpenFOAM/typeInfo.H>
42 #include <OpenFOAM/IOdictionary.H>
43 #include <OpenFOAM/autoPtr.H>
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class basicThermo Declaration
52 \*---------------------------------------------------------------------------*/
68 //- Compressibility [s^2/m^2]
74 //- Laminar dynamic viscosity [kg/m/s]
77 //- Laminar thermal diffusuvity [kg/m/s]
78 volScalarField alpha_;
81 // Protected member functions
85 //- Return the enthalpy field boundary types by interrogating the
86 // temperature field boundary types
87 wordList hBoundaryTypes();
89 //- Correct the enthalpy field boundaries
90 void hBoundaryCorrection(volScalarField& h);
95 //- Return the internal energy field boundary types by
96 // interrogating the temperature field boundary types
97 wordList eBoundaryTypes();
99 //- Correct the internal energy field boundaries
100 void eBoundaryCorrection(volScalarField& e);
103 //- Construct as copy (not implemented)
104 basicThermo(const basicThermo&);
109 //- Runtime type information
110 TypeName("basicThermo");
115 //- Construct from mesh
116 basicThermo(const fvMesh&);
120 virtual ~basicThermo();
125 //- Update properties
126 virtual void correct() = 0;
129 // Access to thermodynamic state variables
132 // Non-const access allowed for transport equations
133 virtual volScalarField& p();
136 virtual const volScalarField& p() const;
139 virtual tmp<volScalarField> rho() const = 0;
141 //- Compressibility [s^2/m^2]
142 virtual const volScalarField& psi() const;
145 // Non-const access allowed for transport equations
146 virtual volScalarField& h();
149 virtual const volScalarField& h() const;
151 //- Enthalpy for cell-set [J/kg]
152 virtual tmp<scalarField> h
154 const scalarField& T,
155 const labelList& cells
158 //- Enthalpy for patch [J/kg]
159 virtual tmp<scalarField> h
161 const scalarField& T,
165 //- Internal energy [J/kg]
166 // Non-const access allowed for transport equations
167 virtual volScalarField& e();
169 //- Internal energy [J/kg]
170 virtual const volScalarField& e() const;
172 //- Internal energy for cell-set [J/kg]
173 virtual tmp<scalarField> e
175 const scalarField& T,
176 const labelList& cells
179 //-Internal energy for patch [J/kg]
180 virtual tmp<scalarField> e
182 const scalarField& T,
187 // Fields derived from thermodynamic state variables
190 virtual const volScalarField& T() const;
192 //- Heat capacity at constant pressure for patch [J/kg/K]
193 virtual tmp<scalarField> Cp
195 const scalarField& T,
199 //- Heat capacity at constant pressure [J/kg/K]
200 virtual tmp<volScalarField> Cp() const;
202 //- Heat capacity at constant volume for patch [J/kg/K]
203 virtual tmp<scalarField> Cv
205 const scalarField& T,
209 //- Heat capacity at constant volume [J/kg/K]
210 virtual tmp<volScalarField> Cv() const;
213 // Access to transport state variables
215 //- Dynamic viscosity of mixture [kg/m/s]
216 virtual const volScalarField& mu() const;
218 //- Thermal diffusivity for enthalpy of mixture [kg/m/s]
219 virtual const volScalarField& alpha() const;
222 //- Read thermophysicalProperties dictionary
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace Foam
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 // ************************ vim: set sw=4 sts=4 et: ************************ //