energyTransport.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::functionObjects::energyTransport
28
29Group
30 grpSolversFunctionObjects
31
32Description
33 Evolves a simplified energy transport equation for incompressible flows.
34 It takes into account the inertia, conduction and convection terms plus
35 a source.
36
37 - The field name must be temperature and its BC's specified in the time
38 directory.
39 - The turbulence model should be incompressible
40 - In order to use in a incompressible multi phase a list of thermal
41 properties are needed. See below
42
43
44Usage
45 Example of function object specification to solve a energy transport
46 equation for a single phase flow plus a source term
47 \verbatim
48 functions
49 {
50 energy
51 {
52 type energyTransport;
53 libs (energyTransportFunctionObjects);
54
55 enabled true;
56 writeControl outputTime;
57 writeInterval 1;
58
59 field T;
60
61 // volumetric Flux
62 phi phi;
63
64 // Thermal properties
65 Cp Cp [J/kg/K] 1e3;
66 kappa kappa [W/m/K] 0.0257;
67 rhoInf rho [kg/m^3] 1.2;
68
69 write true;
70
71 fvOptions
72 {
73 viscousDissipation
74 {
75 type viscousDissipation;
76 enabled true;
77
78 viscousDissipationCoeffs
79 {
80 fields (T);
81 rhoInf $....rhoInf;
82 }
83 }
84 }
85 }
86 }
87 \endverbatim
88
89 Example of function object specification to solve a energy transport
90 equation for a multiphase phase flow plus a source term
91
92 equation:
93 \verbatim
94 functions
95 {
96 energy
97 {
98 type energyTransport;
99 libs (energyTransportFunctionObjects);
100
101 enabled true;
102 writeControl outputTime;
103 writeInterval 1;
104
105 field T;
106
107 // rho field name
108 rho rho;
109 // mass flux for multiphase
110 phi rhoPhi;
111
112 write true;
113
114 // Thermal properties of the phases
115 phaseThermos
116 {
117 alpha.air
118 {
119 Cp 1e3;
120 kappa 0.0243;
121 }
122 alpha.mercury
123 {
124 Cp 140;
125 kappa 8.2;
126 }
127 alpha.oil
128 {
129 Cp 2e3;
130 kappa 0.2;
131 }
132 alpha.water
133 {
134 Cp 4e3;
135 kappa 0.6;
136 }
137 }
138
139
140 fvOptions
141 {
142 viscousDissipation
143 {
144 type viscousDissipation;
145 enabled true;
146
147 viscousDissipationCoeffs
148 {
149 fields (T);
150 rho rho; //rho Field
151 }
152 }
153 }
154 }
155 }
156 \endverbatim
157
158 Where the entries comprise:
159 \table
160 Property | Description | Required | Default value
161 type | Type name: energyTransport | yes |
162 field | Name of the scalar field | no | T
163 phi | Name of flux field | no | phi
164 rho | Name of density field | no | rho
165 nCorr | Number of correctors | no | 0
166 schemesField | Name of field to specify schemes | no | field name
167 fvOptions | List of scalar sources | no |
168 Cp | Heat capacity for single phase | no | 0
169 rhoInf | Density for single phase | no | 0
170 kappa | Thermal conductivity for single phase | no | 0
171 Prt | Turbulent Prandlt number | no | 1.0
172 phaseThermos | Dictionary for multi-phase thermo |no | null
173 fvOptions | Opotional extra sources | no | null
174 \endtable
175
176See also
177 Foam::functionObjects::fvMeshFunctionObject
178
179SourceFiles
180 energyTransport.C
181
182\*---------------------------------------------------------------------------*/
183
184#ifndef functionObjects_energyTransport_H
185#define functionObjects_energyTransport_H
186
187#include "fvMeshFunctionObject.H"
188#include "volFields.H"
189#include "fvOptionList.H"
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193namespace Foam
194{
195namespace functionObjects
196{
197
198/*---------------------------------------------------------------------------*\
199 Class energyTransport Declaration
200\*---------------------------------------------------------------------------*/
201
202class energyTransport
203:
204 public fvMeshFunctionObject
205{
206 // Private data
207
208 //- Name of the transport field.
209 word fieldName_;
210
211 //- Name of flux field
212 word phiName_;
213
214 //- Name of density field
215 word rhoName_;
216
217 //- Number of corrector iterations (optional)
218 label nCorr_;
219
220 //- Name of field whose schemes are used (optional)
221 word schemesField_;
222
223 //- Run-time selectable finite volume options, e.g. sources, constraints
224 fv::optionList fvOptions_;
225
226 //- Dictionary for multiphase thermos
227 dictionary multiphaseThermo_;
228
229 //- List of phase names
230 wordList phaseNames_;
231
232 //- List of phase heat capacities
233 PtrList<dimensionedScalar> Cps_;
234
235 //- List of phase thermal diffusivity for temperature [J/m/s/K]
236 PtrList<dimensionedScalar> kappas_;
237
238 //- Unallocated phase list
239 UPtrList<volScalarField> phases_;
240
241 //- Heat capacity for single phase flows
243
244 //- Thermal diffusivity for temperature for single phase flows
245 dimensionedScalar kappa_;
246
247 //- Density for single phase flows
249
250 //- Turbulent Prandt number
252
253 //- rhoCp
254 volScalarField rhoCp_;
255
256
257 // Private Member Functions
258
259 //- Return reference to registered transported field
260 volScalarField& transportedField();
261
262 //- Return the diffusivity field
263 tmp<volScalarField> kappaEff() const;
264
265 //- Return rho field
266 tmp<volScalarField> rho() const;
267
268 //- Return Cp
269 tmp<volScalarField> Cp() const;
270
271 //- Return kappa
272 tmp<volScalarField> kappa() const;
273
274 //- No copy construct
275 energyTransport(const energyTransport&) = delete;
276
277 //- No copy assignment
278 void operator=(const energyTransport&) = delete;
279
280
281public:
282
283 //- Runtime type information
284 TypeName("energyTransport");
285
286
287 // Constructors
288
289 //- Construct from Time and dictionary
291 (
292 const word& name,
293 const Time& runTime,
294 const dictionary& dict
295 );
296
297
298 //- Destructor
299 virtual ~energyTransport();
300
301
302 // Member Functions
303
304 //- Read the energyTransport data
305 virtual bool read(const dictionary&);
306
307 //- Calculate the energyTransport
308 virtual bool execute();
309
310 //- Do nothing.
311 // The volScalarField is registered and written automatically
312 virtual bool write();
313};
314
315
316// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
317
318} // End namespace functionObjects
319} // End namespace Foam
320
321// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
322
323#endif
324
325// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Evolves a simplified energy transport equation for incompressible flows. It takes into account the in...
virtual bool execute()
Calculate the energyTransport.
virtual bool read(const dictionary &)
Read the energyTransport data.
TypeName("energyTransport")
Runtime type information.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
List of finite volume options.
Definition: fvOptionList.H:72
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
List< word > wordList
A List of words.
Definition: fileName.H:63
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73