Initial release of the new fireFoam solver and ancillary libraries.
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / basic / basicThermo / basicThermo.H
blob1c907edcf9ea3eb915d5a0102010c85abf619fb6
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 "volFields.H"
41 #include "typeInfo.H"
42 #include "IOdictionary.H"
43 #include "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             //- Total 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             //- Sensible enthalpy [J/kg]
166             //  Non-const access allowed for transport equations
167             virtual volScalarField& hs();
169             //- Enthalpy [J/kg]
170             virtual const volScalarField& hs() const;
172             //- Enthalpy for cell-set [J/kg]
173             virtual tmp<scalarField> hs
174             (
175                 const scalarField& T,
176                 const labelList& cells
177             ) const;
179             //- Enthalpy for patch [J/kg]
180             virtual tmp<scalarField> hs
181             (
182                 const scalarField& T,
183                 const label patchi
184             ) const;
186             //- Internal energy [J/kg]
187             //  Non-const access allowed for transport equations
188             virtual volScalarField& e();
190             //- Internal energy [J/kg]
191             virtual const volScalarField& e() const;
193             //- Internal energy for cell-set [J/kg]
194             virtual tmp<scalarField> e
195             (
196                 const scalarField& T,
197                 const labelList& cells
198             ) const;
200             //-Internal energy for patch [J/kg]
201             virtual tmp<scalarField> e
202             (
203                 const scalarField& T,
204                 const label patchi
205             ) const;
208         // Fields derived from thermodynamic state variables
210             //- Temperature [K]
211             virtual const volScalarField& T() const;
213             //- Heat capacity at constant pressure for patch [J/kg/K]
214             virtual tmp<scalarField> Cp
215             (
216                 const scalarField& T,
217                 const label patchi
218             ) const;
220             //- Heat capacity at constant pressure [J/kg/K]
221             virtual tmp<volScalarField> Cp() const;
223             //- Heat capacity at constant volume for patch [J/kg/K]
224             virtual tmp<scalarField> Cv
225             (
226                 const scalarField& T,
227                 const label patchi
228             ) const;
230             //- Heat capacity at constant volume [J/kg/K]
231             virtual tmp<volScalarField> Cv() const;
234         // Access to transport state variables
236             //- Dynamic viscosity of mixture [kg/m/s]
237             virtual const volScalarField& mu() const;
239             //- Thermal diffusivity for enthalpy of mixture [kg/m/s]
240             virtual const volScalarField& alpha() const;
243         //- Read thermophysicalProperties dictionary
244         virtual bool read();
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 } // End namespace Foam
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 #endif
256 // ************************************************************************* //