Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / src / thermophysicalModels / basic / basicThermo / basicThermo.H
blob99a2664469fef5fe362e55b13232d4948bf85a2a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::basicThermo
28 Description
29     Basic thermodynamic properties
31 SourceFiles
32     basicThermo.C
33     newBasicThermo.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef basicThermo_H
38 #define basicThermo_H
40 #include <finiteVolume/volFields.H>
41 #include <OpenFOAM/typeInfo.H>
42 #include <OpenFOAM/IOdictionary.H>
43 #include <OpenFOAM/autoPtr.H>
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                         Class basicThermo Declaration
52 \*---------------------------------------------------------------------------*/
54 class basicThermo
56     public IOdictionary
59 protected:
61     // Protected data
63         // Fields
65             //- Pressure [Pa]
66             volScalarField p_;
68             //- Compressibility [s^2/m^2]
69             volScalarField psi_;
71             //- Temperature [K]
72             volScalarField T_;
74             //- Laminar dynamic viscosity [kg/m/s]
75             volScalarField mu_;
77             //- Laminar thermal diffusuvity [kg/m/s]
78             volScalarField alpha_;
81     // Protected member functions
83         // Enthalpy
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);
93         // Internal energy
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&);
107 public:
109     //- Runtime type information
110     TypeName("basicThermo");
113     // Constructors
115         //- Construct from mesh
116         basicThermo(const fvMesh&);
119     //- Destructor
120     virtual ~basicThermo();
123     // Member functions
125         //- Update properties
126         virtual void correct() = 0;
129         // Access to thermodynamic state variables
131             //- Pressure [Pa]
132             //  Non-const access allowed for transport equations
133             virtual volScalarField& p();
135             //- Pressure [Pa]
136             virtual const volScalarField& p() const;
138             //- Density [kg/m^3]
139             virtual tmp<volScalarField> rho() const = 0;
141             //- Compressibility [s^2/m^2]
142             virtual const volScalarField& psi() const;
144             //- Enthalpy [J/kg]
145             //  Non-const access allowed for transport equations
146             virtual volScalarField& h();
148             //- Enthalpy [J/kg]
149             virtual const volScalarField& h() const;
151             //- Enthalpy for cell-set [J/kg]
152             virtual tmp<scalarField> h
153             (
154                 const scalarField& T,
155                 const labelList& cells
156             ) const;
158             //- Enthalpy for patch [J/kg]
159             virtual tmp<scalarField> h
160             (
161                 const scalarField& T,
162                 const label patchi
163             ) const;
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
174             (
175                 const scalarField& T,
176                 const labelList& cells
177             ) const;
179             //-Internal energy for patch [J/kg]
180             virtual tmp<scalarField> e
181             (
182                 const scalarField& T,
183                 const label patchi
184             ) const;
187         // Fields derived from thermodynamic state variables
189             //- Temperature [K]
190             virtual const volScalarField& T() const;
192             //- Heat capacity at constant pressure for patch [J/kg/K]
193             virtual tmp<scalarField> Cp
194             (
195                 const scalarField& T,
196                 const label patchi
197             ) const;
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
204             (
205                 const scalarField& T,
206                 const label patchi
207             ) const;
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
223         virtual bool read();
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace Foam
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 #endif
235 // ************************ vim: set sw=4 sts=4 et: ************************ //