wallHeatFlux.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) 2016-2017 OpenFOAM Foundation
9 Copyright (C) 2016-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::functionObjects::wallHeatFlux
29
30Group
31 grpForcesFunctionObjects
32
33Description
34 Computes the wall-heat flux at selected wall patches.
35
36 \table
37 Operand | Type | Location
38 input | - | -
39 output file | dat <!--
40 --> | $FOAM_CASE/postProcessing/<FO>/<time>/<field>
41 output field | volScalarField (only boundaryField) <!--
42 --> | $FOAM_CASE/<time>/<outField>
43 \endtable
44
45Usage
46 Minimal example by using \c system/controlDict.functions:
47 \verbatim
48 wallHeatFlux1
49 {
50 // Mandatory entries (unmodifiable)
51 type wallHeatFlux;
52 libs (fieldFunctionObjects);
53
54 // Optional entries (runtime modifiable)
55 patches (<patch1> ... <patchN>); // (wall1 "(wall2|wall3)");
56 qr qr;
57
58 // Optional (inherited) entries
59 ...
60 }
61 \endverbatim
62
63 where the entries mean:
64 \table
65 Property | Description | Type | Req'd | Dflt
66 type | Type name: wallHeatFlux | word | yes | -
67 libs | Library name: fieldFunctionObjects | word | yes | -
68 patches | Names of operand patches | wordList | no | all wall patches
69 qr | Name of radiative heat flux field | word | no | qr
70 \endtable
71
72 The inherited entries are elaborated in:
73 - \link functionObject.H \endlink
74 - \link writeFile.H \endlink
75
76 Minimal example by using the \c postProcess utility:
77 \verbatim
78 <solver> -postProcess -func wallHeatFlux
79 \endverbatim
80
81See also
82 - Foam::functionObject
83 - Foam::functionObjects::fvMeshFunctionObject
84 - Foam::functionObjects::writeFile
85 - ExtendedCodeGuide::functionObjects::field::wallHeatFlux
86
87SourceFiles
88 wallHeatFlux.C
89
90\*---------------------------------------------------------------------------*/
91
92#ifndef functionObjects_wallHeatFlux_H
93#define functionObjects_wallHeatFlux_H
94
96#include "writeFile.H"
97#include "volFieldsFwd.H"
98#include "HashSet.H"
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102namespace Foam
103{
104namespace functionObjects
105{
106
107/*---------------------------------------------------------------------------*\
108 Class wallHeatFlux Declaration
109\*---------------------------------------------------------------------------*/
110
111class wallHeatFlux
112:
113 public fvMeshFunctionObject,
114 public writeFile
115{
116protected:
117
118 // Protected Data
119
120 //- Optional list of wall patches to process
122
123 //- Name of radiative heat flux name
124 word qrName_;
125
126
127 // Protected Member Functions
128
129 //- File header information
130 virtual void writeFileHeader(Ostream& os) const;
131
132 //- Calculate the heat-flux
133 void calcHeatFlux
134 (
135 const volScalarField& alpha,
136 const volScalarField& he,
137 volScalarField& wallHeatFlux
138 );
139
140
141public:
142
143 //- Runtime type information
144 TypeName("wallHeatFlux");
145
146
147 // Constructors
148
149 //- Construct from Time and dictionary
151 (
152 const word& name,
153 const Time& runTime,
154 const dictionary&
155 );
156
157 //- No copy construct
158 wallHeatFlux(const wallHeatFlux&) = delete;
159
160 //- No copy assignment
161 void operator=(const wallHeatFlux&) = delete;
162
163
164 //- Destructor
165 virtual ~wallHeatFlux() = default;
166
167
168 // Member Functions
169
170 //- Read the wallHeatFlux data
171 virtual bool read(const dictionary& dict);
172
173 //- Calculate the wall heat-flux
174 virtual bool execute();
175
176 //- Write the wall heat-flux
177 virtual bool write();
178};
179
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183} // End namespace functionObjects
184} // End namespace Foam
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#endif
189
190// ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:52
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
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.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the wall-heat flux at selected wall patches.
Definition: wallHeatFlux.H:164
wallHeatFlux(const wallHeatFlux &)=delete
No copy construct.
virtual ~wallHeatFlux()=default
Destructor.
word qrName_
Name of radiative heat flux name.
Definition: wallHeatFlux.H:173
virtual bool read(const dictionary &dict)
Read the wallHeatFlux data.
Definition: wallHeatFlux.C:139
TypeName("wallHeatFlux")
Runtime type information.
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: wallHeatFlux.C:53
void operator=(const wallHeatFlux &)=delete
No copy assignment.
labelHashSet patchSet_
Optional list of wall patches to process.
Definition: wallHeatFlux.H:170
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: wallHeatFlux.C:101
virtual bool execute()
Calculate the wall heat-flux.
Definition: wallHeatFlux.C:196
virtual bool write()
Write the wall heat-flux.
Definition: wallHeatFlux.C:299
void calcHeatFlux(const volScalarField &alpha, const volScalarField &he, volScalarField &wallHeatFlux)
Calculate the heat-flux.
Definition: wallHeatFlux.C:66
Base class for writing single files from the function objects.
Definition: writeFile.H:120
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
volScalarField & alpha
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73