wallHeatFlux.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
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::functionObjects::wallHeatFlux
26 
27 Description
28  Calculates and write the heat-flux at wall patches as the
29  volScalarField field 'wallHeatFlux'.
30 
31  All wall patches are included by default; to restrict the calculation to
32  certain patches, use the optional 'patches' entry.
33 
34  Example of function object specification:
35  \verbatim
36  wallHeatFlux1
37  {
38  type wallHeatFlux;
39  libs ("libfieldFunctionObjects.so");
40  ...
41  region fluid;
42  patches (".*Wall");
43  }
44  \endverbatim
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  type | type name: wallHeatFlux | yes |
50  patches | list of patches to process | no | all wall patches
51  region | region to be evaluated | no | default region
52  \endtable
53 
54  Note:
55  Writing field 'wallHeatFlux' is done by default, but it can be
56  overridden by defining an empty \c objects list. For details see
57  writeLocalObjects.
58 
59 See also
60  Foam::functionObject
61  Foam::functionObjects::fvMeshFunctionObject
62  Foam::functionObjects::logFiles
63  Foam::functionObjects::writeLocalObjects
64  Foam::functionObjects::timeControl
65 
66 SourceFiles
67  wallHeatFlux.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef functionObjects_wallHeatFlux_H
72 #define functionObjects_wallHeatFlux_H
73 
74 #include "fvMeshFunctionObject.H"
75 #include "logFiles.H"
76 #include "writeLocalObjects.H"
77 #include "HashSet.H"
78 #include "volFieldsFwd.H"
79 #include "surfaceFieldsFwd.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 namespace functionObjects
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class wallHeatFlux Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class wallHeatFlux
93 :
94  public fvMeshFunctionObject,
95  public logFiles,
96  public writeLocalObjects
97 {
98  // Private Data
99 
100  //- The name of the phase
101  word phaseName_;
102 
103  //- Optional list of patches to process
104  labelHashSet patchSet_;
105 
106 
107  // Private Member Functions
108 
109  //- File header information
110  virtual void writeFileHeader(const label i);
112  //- Calculate the heat-flux
113  tmp<volScalarField> calcWallHeatFlux(const surfaceScalarField& q);
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("wallHeatFlux");
120 
121 
122  // Constructors
123 
124  //- Construct from Time and dictionary
126  (
127  const word& name,
128  const Time& runTime,
129  const dictionary&
130  );
131 
132  //- Disallow default bitwise copy construction
133  wallHeatFlux(const wallHeatFlux&) = delete;
134 
135 
136  //- Destructor
137  virtual ~wallHeatFlux();
138 
139 
140  // Member Functions
141 
142  //- Read the wallHeatFlux data
143  virtual bool read(const dictionary&);
144 
145  //- Return the list of fields required
146  virtual wordList fields() const
147  {
148  return wordList::null();
149  }
150 
151  //- Calculate the wall heat-flux
152  virtual bool execute();
153 
154  //- Write the wall heat-flux
155  virtual bool write();
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const wallHeatFlux&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace functionObjects
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void operator=(const wallHeatFlux &)=delete
Disallow default bitwise assignment.
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: wallHeatFlux.C:111
virtual bool execute()
Calculate the wall heat-flux.
Definition: wallHeatFlux.C:197
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual bool write()
Write the wall heat-flux.
Definition: wallHeatFlux.C:240
virtual ~wallHeatFlux()
Destructor.
Definition: wallHeatFlux.C:130
static const List< T > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:211
A class for handling words, derived from string.
Definition: word.H:59
TypeName("wallHeatFlux")
Runtime type information.
virtual wordList fields() const
Return the list of fields required.
Definition: wallHeatFlux.H:165
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
Definition: wallHeatFlux.C:136
Calculates and write the heat-flux at wall patches as the volScalarField field &#39;wallHeatFlux&#39;.
Definition: wallHeatFlux.H:111
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.