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-2024 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  patch | patch to process | no |
51  patches | list of patches to process | no | all wall patches
52  region | region to be evaluated | no | default region
53  \endtable
54 
55  Note:
56  Writing field 'wallHeatFlux' is done by default, but it can be
57  overridden by defining an empty \c objects list. For details see
58  writeLocalObjects.
59 
60 See also
61  Foam::functionObject
62  Foam::functionObjects::fvMeshFunctionObject
63  Foam::functionObjects::logFiles
64  Foam::functionObjects::writeLocalObjects
65  Foam::functionObjects::timeControl
66 
67 SourceFiles
68  wallHeatFlux.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef functionObjects_wallHeatFlux_H
73 #define functionObjects_wallHeatFlux_H
74 
75 #include "fvMeshFunctionObject.H"
76 #include "logFiles.H"
77 #include "writeLocalObjects.H"
78 #include "HashSet.H"
79 #include "volFieldsFwd.H"
80 #include "surfaceFieldsFwd.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 namespace functionObjects
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class wallHeatFlux Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class wallHeatFlux
94 :
95  public fvMeshFunctionObject,
96  public logFiles,
97  public writeLocalObjects
98 {
99  // Private Data
100 
101  //- The name of the phase
102  word phaseName_;
103 
104  //- Optional list of patches to process
105  labelHashSet patchSet_;
106 
107 
108  // Private Member Functions
109 
110  //- File header information
111  virtual void writeFileHeader(const label i);
112 
113  //- Calculate the heat-flux
114  tmp<volScalarField> calcWallHeatFlux(const surfaceScalarField& q);
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("wallHeatFlux");
121 
122 
123  // Constructors
124 
125  //- Construct from Time and dictionary
127  (
128  const word& name,
129  const Time& runTime,
130  const dictionary&
131  );
132 
133  //- Disallow default bitwise copy construction
134  wallHeatFlux(const wallHeatFlux&) = delete;
135 
136 
137  //- Destructor
138  virtual ~wallHeatFlux();
139 
140 
141  // Member Functions
142 
143  //- Read the wallHeatFlux data
144  virtual bool read(const dictionary&);
145 
146  //- Return the list of fields required
147  virtual wordList fields() const
148  {
149  return wordList::null();
150  }
151 
152  //- Calculate the wall heat-flux
153  virtual bool execute();
154 
155  //- Write the wall heat-flux
156  virtual bool write();
157 
158 
159  // Member Operators
160 
161  //- Disallow default bitwise assignment
162  void operator=(const wallHeatFlux&) = delete;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace functionObjects
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
static const List< word > & 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:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Calculates and write the heat-flux at wall patches as the volScalarField field 'wallHeatFlux'.
Definition: wallHeatFlux.H:122
virtual wordList fields() const
Return the list of fields required.
Definition: wallHeatFlux.H:171
TypeName("wallHeatFlux")
Runtime type information.
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:110
virtual bool execute()
Calculate the wall heat-flux.
Definition: wallHeatFlux.C:192
virtual bool write()
Write the wall heat-flux.
Definition: wallHeatFlux.C:230
virtual ~wallHeatFlux()
Destructor.
Definition: wallHeatFlux.C:129
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
Definition: wallHeatFlux.C:135
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
SurfaceField< scalar > surfaceScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:213