Loading...
Searching...
No Matches
effectivenessTable.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) 2022 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::heatExchangerModels::effectivenessTable
28
29Description
30 A heat exchanger model where heat exchange
31 is calculated via an effectiveness table.
32
33 The total heat exchange source is given by:
34 \f[
35 Q_t = e(\phi, \dot{m}_2) (T_2 - T_1) \phi C_p
36 \f]
37
38 where:
39 \vartable
40 Q_t | Total heat exchange source [J/s]
41 e(\phi,\dot{m}_2) | Effectivenes table [-]
42 \phi | Net mass flux entering heat exchanger [kg/s]
43 \dot{m}_2 | Secondary flow mass flow rate [kg/s]
44 T_1 | Primary flow inlet temperature [K]
45 T_2 | Secondary flow inlet temperature [K]
46 C_p | Primary flow specific heat capacity [J/kg/K]
47 \endvartable
48
49 The distribution inside the heat exchanger is given by:
50 \f[
51 Q_c = \frac{V_c |U_c| (T_c - T_{ref})}{\sum(V_c |U_c| (T_c - T_{ref}))}
52 \f]
53
54 where:
55 \vartable
56 Q_c | Source for cell
57 V_c | Volume of the cell [m^3]
58 U_c | Local cell velocity [m/s]
59 T_c | Local cell temperature [K]
60 T_{ref} | Min or max(T) in cell zone depending on the sign of Qt [K]
61 \endvartable
62
63Usage
64 Minimal example by using \c constant/fvOptions:
65 \verbatim
66 <name>
67 {
68 // Inherited entries
69 ...
70
71 // Mandatory entries
72 model effectivenessTable;
73 secondaryMassFlowRate <scalar>;
74 secondaryInletT <scalar>;
75 file "<word>";
76 outOfBounds <word>;
77
78 // Conditional optional entries
79
80 // when the total heat exchange is calculated with primary inlet T
81 primaryInletT <scalar>;
82
83 // when the total heat exchange is calculated with a given target
84 targetQdot <scalar>;
85 targetQdotCalcInterval <label>;
86 targetQdotRelax <scalar>;
87
88 // when secondary outlet temperature is requested
89 secondaryCp <Function1<scalar>>;
90 }
91 \endverbatim
92
93 where the entries mean:
94 \table
95 Property | Description | Type | Reqd | Deflt
96 model | Model name:effectivenessTable | word | yes | -
97 secondaryMassFlowRate | Secondary flow mass rate [kg/s] <!--
98 --> | scalar | yes | -
99 secondaryInletT | Secondary flow inlet temperature [K] <!--
100 --> | scalar | yes | -
101 file | 2D effectiveness table = function of primary <!--
102 --> and secondary mass flow rates [kg/s] | file | yes | -
103 primaryInletT | Primary flow temperature at the heat exchanger inlet <!--
104 --> | scalar | no | -
105 targetQdot | Target heat rejection | scalar | no | -
106 targetQdotCalcInterval | Target heat rejection calculation interval <!--
107 --> | label | no | -
108 targetQdotRelax | Target heat rejection temperature <!--
109 --> under-relaxation coefficient | scalar | no | -
110 secondaryCp | Secondary flow specific heat capacity <!--
111 --> | Function1<scalar> | no | -
112 \endtable
113
114 The inherited entries are elaborated in:
115 - \link heatExchangerSource.H \endlink
116 - \link interpolation2DTable.H \endlink
117
118 The effectiveness table is described in terms of the primary and secondary
119 mass flow rates. For example, the table:
120
121 \verbatim
122 secondary MFR
123 | 0.1 0.2 0.3
124 -----+-----------------
125 0.02 | A B C
126 primary MFR 0.04 | D E F
127 0.06 | G H I
128 \endverbatim
129
130 is specified by the following:
131
132 \verbatim
133 (
134 (
135 0.02
136 (
137 (0.1 A)
138 (0.2 B)
139 (0.3 C)
140 )
141 )
142 (
143 0.04
144 (
145 (0.1 D)
146 (0.2 E)
147 (0.3 F)
148 )
149 )
150 (
151 0.06
152 (
153 (0.1 G)
154 (0.2 H)
155 (0.3 I)
156 )
157 )
158 );
159 \endverbatim
160
161Note
162 - Primary flow indicates the CFD flow region and
163 secondary flow the non-CFD-model region.
164 - The table with name \c file should have the same units as the
165 secondary mass flow rate and kg/s for \c phi.
166 - \c faceZone is the faces at the inlet of the \c cellZone, it needs to be
167 created with flip map flags. It is used to integrate the net mass flow
168 rate into the heat exchanger.
169 - \c primaryInletT sets the primary inlet temperature. If not set, the
170 flux-averaged temperature is used.
171
172SourceFiles
173 effectivenessTable.C
174
175\*---------------------------------------------------------------------------*/
176
177#ifndef Foam_heatExchangerModels_effectivenessTable_H
178#define Foam_heatExchangerModels_effectivenessTable_H
179
180#include "heatExchangerModel.H"
181#include "interpolation2DTable.H"
182#include "Function1.H"
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186namespace Foam
187{
188namespace heatExchangerModels
189{
190
191/*---------------------------------------------------------------------------*\
192 Class effectivenessTable Declaration
193\*---------------------------------------------------------------------------*/
194
196:
197 public heatExchangerModel
198{
199 // Private Data
200
201 //- Flag to use a user-specified primary flow inlet temperature
202 bool userPrimaryInletT_;
203
204 //- Flag to use target heat rejection
205 bool targetQdotActive_;
206
207 //- Secondary flow specific heat capacity [J/kg/K]
208 autoPtr<Function1<scalar>> secondaryCpPtr_;
209
210 //- 2D effectiveness table = function of primary and secondary
211 //- mass flow rates [kg/s]
212 autoPtr<interpolation2DTable<scalar>> eTable_;
213
214 //- Target heat rejection calculation interval
215 label targetQdotCalcInterval_;
216
217 //- Secondary flow mass rate [kg/s]
218 scalar secondaryMassFlowRate_;
219
220 //- Secondary flow inlet temperature [K]
221 scalar secondaryInletT_;
222
223 //- Primary flow temperature at the heat exchanger inlet [K]
224 scalar primaryInletT_;
225
226 //- Target heat rejection
227 scalar targetQdot_;
228
229 //- Target heat rejection temperature under-relaxation coefficient
230 scalar targetQdotRelax_;
231
232 //- Net mass flux [kg/s]
233 scalar sumPhi_;
234
235 //- Total heat exchange [W]
236 scalar Qt_;
237
238 //- Reference temperature [K]
239 scalar Tref_;
240
241 //- Effectiveness of the heat exchanger [-]
242 scalar effectiveness_;
243
244
245 // Private Member Functions
246
247 // I-O
248
249 //- Write file header information
250 void writeFileHeader(Ostream& os) const;
251
252
253public:
254
255 //- Runtime type information
256 TypeName("effectivenessTable");
257
258
259 // Constructors
260
261 //- Construct from components
263 (
264 const fvMesh& mesh,
265 const word& name,
266 const dictionary& coeffs
267 );
268
269 //- No copy construct
270 effectivenessTable(const effectivenessTable&) = delete;
271
272 //- No copy assignment
273 void operator=(const effectivenessTable&) = delete;
274
275
276 //- Destructor
277 virtual ~effectivenessTable() = default;
278
279
280 // Member Functions
281
282 // Evaluation
283
284 //- Initialise data members of the model
285 virtual void initialise();
286
287 //- Return energy density per unit length [J/m3/m]
288 virtual tmp<scalarField> energyDensity(const labelList& cells);
289
290
291 // I-O
292
293 //- Read top-level dictionary
294 virtual bool read(const dictionary& dict);
295
296 //- Write data to stream and files
297 virtual void write(const bool log);
298};
299
300
301// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
302
303} // End namespace heatExchangerModels
304} // End namespace Foam
305
306// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
307
308#endif
309
310// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
heatExchangerModel(const fvMesh &mesh, const word &name, const dictionary &coeffs)
Construct from components.
A heat exchanger model where heat exchange is calculated via an effectiveness table.
TypeName("effectivenessTable")
Runtime type information.
virtual void initialise()
Initialise data members of the model.
virtual bool read(const dictionary &dict)
Read top-level dictionary.
effectivenessTable(const effectivenessTable &)=delete
No copy construct.
virtual ~effectivenessTable()=default
Destructor.
effectivenessTable(const fvMesh &mesh, const word &name, const dictionary &coeffs)
Construct from components.
void operator=(const effectivenessTable &)=delete
No copy assignment.
virtual tmp< scalarField > energyDensity(const labelList &cells)
Return energy density per unit length [J/m3/m].
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
auto & name
const cellShapeList & cells
A namespace for various heat exchanger model implementations.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
dimensionedScalar log(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68