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-2019 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 overridden by
56  defining an empty \c objects list. For details see writeLocalObjects.
57 
58 See also
59  Foam::functionObject
60  Foam::functionObjects::fvMeshFunctionObject
61  Foam::functionObjects::logFiles
62  Foam::functionObjects::writeLocalObjects
63  Foam::functionObjects::timeControl
64 
65 SourceFiles
66  wallHeatFlux.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef functionObjects_wallHeatFlux_H
71 #define functionObjects_wallHeatFlux_H
72 
73 #include "fvMeshFunctionObject.H"
74 #include "logFiles.H"
75 #include "writeLocalObjects.H"
76 #include "HashSet.H"
77 #include "volFieldsFwd.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 namespace functionObjects
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class wallHeatFlux Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class wallHeatFlux
91 :
92  public fvMeshFunctionObject,
93  public logFiles,
94  public writeLocalObjects
95 {
96 
97 protected:
98 
99  // Protected data
100 
101  //- Optional list of patches to process
103 
104 
105  // Protected Member Functions
106 
107  //- File header information
108  virtual void writeFileHeader(const label i);
110  //- Calculate the heat-flux
112  (
113  const volScalarField& alpha,
114  const volScalarField& he
115  );
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("wallHeatFlux");
122 
123 
124  // Constructors
125 
126  //- Construct from Time and dictionary
128  (
129  const word& name,
130  const Time& runTime,
131  const dictionary&
132  );
133 
134  //- Disallow default bitwise copy construction
135  wallHeatFlux(const wallHeatFlux&) = delete;
136 
137 
138  //- Destructor
139  virtual ~wallHeatFlux();
140 
141 
142  // Member Functions
143 
144  //- Read the wallHeatFlux data
145  virtual bool read(const dictionary&);
146 
147  //- Calculate the wall heat-flux
148  virtual bool execute();
149 
150  //- Write the wall heat-flux
151  virtual bool write();
152 
153 
154  // Member Operators
155 
156  //- Disallow default bitwise assignment
157  void operator=(const wallHeatFlux&) = delete;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace functionObjects
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:50
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
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:112
virtual bool execute()
Calculate the wall heat-flux.
Definition: wallHeatFlux.C:193
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:158
virtual bool write()
Write the wall heat-flux.
Definition: wallHeatFlux.C:235
engineTime & runTime
virtual ~wallHeatFlux()
Destructor.
Definition: wallHeatFlux.C:131
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
tmp< volScalarField > calcWallHeatFlux(const volScalarField &alpha, const volScalarField &he)
Calculate the heat-flux.
Definition: wallHeatFlux.C:63
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 void writeFileHeader(const label i)
File header information.
Definition: wallHeatFlux.C:48
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
Definition: wallHeatFlux.C:137
Calculates and write the heat-flux at wall patches as the volScalarField field &#39;wallHeatFlux&#39;.
Definition: wallHeatFlux.H:109
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
A class for managing temporary objects.
Definition: PtrList.H:53
labelHashSet patchSet_
Optional list of patches to process.
Definition: wallHeatFlux.H:121
Namespace for OpenFOAM.