tabulatedNTUHeatTransfer.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) 2015-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::fv::tabulatedNTUHeatTransfer
28
29Group
30 grpFvOptionsSources
31
32Description
33 Applies a tabulated heat transfer model for inter-region heat exchanges.
34 The heat flux is calculated based on the Number of Thermal Units (NTU).
35
36 A 2-D table of NTU as functions of the primary
37 and secondary mass flow rates is required.
38
39 The exchanger geometry can be specified using either:
40 - \c calculated:
41 - inlet area of each region and core volume determined by interrogating
42 mesh patches, and mesh-to-mesh interpolation volume
43 - calculated core volume can be partially blocked by specifying a
44 \c coreBlockageRatio [0-1] entry
45 - \c user:
46 - inlet area of each region provided by the user
47 - core volume automatically calculated by the mesh-to-mesh
48 interpolation volume if not provided by user
49
50 Heat transfer coefficient calculated by:
51
52 \f[
53 htc = C_{min} \frac{NTU}{V_{core}}
54 \f]
55
56 Where \f$ C_{min} \f$ is given by:
57
58 \f[
59 C_{min} = min \left(Cp_1 \dot{m}_1, Cp_2 \dot{m}_2 \right)
60 \f]
61
62Usage
63 Minimal example by using \c constant/fvOptions:
64 \verbatim
65 tabulatedNTUHeatTransfer1
66 {
67 // Mandatory entries (unmodifiable)
68 type tabulatedNTUHeatTransfer;
69
70 // Mandatory entries (runtime modifiable)
71 geometryMode <geometryMode>;
72 outOfBounds clamp;
73 file "ntuTable";
74
75 // Optional entries (runtime modifiable)
76 U <Uname>;
77 Unbr <UnbrName>;
78 rho <rhoName>;
79 rhoNbr <rhoNbrName>;
80
81 // Conditional mandatory entries (runtime modifiable)
82
83 // when geometryMode=user
84 Ain 0.01728;
85 AinNbr 0.3456;
86
87 // when geometryMode=calculated
88 inletPatch inlet_HWK;
89 inletPatchNbr inlet_air;
90 inletBlockageRatio 0.10;
91 inletBlockageRatioNbr 0.04;
92 coreBlockageRatio 0;
93
94 // Conditional optional entries (runtime modifiable)
95
96 // when geometryMode=user
97 Vcore 0.01244;
98
99 // Mandatory/Optional (inherited) entries
100 ...
101 }
102 \endverbatim
103
104 where the entries mean:
105 \table
106 Property | Description | Type | Reqd | Dflt
107 type | Type name: tabulatedNTUHeatTransfer | word | yes | -
108 geometryMode | Geometry mode type | word | yes | -
109 file | Heat transfer coefficient table | interpolate2DTable | yes | -
110 U | Name of operand velocity field | word | no | U
111 Unbr | Name of operand neighbour velocity field | word | no | U
112 Ain | Inlet area [m2] | scalar | cndtnl | -
113 AinNbr | Neighbour region inlet area [m2] | scalar | cndtnl | -
114 Vcore | Heat exchanger core volume | scalar | cndtnl | -
115 inletPatch | Name of inlet patch | word | cndtnl | -
116 inletNbrPatch | Name of inlet patch neighbour | word | cndtnl | -
117 inletBlockageRatio | Inlet patch blockage ratio [0, 1] <!--
118 --> | scalar | cndtnl | -
119 inletBlockageRatioNbr | Inlet neighbour patch blockage ratio [0, 1] <!--
120 --> | scalar | cndtnl | -
121 coreBlockageRatio | Core volume blockage ratio [0, 1] <!--
122 --> | scalar | cndtnl | -
123 \endtable
124
125 The inherited entries are elaborated in:
126 - \link interRegionHeatTransfer.H \endlink
127 - \link interpolate2DTable.H \endlink
128
129 Options for the \c geometryMode entry:
130 \verbatim
131 calculated | Use settings computed internally
132 user | Use settings provided by the user
133 \endverbatim
134
135 Example usage:
136 \verbatim
137 coolerToAir
138 {
139 type tabulatedNTUHeatTransfer;
140 active yes;
141
142 tabulatedNTUHeatTransferCoeffs
143 {
144 interpolationMethod cellVolumeWeight;
145 nbrRegion air;
146 master true;
147
148 fields (h);
149 outOfBounds clamp;
150 file "ntuTable";
151 nbrModel airToCooler;
152 semiImplicit no;
153
154
155 geometryMode user;
156 Ain 0.01728;
157 AinNbr 0.3456;
158 Vcore 0.01244; // Optional
159
160 // geometryMode calculated;
161 // inletPatch inlet_HWK;
162 // inletPatchNbr inlet_air;
163 // inletBlockageRatio 0.10;
164 // inletBlockageRatioNbr 0.04;
165 // coreBlockageRatio 0;
166 }
167 }
168 \endverbatim
169
170See also
171 - Foam::fv::interRegionHeatTransferModel
172 - Foam::fv::constantHeatTransfer
173 - Foam::fv::tabulatedHeatTransfer
174 - Foam::fv::variableHeatTransfer
175
176SourceFiles
177 tabulatedNTUHeatTransfer.C
178
179\*---------------------------------------------------------------------------*/
180
181#ifndef tabulatedNTUHeatTransfer_H
182#define tabulatedNTUHeatTransfer_H
183
185#include "autoPtr.H"
186#include "interpolation2DTable.H"
187#include "Enum.H"
188#include "basicThermo.H"
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192namespace Foam
193{
194namespace fv
195{
196
197/*---------------------------------------------------------------------------*\
198 Class tabulatedNTUHeatTransfer Declaration
199\*---------------------------------------------------------------------------*/
200
201class tabulatedNTUHeatTransfer
202:
203 public interRegionHeatTransferModel
204{
205public:
206
207 // Public Enumerations
208
209 //- Options for the geometry mode type
211 {
213 gmUser
214 };
215
216 //- Names for geometryModeType
217 static const Enum<geometryModeType> geometryModelNames_;
218
219
220private:
221
222 // Private Data
223
224 //- Name of operand velocity field
225 word UName_;
226
227 //- Name of operand neighbour velocity field
228 word UNbrName_;
229
230 //- Name of operand density field
231 word rhoName_;
232
233 //- Name of operand neighbour density field
234 word rhoNbrName_;
235
236 //- Pointer to 2-D look-up table of NTU f(mDot1, mDot2)
237 autoPtr<interpolation2DTable<scalar>> ntuTable_;
238
239 //- Geometry input mode
240 geometryModeType geometryMode_;
241
242 //- Inlet area [m2]
243 scalar Ain_;
244
245 //- Neighbour region inlet area [m2]
246 scalar AinNbr_;
247
248 //- Heat exchanger core volume
249 scalar Vcore_;
250
251
252 // Private Member Functions
253
254 //- NTU table helper
255 const interpolation2DTable<Foam::scalar>& ntuTable();
256
257 //- Thermophysical properties helper
258 const basicThermo& thermo(const fvMesh& mesh) const;
259
260 //- Initialise geometry
261 void initialiseGeometry();
262
263
264public:
265
266 //- Runtime type information
267 TypeName("tabulatedNTUHeatTransfer");
268
269
270 // Constructors
271
272 //- Construct from components
274 (
275 const word& name,
276 const word& modelType,
277 const dictionary& dict,
278 const fvMesh& mesh
279 );
280
281 //- No copy construct
282 tabulatedNTUHeatTransfer(const tabulatedNTUHeatTransfer&) = delete;
283
284 //- No copy assignment
285 void operator=(const tabulatedNTUHeatTransfer&) = delete;
286
287
288 //- Destructor
289 virtual ~tabulatedNTUHeatTransfer() = default;
291
292 // Public Functions
293
294 //- Calculate the heat transfer coefficient
295 virtual void calculateHtc();
296
297 //- Read dictionary
298 virtual bool read(const dictionary& dict);
300
302// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304} // End namespace fv
305} // End namespace Foam
307// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
308
309#endif
310
311// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Intermediate class for handling inter-region heat exchanges.
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Applies a tabulated heat transfer model for inter-region heat exchanges. The heat flux is calculated ...
virtual ~tabulatedNTUHeatTransfer()=default
Destructor.
static const Enum< geometryModeType > geometryModelNames_
Names for geometryModeType.
tabulatedNTUHeatTransfer(const tabulatedNTUHeatTransfer &)=delete
No copy construct.
TypeName("tabulatedNTUHeatTransfer")
Runtime type information.
virtual bool read(const dictionary &dict)
Read dictionary.
void operator=(const tabulatedNTUHeatTransfer &)=delete
No copy assignment.
virtual void calculateHtc()
Calculate the heat transfer coefficient.
tabulatedNTUHeatTransfer(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
geometryModeType
Options for the geometry mode type.
2D table interpolation. The data must be in ascending order in both dimensions x and y.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73