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-2017 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::fv::tabulatedNTUHeatTransfer
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Tabulated heat transfer model.
34 
35  The heat flux is calculated based on the Number of Thermal Units (NTU).
36  A 2-D table of NTU as functions of the primary and secondary mass flow
37  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 
62  \heading Example usage
63 
64  \verbatim
65  coolerToAir
66  {
67  type tabulatedNTUHeatTransfer;
68  active yes;
69 
70  tabulatedNTUHeatTransferCoeffs
71  {
72  interpolationMethod cellVolumeWeight;
73  nbrRegion air;
74  master true;
75 
76  fields (h);
77  outOfBounds clamp;
78  file "ntuTable";
79  nbrModel airToCooler;
80  semiImplicit no;
81 
82 
83  geometryMode user;
84  Ain 0.01728;
85  AinNbr 0.3456;
86  Vcore 0.01244; // Optional
87 
88  // geometryMode calculated;
89  // inletPatch inlet_HWK;
90  // inletPatchNbr inlet_air;
91  // inletBlockageRatio 0.10;
92  // inletBlockageRatioNbr 0.04;
93  // coreBlockageRatio 0;
94  }
95  }
96  \endverbatim
97 
98 SourceFiles
99  tabulatedNTUHeatTransfer.C
100 
101 SeeAlso
102  interRegionHeatTransferModel.H
103 
104 \*---------------------------------------------------------------------------*/
105 
106 #ifndef tabulatedNTUHeatTransfer_H
107 #define tabulatedNTUHeatTransfer_H
108 
110 #include "autoPtr.H"
111 #include "interpolation2DTable.H"
112 #include "Enum.H"
113 #include "basicThermo.H"
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 namespace Foam
118 {
119 namespace fv
120 {
121 
122 /*---------------------------------------------------------------------------*\
123  Class tabulatedNTUHeatTransfer Declaration
124 \*---------------------------------------------------------------------------*/
125 
127 :
129 {
130 public:
131 
132  // Public enumerations
133 
134  enum geometryModeType
135  {
137  gmUser
138  };
139 
141 
142 
143 private:
144 
145  // Private data
146 
147  //- Name of velocity field; default = U
148  word UName_;
149 
150  //- Name of neighbour velocity field; default = U
151  word UNbrName_;
152 
153  //- Name of density field; default = rho
154  word rhoName_;
155 
156  //- Name of neighbour density field; default = rho
157  word rhoNbrName_;
158 
159  //- Pointer to 2-D look-up table of NTU f(mDot1, mDot2)
161 
162  //- Geometry input mode
163  geometryModeType geometryMode_;
164 
165  //- Inlet area [m2]
166  scalar Ain_;
167 
168  //- Neighbour region inlet area [m2]
169  scalar AinNbr_;
170 
171  //- Heat exchanger core volume
172  scalar Vcore_;
173 
174 
175  // Private Member functions
176 
177  //- NTU table helper
178  const interpolation2DTable<Foam::scalar>& ntuTable();
179 
180  //- Thermophysical properties helper
181  const basicThermo& thermo(const fvMesh& mesh) const;
182 
183  //- Initialise geometry
184  void initialiseGeometry();
185 
186 
187 public:
188 
189  //- Runtime type information
190  TypeName("tabulatedNTUHeatTransfer");
191 
192 
193  // Constructors
194 
195  //- Construct from dictionary
197  (
198  const word& name,
199  const word& modelType,
200  const dictionary& dict,
201  const fvMesh& mesh
202  );
203 
204 
205  //- Destructor
206  virtual ~tabulatedNTUHeatTransfer();
207 
208 
209  // Public Functions
210 
211  //- Calculate the heat transfer coefficient
212  virtual void calculateHtc();
213 
214  //- Read dictionary
215  virtual bool read(const dictionary& dict);
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace fv
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #endif
227 
228 // ************************************************************************* //
Foam::fv::tabulatedNTUHeatTransfer::geometryModeType
geometryModeType
Definition: tabulatedNTUHeatTransfer.H:133
Foam::fv::tabulatedNTUHeatTransfer::geometryModelNames_
static const Enum< geometryModeType > geometryModelNames_
Definition: tabulatedNTUHeatTransfer.H:139
Foam::Enum< geometryModeType >
basicThermo.H
Foam::fv::tabulatedNTUHeatTransfer::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: tabulatedNTUHeatTransfer.C:268
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Foam::fv::interRegionHeatTransferModel
Base class for inter region heat exchange. The derived classes must provide the heat transfer coeffis...
Definition: interRegionHeatTransferModel.H:59
Foam::fv::tabulatedNTUHeatTransfer
Tabulated heat transfer model.
Definition: tabulatedNTUHeatTransfer.H:125
Foam::fv::tabulatedNTUHeatTransfer::calculateHtc
virtual void calculateHtc()
Calculate the heat transfer coefficient.
Definition: tabulatedNTUHeatTransfer.C:224
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:63
interRegionHeatTransferModel.H
interpolation2DTable.H
Foam::interpolation2DTable
2D table interpolation. The data must be in ascending order in both dimensions x and y.
Definition: interpolation2DTable.H:53
Foam::fv::tabulatedNTUHeatTransfer::gmCalculated
Definition: tabulatedNTUHeatTransfer.H:135
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fv::tabulatedNTUHeatTransfer::~tabulatedNTUHeatTransfer
virtual ~tabulatedNTUHeatTransfer()
Destructor.
Definition: tabulatedNTUHeatTransfer.C:218
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fv::tabulatedNTUHeatTransfer::tabulatedNTUHeatTransfer
tabulatedNTUHeatTransfer(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
Definition: tabulatedNTUHeatTransfer.C:196
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fv::tabulatedNTUHeatTransfer::gmUser
Definition: tabulatedNTUHeatTransfer.H:136
Foam::fv::tabulatedNTUHeatTransfer::TypeName
TypeName("tabulatedNTUHeatTransfer")
Runtime type information.
autoPtr.H
Enum.H