wallHeatTransferCoeff.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) 2020-2021 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::wallHeatTransferCoeff
26 
27 Description
28  Calculates and writes the estimated heat transfer coefficient at wall
29  patches as the volScalarField field.
30 
31  All wall patches are included by default; to restrict the calculation to
32  certain patches, use the optional 'patches' entry.
33 
34  The models are selected run time by model entry. For detailed description
35  look at the header file for specific model under
36  wallHeatTransferCoeffModels.
37 
38  Example of function object specification:
39  \verbatim
40  kappaEff1
41  {
42  type wallHeatTransferCoeff;
43  libs ("libfieldFunctionObjects.so");
44  model kappaEff;
45  ...
46  region fluid;
47  patches (".*Wall");
48  rho 1.225;
49  Cp 1005;
50  Pr 0.707;
51  Prt 0.9;
52  }
53  \endverbatim
54 
55  \verbatim
56  kappaEff2
57  {
58  type wallHeatTransferCoeff;
59  libs ("libfieldFunctionObjects.so");
60  model kappaEff;
61  ...
62  region fluid;
63  patches (".*Wall");
64  rho 1.225;
65  Cp 1005;
66  Pr 0.707;
67  Prt 0.9;
68  Lchar 0.001;
69  }
70  \endverbatim
71 
72  \verbatim
73  ReynoldsAnalogy1
74  {
75  type wallHeatTransferCoeff;
76  libs ("libfieldFunctionObjects.so");
77  model ReynoldsAnalogy;
78  ...
79  region fluid;
80  patches (".*Wall");
81  rho 1.225;
82  Cp 1005;
83  Uref 1.0;
84  }
85  \endverbatim
86 
87 Note
88  Writing field 'wallHeatTransferCoeff' is done by default, but it can be
89  overridden by defining an empty \c objects list. For details see
90  writeLocalObjects.
91 
92 See also
93  Foam::functionObject
94  Foam::functionObjects::fvMeshFunctionObject
95  Foam::functionObjects::logFiles
96  Foam::functionObjects::writeLocalObjects
97  Foam::functionObjects::timeControl
98 
99 SourceFiles
100  wallHeatTransferCoeff.C
101 
102 \*---------------------------------------------------------------------------*/
103 
104 #ifndef functionObjects_wallHeatTransferCoeff_H
105 #define functionObjects_wallHeatTransferCoeff_H
106 
107 #include "fvMeshFunctionObject.H"
108 #include "logFiles.H"
109 #include "writeLocalObjects.H"
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 namespace Foam
115 {
116 namespace functionObjects
117 {
118 
119 /*---------------------------------------------------------------------------*\
120  Class wallHeatTransferCoeff Declaration
121 \*---------------------------------------------------------------------------*/
124 :
125  public fvMeshFunctionObject,
126  public logFiles,
127  public writeLocalObjects
128 {
129 
130 private:
131 
132  // Protected data
133 
134  // Pointer to the model
136 
137  // Return wall shear stress
138  tmp<volSymmTensorField> devSigma();
139 
140 
141  // Private data
142 
143  //- Density [kg/m^3]
144  dimensionedScalar rho_;
145 
146  //- Specific capacity [J/K/kg]
147  dimensionedScalar Cp_;
148 
149 
150 protected:
151 
152  // Protected data
153 
154  //- Reference to Time
155  const Time& runTime_;
156 
157  //- Optional list of patches to process
159 
160  //- File header information
161  virtual void writeFileHeader(const label i);
162 
163 
164 public:
165 
166  //- Runtime type information
167  TypeName("wallHeatTransferCoeff");
168 
169 
170  // Constructors
171 
172  //- Construct from name, mesh and dict
174  (
175  const word& name,
176  const Time& runTime,
177  const dictionary& dict
178  );
179 
180 
181  //- Destructor
182  virtual ~wallHeatTransferCoeff();
183 
184 
185  // Member Functions
186 
187  //- Read the wallHeatTransferCoeffs data
188  virtual bool read(const dictionary&);
189 
190  //- Calculate the wall heat transfer coefficient
191  virtual bool execute();
192 
193  //- Write the wall heat transfer coefficient
194  virtual bool write();
195 
196 
197  // Member Operators
198 
199  //- Disallow default bitwise assignment
200  void operator=(const wallHeatTransferCoeff&) = delete;
201 };
202 
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 } // End namespace functionObjects
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
TypeName("wallHeatTransferCoeff")
Runtime type information.
dictionary dict
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
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 transfer coefficient.
virtual bool read(const dictionary &)
Read the wallHeatTransferCoeffs data.
Calculates and writes the estimated heat transfer coefficient at wall patches as the volScalarField f...
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual void writeFileHeader(const label i)
File header information.
A class for handling words, derived from string.
Definition: word.H:59
labelHashSet patchSet_
Optional list of patches to process.
wallHeatTransferCoeff(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, mesh and dict.
FunctionObject base class for managing a list of objects on behalf of the inheriting function object...
virtual bool execute()
Calculate the wall heat transfer coefficient.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for managing temporary objects.
Definition: PtrList.H:53
void operator=(const wallHeatTransferCoeff &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
Definition: logFiles.H:57