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 | Copyright (C) 2015 OpenCFD Ltd.
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::fv::tabulatedNTUHeatTransfer
26 
27 Description
28  Tabulated heat transfer model.
29 
30  The heat flux is calculated based on the Number of Thermal Units (NTU).
31  A 2-D table of NTU as functions of the primary and secondary mass flow
32  rates is required.
33 
34  The exchanger geometry can be specified using either:
35  - \c calculated:
36  - inlet area of each region and core volume determined by interrogating
37  mesh patches, and mesh-to-mesh interpolation volume
38  - calculated core volume canbe partially blocked by specifying a
39  \c coreBlockageRatio [0-1] entry
40  - \c user:
41  - inlet area of each region privided by the user
42  - core volume automatically calculated by the mesh-to-mesh
43  interpolation volume if not provided by user
44 
45  Heat transfer coefficient calculated by:
46 
47  \f[
48  htc = C_{min} \frac{NTU}{V_{core}}
49  \f]
50 
51  Where \f$ C_{min} \f$ is given by:
52 
53  \f[
54  C_{min} = min \left(Cp_1 \dot{m}_1, Cp_2 \dot{m}_2 \right)
55  \f]
56 
57  \heading Example usage
58 
59  \verbatim
60  coolerToAir
61  {
62  type tabulatedNTUHeatTransfer;
63  active yes;
64 
65  tabulatedNTUHeatTransferCoeffs
66  {
67  interpolationMethod cellVolumeWeight;
68  nbrRegionName air;
69  master true;
70 
71  fieldNames (h);
72  outOfBounds clamp;
73  fileName "ntuTable";
74  nbrModelName airToCooler;
75  semiImplicit no;
76 
77 
78  geometryMode user;
79  Ain 0.01728;
80  AinNbr 0.3456;
81  Vcore 0.01244; // Optional
82 
83  // geometryMode calculated;
84  // inletPatch inlet_HWK;
85  // inletPatchNbr inlet_air;
86  // inletBlockageRatio 0.10;
87  // inletBlockageRatioNbr 0.04;
88  // coreBlockageRatio 0;
89  }
90  }
91 
92 SourceFiles
93  tabulatedNTUHeatTransfer.C
94 
95 SeeAlso
96  interRegionHeatTransferModel.H
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef tabulatedNTUHeatTransfer_H
101 #define tabulatedNTUHeatTransfer_H
102 
104 #include "autoPtr.H"
105 #include "interpolation2DTable.H"
106 #include "NamedEnum.H"
107 #include "basicThermo.H"
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
113 namespace fv
114 {
115 
116 /*---------------------------------------------------------------------------*\
117  Class tabulatedNTUHeatTransfer Declaration
118 \*---------------------------------------------------------------------------*/
119 
120 class tabulatedNTUHeatTransfer
121 :
122  public interRegionHeatTransferModel
123 {
124 public:
125 
126  // Public enumerations
127 
128  enum geometryModeType
129  {
130  gmCalculated,
131  gmUser
132  };
133 
134  static const NamedEnum<geometryModeType, 2> geometryModelNames_;
135 
136 
137 private:
138 
139  // Private data
140 
141  //- Name of velocity field; default = U
142  word UName_;
143 
144  //- Name of neighbour velocity field; default = U
145  word UNbrName_;
146 
147  //- Name of density field; default = rho
148  word rhoName_;
149 
150  //- Name of neighbour density field; default = rho
151  word rhoNbrName_;
152 
153  //- Pointer to 2-D look-up table of NTU f(mDot1, mDot2)
154  autoPtr<interpolation2DTable<scalar> > ntuTable_;
155 
156  //- Geometry input mode
157  geometryModeType geometryMode_;
158 
159  //- Inlet area [m2]
160  scalar Ain_;
161 
162  //- Neighbour region inlet area [m2]
163  scalar AinNbr_;
164 
165  //- Heat exchanger core volume
166  scalar Vcore_;
167 
168 
169  // Private Member functions
170 
171  //- NTU table helper
172  const interpolation2DTable<Foam::scalar>& ntuTable();
173 
174  //- Thermophysical properties helper
175  const basicThermo& thermo(const fvMesh& mesh) const;
176 
177  //- Initialise geometry
178  void initialiseGeometry();
179 
180 
181 public:
182 
183  //- Runtime type information
184  TypeName("tabulatedNTUHeatTransfer");
185 
186 
187  // Constructors
188 
189  //- Construct from dictionary
190  tabulatedNTUHeatTransfer
191  (
192  const word& name,
193  const word& modelType,
194  const dictionary& dict,
195  const fvMesh& mesh
196  );
197 
198 
199  //- Destructor
200  virtual ~tabulatedNTUHeatTransfer();
201 
202 
203  // Public Functions
204 
205  //- Calculate the heat transfer coefficient
206  virtual void calculateHtc();
207 
208 
209  // I-O
210 
211  //- Read dictionary
212  virtual bool read(const dictionary& dict);
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace fv
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************************************************************* //
TypeName
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:70
basicThermo.H
Foam::read
bool read(const char *, int32_t &)
Definition: int32IO.C:87
NamedEnum.H
interRegionHeatTransferModel.H
interpolation2DTable.H
thermo
rhoThermo & thermo
Definition: setRegionFluidFields.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
fv
labelList fv(nPoints)
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
autoPtr.H