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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::functionObjects::wallHeatFlux
29 
30 Group
31  grpForcesFunctionObjects
32 
33 Description
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 
45 Usage
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 
81 See also
82  - Foam::functionObject
83  - Foam::functionObjects::fvMeshFunctionObject
84  - Foam::functionObjects::writeFile
85  - ExtendedCodeGuide::functionObjects::field::wallHeatFlux
86 
87 SourceFiles
88  wallHeatFlux.C
89 
90 \*---------------------------------------------------------------------------*/
91 
92 #ifndef functionObjects_wallHeatFlux_H
93 #define functionObjects_wallHeatFlux_H
94 
95 #include "fvMeshFunctionObject.H"
96 #include "writeFile.H"
97 #include "volFieldsFwd.H"
98 #include "HashSet.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 namespace functionObjects
105 {
106 
107 /*---------------------------------------------------------------------------*\
108  Class wallHeatFlux Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 class wallHeatFlux
112 :
113  public fvMeshFunctionObject,
114  public writeFile
115 {
116 protected:
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,
138  );
139 
140 
141 public:
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 // ************************************************************************* //
Foam::functionObjects::wallHeatFlux
Computes the wall-heat flux at selected wall patches.
Definition: wallHeatFlux.H:160
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
writeFile.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fvMeshFunctionObject.H
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::functionObjects::wallHeatFlux::calcHeatFlux
void calcHeatFlux(const volScalarField &alpha, const volScalarField &he, volScalarField &wallHeatFlux)
Calculate the heat-flux.
Definition: wallHeatFlux.C:65
Foam::functionObjects::wallHeatFlux::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: wallHeatFlux.C:52
Foam::HashSet< label, Hash< label > >
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::wallHeatFlux::execute
virtual bool execute()
Calculate the wall heat-flux.
Definition: wallHeatFlux.C:195
Foam::functionObjects::wallHeatFlux::TypeName
TypeName("wallHeatFlux")
Runtime type information.
Foam::functionObjects::wallHeatFlux::qrName_
word qrName_
Name of radiative heat flux name.
Definition: wallHeatFlux.H:173
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
HashSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::functionObjects::wallHeatFlux::~wallHeatFlux
virtual ~wallHeatFlux()=default
Destructor.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::functionObjects::wallHeatFlux::read
virtual bool read(const dictionary &dict)
Read the wallHeatFlux data.
Definition: wallHeatFlux.C:138
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
he
volScalarField & he
Definition: YEEqn.H:52
Foam::functionObjects::wallHeatFlux::wallHeatFlux
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: wallHeatFlux.C:100
Foam::functionObjects::wallHeatFlux::write
virtual bool write()
Write the wall heat-flux.
Definition: wallHeatFlux.C:285
Foam::functionObjects::wallHeatFlux::patchSet_
labelHashSet patchSet_
Optional list of wall patches to process.
Definition: wallHeatFlux.H:170
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::functionObjects::wallHeatFlux::operator=
void operator=(const wallHeatFlux &)=delete
No copy assignment.