1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Basic thermodynamic properties
34 \*---------------------------------------------------------------------------*/
39 #include "volFields.H"
41 #include "IOdictionary.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class basicThermo Declaration
51 \*---------------------------------------------------------------------------*/
67 //- Compressibility [s^2/m^2]
73 //- Laminar dynamic viscosity [kg/m/s]
76 //- Laminar thermal diffusuvity [kg/m/s]
77 volScalarField alpha_;
80 // Protected Member Functions
84 //- Return the enthalpy field boundary types by interrogating the
85 // temperature field boundary types
86 wordList hBoundaryTypes();
88 //- Correct the enthalpy field boundaries
89 void hBoundaryCorrection(volScalarField& h);
94 //- Return the internal energy field boundary types by
95 // interrogating the temperature field boundary types
96 wordList eBoundaryTypes();
98 //- Correct the internal energy field boundaries
99 void eBoundaryCorrection(volScalarField& e);
102 //- Construct as copy (not implemented)
103 basicThermo(const basicThermo&);
108 //- Runtime type information
109 TypeName("basicThermo");
114 //- Construct from mesh
115 basicThermo(const fvMesh&);
119 virtual ~basicThermo();
124 //- Update properties
125 virtual void correct() = 0;
128 // Access to thermodynamic state variables
131 // Non-const access allowed for transport equations
132 virtual volScalarField& p();
135 virtual const volScalarField& p() const;
138 virtual tmp<volScalarField> rho() const = 0;
140 //- Compressibility [s^2/m^2]
141 virtual const volScalarField& psi() const;
143 //- Total enthalpy [J/kg]
144 // Non-const access allowed for transport equations
145 virtual volScalarField& h();
147 //- Total enthalpy [J/kg]
148 virtual const volScalarField& h() const;
150 //- Total enthalpy for cell-set [J/kg]
151 virtual tmp<scalarField> h
153 const scalarField& T,
154 const labelList& cells
157 //- Total enthalpy for patch [J/kg]
158 virtual tmp<scalarField> h
160 const scalarField& T,
164 //- Sensible enthalpy [J/kg]
165 // Non-const access allowed for transport equations
166 virtual volScalarField& hs();
168 //- Sensible enthalpy [J/kg]
169 virtual const volScalarField& hs() const;
171 //- Sensible enthalpy for cell-set [J/kg]
172 virtual tmp<scalarField> hs
174 const scalarField& T,
175 const labelList& cells
178 //- Sensible enthalpy for patch [J/kg]
179 virtual tmp<scalarField> hs
181 const scalarField& T,
185 //- Chemical enthalpy [J/kg]
186 virtual tmp<volScalarField> hc() const;
188 //- Internal energy [J/kg]
189 // Non-const access allowed for transport equations
190 virtual volScalarField& e();
192 //- Internal energy [J/kg]
193 virtual const volScalarField& e() const;
195 //- Internal energy for cell-set [J/kg]
196 virtual tmp<scalarField> e
198 const scalarField& T,
199 const labelList& cells
202 //- Internal energy for patch [J/kg]
203 virtual tmp<scalarField> e
205 const scalarField& T,
210 // Fields derived from thermodynamic state variables
213 virtual const volScalarField& T() const;
215 //- Heat capacity at constant pressure for patch [J/kg/K]
216 virtual tmp<scalarField> Cp
218 const scalarField& T,
222 //- Heat capacity at constant pressure [J/kg/K]
223 virtual tmp<volScalarField> Cp() const;
225 //- Heat capacity at constant volume for patch [J/kg/K]
226 virtual tmp<scalarField> Cv
228 const scalarField& T,
232 //- Heat capacity at constant volume [J/kg/K]
233 virtual tmp<volScalarField> Cv() const;
236 // Access to transport state variables
238 //- Dynamic viscosity of mixture [kg/m/s]
239 virtual const volScalarField& mu() const;
241 //- Thermal diffusivity for enthalpy of mixture [kg/m/s]
242 virtual const volScalarField& alpha() const;
245 //- Read thermophysicalProperties dictionary
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 } // End namespace Foam
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
258 // ************************************************************************* //