FreeFOAM The Cross-Platform CFD Toolkit
basicThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::basicThermo
26 
27 Description
28  Basic thermodynamic properties
29 
30 SourceFiles
31  basicThermo.C
32  newBasicThermo.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef basicThermo_H
37 #define basicThermo_H
38 
39 #include <finiteVolume/volFields.H>
40 #include <OpenFOAM/typeInfo.H>
41 #include <OpenFOAM/IOdictionary.H>
42 #include <OpenFOAM/autoPtr.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class basicThermo Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public IOdictionary
56 {
57 
58 protected:
59 
60  // Protected data
61 
62  // Fields
63 
64  //- Pressure [Pa]
66 
67  //- Compressibility [s^2/m^2]
69 
70  //- Temperature [K]
72 
73  //- Laminar dynamic viscosity [kg/m/s]
75 
76  //- Laminar thermal diffusuvity [kg/m/s]
78 
79 
80  // Protected member functions
81 
82  // Enthalpy
83 
84  //- Return the enthalpy field boundary types by interrogating the
85  // temperature field boundary types
87 
88  //- Correct the enthalpy field boundaries
90 
91 
92  // Internal energy
93 
94  //- Return the internal energy field boundary types by
95  // interrogating the temperature field boundary types
97 
98  //- Correct the internal energy field boundaries
100 
101 
102  //- Construct as copy (not implemented)
103  basicThermo(const basicThermo&);
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("basicThermo");
110 
111 
112  // Constructors
113 
114  //- Construct from mesh
115  basicThermo(const fvMesh&);
116 
117 
118  //- Destructor
119  virtual ~basicThermo();
120 
121 
122  // Member functions
123 
124  //- Update properties
125  virtual void correct() = 0;
126 
127 
128  // Access to thermodynamic state variables
129 
130  //- Pressure [Pa]
131  // Non-const access allowed for transport equations
132  virtual volScalarField& p();
133 
134  //- Pressure [Pa]
135  virtual const volScalarField& p() const;
136 
137  //- Density [kg/m^3]
138  virtual tmp<volScalarField> rho() const = 0;
139 
140  //- Compressibility [s^2/m^2]
141  virtual const volScalarField& psi() const;
142 
143  //- Total enthalpy [J/kg]
144  // Non-const access allowed for transport equations
145  virtual volScalarField& h();
146 
147  //- Total enthalpy [J/kg]
148  virtual const volScalarField& h() const;
149 
150  //- Total enthalpy for cell-set [J/kg]
151  virtual tmp<scalarField> h
152  (
153  const scalarField& T,
154  const labelList& cells
155  ) const;
156 
157  //- Total enthalpy for patch [J/kg]
158  virtual tmp<scalarField> h
159  (
160  const scalarField& T,
161  const label patchi
162  ) const;
163 
164  //- Sensible enthalpy [J/kg]
165  // Non-const access allowed for transport equations
166  virtual volScalarField& hs();
167 
168  //- Sensible enthalpy [J/kg]
169  virtual const volScalarField& hs() const;
170 
171  //- Sensible enthalpy for cell-set [J/kg]
172  virtual tmp<scalarField> hs
173  (
174  const scalarField& T,
175  const labelList& cells
176  ) const;
177 
178  //- Sensible enthalpy for patch [J/kg]
179  virtual tmp<scalarField> hs
180  (
181  const scalarField& T,
182  const label patchi
183  ) const;
184 
185  //- Chemical enthalpy [J/kg]
186  virtual tmp<volScalarField> hc() const;
187 
188  //- Internal energy [J/kg]
189  // Non-const access allowed for transport equations
190  virtual volScalarField& e();
191 
192  //- Internal energy [J/kg]
193  virtual const volScalarField& e() const;
194 
195  //- Internal energy for cell-set [J/kg]
196  virtual tmp<scalarField> e
197  (
198  const scalarField& T,
199  const labelList& cells
200  ) const;
201 
202  //- Internal energy for patch [J/kg]
203  virtual tmp<scalarField> e
204  (
205  const scalarField& T,
206  const label patchi
207  ) const;
208 
209 
210  // Fields derived from thermodynamic state variables
211 
212  //- Temperature [K]
213  virtual const volScalarField& T() const;
214 
215  //- Heat capacity at constant pressure for patch [J/kg/K]
216  virtual tmp<scalarField> Cp
217  (
218  const scalarField& T,
219  const label patchi
220  ) const;
221 
222  //- Heat capacity at constant pressure [J/kg/K]
223  virtual tmp<volScalarField> Cp() const;
224 
225  //- Heat capacity at constant volume for patch [J/kg/K]
226  virtual tmp<scalarField> Cv
227  (
228  const scalarField& T,
229  const label patchi
230  ) const;
231 
232  //- Heat capacity at constant volume [J/kg/K]
233  virtual tmp<volScalarField> Cv() const;
234 
235 
236  // Access to transport state variables
237 
238  //- Dynamic viscosity of mixture [kg/m/s]
239  virtual const volScalarField& mu() const;
240 
241  //- Thermal diffusivity for enthalpy of mixture [kg/m/s]
242  virtual const volScalarField& alpha() const;
243 
244 
245  //- Read thermophysicalProperties dictionary
246  virtual bool read();
247 };
248 
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 } // End namespace Foam
253 
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 
256 #endif
257 
258 // ************************ vim: set sw=4 sts=4 et: ************************ //