heatTransferCoeff.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::functionObjects::heatTransferCoeff
28 
29 Group
30  grpFieldFunctionObjects
31 
32 Description
33  Computes the heat transfer coefficient [W/(m^2 K)]
34  as a \c volScalarField for a given set of patches.
35 
36  The heat transfer coefficient is definition dependent;
37  therefore, different coefficient values could be
38  obtained based on different definitions.
39 
40  Optionally, the Nusselt number (i.e. the ratio of convective
41  to conductive heat transfer at a boundary in a fluid) can be output:
42 
43  \f[
44  Nu = \frac{h L}{\kappa}
45  \f]
46 
47  where
48  \vartable
49  Nu | Nusselt number
50  h | Heat transfer coefficient
51  L | Characteristic length that defines the scale of the physical system
52  \kappa | Thermal conductivity of the fluid
53  \endvartable
54 
55  Operands:
56  \table
57  Operand | Type | Location
58  input | - | -
59  output file | - | -
60  output field | volScalarField | <time>/<outField>
61  \endtable
62 
63 Usage
64  Minimal example by using \c system/controlDict.functions:
65  \verbatim
66  heatTransferCoeff1
67  {
68  // Mandatory entries
69  type heatTransferCoeff;
70  libs (fieldFunctionObjects);
71 
72  field <word>;
73  patches (<wordRes>);
74  htcModel <word>;
75 
76  // Optional entries
77  qr <word>;
78  L <scalar>;
79  kappa <scalar>;
80 
81  // Conditional entries based on selected <htcModel>
82  ...
83 
84  // Inherited entries
85  ...
86  }
87  \endverbatim
88 
89  where the entries mean:
90  \table
91  Property | Description | Type | Reqd | Deflt
92  type | Type name: heatTransferCoeff | word | yes | -
93  libs | Library name: fieldFunctionObjects | word | yes | -
94  field | Name of operand field | word | yes | -
95  patches | Names of operand patches | wordRes | yes | -
96  htcModel | Heat transfer coefficient model <!--
97  --> - see below | word | yes | -
98  qr | Name of radiative heat flux field | word | no | qr
99  L | Characteristic length that defines <!--
100  --> the scale of the physical system | scalar | no | 1
101  kappa | Thermal conductivity of fluid | scalar | no | 1
102  \endtable
103 
104  The inherited entries are elaborated in:
105  - \link functionObject.H \endlink
106  - \link fieldExpression.H \endlink
107  - \link heatTransferCoeffModel.H \endlink
108 
109  Options for the \c htcModel entry:
110  \verbatim
111  ReynoldsAnalogy | Reynold's analogy
112  localReferenceTemperature | Local reference temperature
113  fixedReferenceTemperature | Fixed reference temperature
114  faceZoneReferenceTemperature | Face-zone reference temperature
115  \endverbatim
116 
117 SourceFiles
118  heatTransferCoeff.C
119 
120 \*---------------------------------------------------------------------------*/
121 
122 #ifndef functionObjects_heatTransferCoeff_H
123 #define functionObjects_heatTransferCoeff_H
124 
125 #include "fieldExpression.H"
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 namespace Foam
130 {
131 
132 // Forward Declarations
133 class heatTransferCoeffModel;
134 
135 namespace functionObjects
136 {
137 
138 /*---------------------------------------------------------------------------*\
139  Class heatTransferCoeff Declaration
140 \*---------------------------------------------------------------------------*/
141 
142 class heatTransferCoeff
143 :
144  public fieldExpression
145 {
146  // Private Data
147 
148  //- Characteristic length that defines the scale of the physical system
149  scalar L_;
150 
151  //- Thermal conductivity of the fluid
152  scalar kappa_;
153 
154  //- Heat transfer coefficient model
155  autoPtr<heatTransferCoeffModel> htcModelPtr_;
156 
157 
158 protected:
159 
160  //- Calculate the heat transfer coefficient field and return true
161  //- if successful
162  virtual bool calc();
163 
164 
165 public:
166 
167  //- Runtime type information
168  TypeName("heatTransferCoeff");
169 
170 
171  // Constructors
172 
173  //- Construct from Time and dictionary
175  (
176  const word& name,
177  const Time& runTime,
178  const dictionary& dict
179  );
180 
181  //- No copy construct
182  heatTransferCoeff(const heatTransferCoeff&) = delete;
183 
184  //- No copy assignment
185  void operator=(const heatTransferCoeff&) = delete;
186 
187 
188  //- Destructor
189  virtual ~heatTransferCoeff() = default;
190 
191 
192  // Member Functions
193 
194  //- Read the top-level dictionary
195  virtual bool read(const dictionary& dict);
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace functionObjects
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
dictionary dict
virtual bool calc()
Calculate the heat transfer coefficient field and return true if successful.
engineTime & runTime
const word & name() const noexcept
Return the name of this functionObject.
void operator=(const heatTransferCoeff &)=delete
No copy assignment.
TypeName("heatTransferCoeff")
Runtime type information.
heatTransferCoeff(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual ~heatTransferCoeff()=default
Destructor.
virtual bool read(const dictionary &dict)
Read the top-level dictionary.
Namespace for OpenFOAM.