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-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::functionObjects::heatTransferCoeff
28
29Group
30 grpFieldFunctionObjects
31
32Description
33 Computes the heat transfer coefficient [W/(m2 K)]
34 as a \c volScalarField for a given set of patches.
35
36 Optionally, the Nusselt number (i.e. the ratio of convective
37 to conductive heat transfer at a boundary in a fluid) can be output:
38
39 \f[
40 Nu = \frac{h L}{\kappa}
41 \f]
42
43 where
44 \vartable
45 Nu | Nusselt number
46 h | Convective heat transfer coefficient of the flow
47 L | Characteristic length that defines the scale of the physical system
48 \kappa | Thermal conductivity of the fluid
49 \endvartable
50
51 Operands:
52 \table
53 Operand | Type | Location
54 input | - | -
55 output file | - | -
56 output field | volScalarField | $FOAM_CASE/<time>/<outField>
57 \endtable
58
59Usage
60 Minimal example by using \c system/controlDict.functions:
61 \verbatim
62 heatTransferCoeff1
63 {
64 // Mandatory entries (unmodifiable)
65 type heatTransferCoeff;
66 libs (fieldFunctionObjects);
67
68 // Mandatory (inherited) entries (runtime modifiable)
69 field <field>;
70 patches (<patch1> <patch2> ... <patchN>);
71 htcModel <htcModel>;
72
73 // Optional entries (runtime modifable)
74 qr <qrName>;
75 L 1.0;
76 kappa 1.0;
77
78 // Conditional mandatory and optional
79 // entries based on selected <htcModel> (runtime modifiable)
80 ...
81
82 // Optional (inherited) entries
83 ...
84 }
85 \endverbatim
86
87 where the entries mean:
88 \table
89 Property | Description | Type | Reqd | Dflt
90 type | Type name: heatTransferCoeff | word | yes | -
91 libs | Library name: fieldFunctionObjects | word | yes | -
92 field | Name of the operand field | word | yes | -
93 patches | Names of operand patches | wordRes | yes | -
94 htcModel | Heat transfer coefficient model <!--
95 --> - see below | word | yes | -
96 qr | Name of radiative heat flux | word | no | qr
97 L | Characteristic length that defines <!--
98 --> the scale of the physical system | scalar | no | 1
99 kappa | Thermal conductivity of fluid | scalar | no | 1
100 \endtable
101
102 The inherited entries are elaborated in:
103 - \link functionObject.H \endlink
104 - \link fieldExpression.H \endlink
105 - \link heatTransferCoeffModel.H \endlink
106
107 Options for the \c htcModel entry:
108 \verbatim
109 ReynoldsAnalogy | Reynold's analogy
110 localReferenceTemperature | Local reference temperature
111 fixedReferenceTemperature | Specified reference temperature
112 \endverbatim
113
114 Usage by the \c postProcess utility is not available.
115
116See also
117 - Foam::functionObject
118 - Foam::functionObjects::fieldExpression
119 - Foam::heatTransferCoeffModels::fixedReferenceTemperature
120 - Foam::heatTransferCoeffModels::localReferenceTemperature
121 - Foam::heatTransferCoeffModels::ReynoldsAnalogy
122 - ExtendedCodeGuide::functionObjects::field::heatTransferCoeff
123
124SourceFiles
125 heatTransferCoeff.C
126
127\*---------------------------------------------------------------------------*/
128
129#ifndef functionObjects_heatTransferCoeff_H
130#define functionObjects_heatTransferCoeff_H
131
132#include "fieldExpression.H"
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136namespace Foam
137{
138
139// Forward Declarations
140class heatTransferCoeffModel;
141
142namespace functionObjects
143{
144
145/*---------------------------------------------------------------------------*\
146 Class heatTransferCoeff Declaration
147\*---------------------------------------------------------------------------*/
148
149class heatTransferCoeff
150:
151 public fieldExpression
152{
153 // Private Data
154
155 //- Characteristic length that defines the scale of the physical system
156 scalar L_;
157
158 //- Thermal conductivity of the fluid
159 scalar kappa_;
160
161 //- Heat transfer coefficient model
162 autoPtr<heatTransferCoeffModel> htcModelPtr_;
163
164
165protected:
166
167 //- Calculate the heat transfer coefficient field and return true
168 //- if successful
169 virtual bool calc();
170
171
172public:
173
174 //- Runtime type information
175 TypeName("heatTransferCoeff");
176
177
178 // Constructors
179
180 //- No default construct
181 heatTransferCoeff() = delete;
182
183 //- Construct for given objectRegistry and dictionary.
184 // Allow the possibility to load fields from files
186 (
187 const word& name,
188 const Time& runTime,
189 const dictionary& dict
190 );
191
192 //- No copy construct
193 heatTransferCoeff(const heatTransferCoeff&) = delete;
194
195 //- No copy assignment
196 void operator=(const heatTransferCoeff&) = delete;
197
198
199 //- Destructor
200 virtual ~heatTransferCoeff() = default;
201
202
203 // Member Functions
204
205 //- Read the heatTransferCoeff data
206 virtual bool read(const dictionary& dict);
207};
208
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212} // End namespace functionObjects
213} // End namespace Foam
214
215// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216
217#endif
218
219// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Computes the heat transfer coefficient [W/(m2 K)] as a volScalarField for a given set of patches.
void operator=(const heatTransferCoeff &)=delete
No copy assignment.
heatTransferCoeff()=delete
No default construct.
heatTransferCoeff(const heatTransferCoeff &)=delete
No copy construct.
TypeName("heatTransferCoeff")
Runtime type information.
virtual bool read(const dictionary &dict)
Read the heatTransferCoeff data.
virtual ~heatTransferCoeff()=default
Destructor.
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73