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) 2017-2018 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 write the estimated incompressible flow heat transfer
29  coefficient at wall patches as the volScalarField field
30  'wallHeatTransferCoeff'.
31 
32  All wall patches are included by default; to restrict the calculation to
33  certain patches, use the optional 'patches' entry.
34 
35  Example of function object specification:
36  \verbatim
37  wallHeatTransferCoeff1
38  {
39  type wallHeatTransferCoeff;
40  libs ("libfieldFunctionObjects.so");
41  ...
42  region fluid;
43  patches (".*Wall");
44  rho 1.225;
45  Cp 1005;
46  Prl 0.707;
47  Prt 0.9;
48  }
49  \endverbatim
50 
51 Usage
52  \table
53  Property | Description | Required | Default value
54  type | Type name: wallHeatTransferCoeff | yes |
55  patches | List of patches to process | no | all wall patches
56  region | Region to be evaluated | no | default region
57  rho | Fluid density | yes |
58  Cp | Fluid heat capacity | yes |
59  Prl | Fluid laminar Prandtl number | yes |
60  Prt | Fluid turbulent Prandtl number| yes |
61  \endtable
62 
63 Note
64  Writing field 'wallHeatTransferCoeff' is done by default, but it can be
65  overridden by defining an empty \c objects list. For details see
66  writeLocalObjects.
67 
68 See also
69  Foam::functionObject
70  Foam::functionObjects::fvMeshFunctionObject
71  Foam::functionObjects::logFiles
72  Foam::functionObjects::writeLocalObjects
73  Foam::functionObjects::timeControl
74 
75 SourceFiles
76  wallHeatTransferCoeff.C
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef functionObjects_wallHeatTransferCoeff_H
81 #define functionObjects_wallHeatTransferCoeff_H
82 
83 #include "fvMeshFunctionObject.H"
84 #include "logFiles.H"
85 #include "writeLocalObjects.H"
86 #include "HashSet.H"
87 #include "volFieldsFwd.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace functionObjects
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class wallHeatTransferCoeff Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class wallHeatTransferCoeff
101 :
102  public fvMeshFunctionObject,
103  public logFiles,
104  public writeLocalObjects
105 {
106 
107 protected:
108 
109  // Protected data
110 
111  //- Optional list of patches to process
113 
114  //- Fluid density
115  scalar rho_;
116 
117  //- Fluid heat capacity
118  scalar Cp_;
119 
120  //- Fluid laminar Prandtl number
121  scalar Prl_;
122 
123  //- Fluid turbulent Prandtl number
124  scalar Prt_;
125 
126 
127  // Protected Member Functions
128 
129  //- File header information
130  virtual void writeFileHeader(const label i);
131 
132  //- Calculate the heat transfer coefficient
133  tmp<volScalarField> calcHeatTransferCoeff
134  (
135  const volScalarField& nu,
136  const volScalarField& nut
137  );
138 
140 private:
141 
142  // Private member functions
143 
144  //- Disallow default bitwise copy construct
146 
147  //- Disallow default bitwise assignment
148  void operator=(const wallHeatTransferCoeff&);
149 
150 
151 public:
152 
153  //- Runtime type information
154  TypeName("wallHeatTransferCoeff");
155 
156 
157  // Constructors
158 
159  //- Construct from Time and dictionary
161  (
162  const word& name,
163  const Time& runTime,
164  const dictionary&
165  );
166 
167 
168  //- Destructor
169  virtual ~wallHeatTransferCoeff();
170 
171 
172  // Member Functions
173 
174  //- Read the wallHeatTransferCoeff data
175  virtual bool read(const dictionary&);
176 
177  //- Calculate the wall heat transfer coefficient
178  virtual bool execute();
179 
180  //- Write the wall heat transfer coefficient
181  virtual bool write();
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace functionObjects
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
TypeName("wallHeatTransferCoeff")
Runtime type information.
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:137
virtual bool write()
Write the wall heat transfer coefficient.
virtual bool read(const dictionary &)
Read the wallHeatTransferCoeff data.
scalar Prl_
Fluid laminar Prandtl number.
Calculates and write the estimated incompressible flow heat transfer coefficient at wall patches as t...
engineTime & runTime
tmp< volScalarField > calcHeatTransferCoeff(const volScalarField &nu, const volScalarField &nut)
Calculate the heat transfer coefficient.
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.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
A class for handling words, derived from string.
Definition: word.H:59
labelHashSet patchSet_
Optional list of patches to process.
scalar Prt_
Fluid turbulent Prandtl number.
virtual bool execute()
Calculate the wall heat transfer coefficient.
volScalarField & nu
scalar nut
Namespace for OpenFOAM.