-
Notifications
You must be signed in to change notification settings - Fork 1
/
ThermoCloud.H
394 lines (256 loc) · 10.9 KB
/
ThermoCloud.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::ThermoCloud
Description
Templated base class for thermodynamic cloud
- Adds to kinematic cloud
- Heat transfer
SourceFiles
ThermoCloudI.H
ThermoCloud.C
\*---------------------------------------------------------------------------*/
#ifndef ThermoCloud_H
#define ThermoCloud_H
#include "KinematicCloud.H"
#include "thermoCloud.H"
#include "SLGThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
template<class CloudType>
class HeatTransferModel;
/*---------------------------------------------------------------------------*\
Class ThermoCloud Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class ThermoCloud
:
public CloudType,
public thermoCloud
{
public:
// Public typedefs
//- Type of cloud this cloud was instantiated for
typedef CloudType cloudType;
//- Type of parcel the cloud was instantiated for
typedef typename CloudType::particleType parcelType;
//- Convenience typedef for this cloud type
typedef ThermoCloud<CloudType> thermoCloudType;
private:
// Private data
//- Cloud copy pointer
autoPtr<ThermoCloud<CloudType>> cloudCopyPtr_;
// Private member functions
//- Disallow default bitwise copy construct
ThermoCloud(const ThermoCloud&);
//- Disallow default bitwise assignment
void operator=(const ThermoCloud&);
protected:
// Protected data
//- Thermo parcel constant properties
typename parcelType::constantProperties constProps_;
// References to the carrier gas fields
//- SLG thermodynamics package
const SLGThermo& thermo_;
//- Temperature [K]
const volScalarField& T_;
//- Pressure [Pa]
const volScalarField& p_;
// References to the cloud sub-models
//- Heat transfer model
autoPtr<HeatTransferModel<ThermoCloud<CloudType>>>
heatTransferModel_;
// Reference to the particle integration schemes
//- Temperature integration
autoPtr<scalarIntegrationScheme> TIntegrator_;
// Modelling options
//- Include radiation
Switch radiation_;
//- Radiation sum of parcel projected areas
autoPtr<volScalarField::Internal> radAreaP_;
//- Radiation sum of parcel temperature^4
autoPtr<volScalarField::Internal> radT4_;
//- Radiation sum of parcel projected areas * temperature^4
autoPtr<volScalarField::Internal> radAreaPT4_;
// Sources
//- Sensible enthalpy transfer [J/kg]
autoPtr<volScalarField::Internal> hsTrans_;
//- Coefficient for carrier phase hs equation [W/K]
autoPtr<volScalarField::Internal> hsCoeff_;
// Protected Member Functions
// Initialisation
//- Set cloud sub-models
void setModels();
// Cloud evolution functions
//- Reset state of cloud
void cloudReset(ThermoCloud<CloudType>& c);
public:
// Constructors
//- Construct given carrier gas fields
ThermoCloud
(
const word& cloudName,
const volScalarField& rho,
const volVectorField& U,
const dimensionedVector& g,
const SLGThermo& thermo,
bool readFields = true
);
//- Copy constructor with new name
ThermoCloud(ThermoCloud<CloudType>& c, const word& name);
//- Copy constructor with new name - creates bare cloud
ThermoCloud
(
const fvMesh& mesh,
const word& name,
const ThermoCloud<CloudType>& c
);
//- Construct and return clone based on (this) with new name
virtual autoPtr<Cloud<parcelType>> clone(const word& name)
{
return autoPtr<Cloud<parcelType>>
(
new ThermoCloud(*this, name)
);
}
//- Construct and return bare clone based on (this) with new name
virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
{
return autoPtr<Cloud<parcelType>>
(
new ThermoCloud(this->mesh(), name, *this)
);
}
//- Destructor
virtual ~ThermoCloud();
// Member Functions
// Access
//- Return a reference to the cloud copy
inline const ThermoCloud& cloudCopy() const;
//- Return the constant properties
inline const typename parcelType::constantProperties&
constProps() const;
//- Return access to the constant properties
inline typename parcelType::constantProperties& constProps();
//- Return const access to thermo package
inline const SLGThermo& thermo() const;
//- Return const access to the carrier temperature field
inline const volScalarField& T() const;
//- Return const access to the carrier prressure field
inline const volScalarField& p() const;
// Sub-models
//- Return reference to heat transfer model
inline const HeatTransferModel<ThermoCloud<CloudType>>&
heatTransfer() const;
// Integration schemes
//-Return reference to velocity integration
inline const scalarIntegrationScheme& TIntegrator() const;
// Modelling options
//- Radiation flag
inline bool radiation() const;
//- Radiation sum of parcel projected areas [m2]
inline volScalarField::Internal& radAreaP();
//- Radiation sum of parcel projected areas [m2]
inline const volScalarField::Internal&
radAreaP() const;
//- Radiation sum of parcel temperature^4 [K4]
inline volScalarField::Internal& radT4();
//- Radiation sum of parcel temperature^4 [K4]
inline const volScalarField::Internal& radT4() const;
//- Radiation sum of parcel projected area*temperature^4 [m2K4]
inline volScalarField::Internal& radAreaPT4();
//- Radiation sum of parcel temperature^4 [m2K4]
inline const volScalarField::Internal&
radAreaPT4() const;
// Sources
// Enthalpy
//- Sensible enthalpy transfer [J/kg]
inline volScalarField::Internal& hsTrans();
//- Sensible enthalpy transfer [J/kg]
inline const volScalarField::Internal&
hsTrans() const;
//- Return coefficient for carrier phase hs equation
inline volScalarField::Internal& hsCoeff();
//- Return const coefficient for carrier phase hs equation
inline const volScalarField::Internal&
hsCoeff() const;
//- Return sensible enthalpy source term [J/kg/m3/s]
inline tmp<fvScalarMatrix> Sh(volScalarField& hs) const;
// Radiation - overrides thermoCloud virtual abstract members
//- Return tmp equivalent particulate emission
inline tmp<volScalarField> Ep() const;
//- Return tmp equivalent particulate absorption
inline tmp<volScalarField> ap() const;
//- Return tmp equivalent particulate scattering factor
inline tmp<volScalarField> sigmap() const;
// Check
//- Maximum temperature
inline scalar Tmax() const;
//- Minimum temperature
inline scalar Tmin() const;
// Cloud evolution functions
//- Set parcel thermo properties
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt
);
//- Check parcel properties
void checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
);
//- Store the current cloud state
void storeState();
//- Reset the current cloud to the previously stored state
void restoreState();
//- Reset the cloud source terms
void resetSourceTerms();
//- Apply relaxation to (steady state) cloud sources
void relaxSources(const ThermoCloud<CloudType>& cloudOldTime);
//- Apply scaling to (transient) cloud sources
void scaleSources();
//- Pre-evolve
void preEvolve();
//- Evolve the cloud
void evolve();
// Mapping
//- Remap the cells of particles corresponding to the
// mesh topology change with a default tracking data object
virtual void autoMap(const mapPolyMesh&);
// I-O
//- Print cloud information
void info();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "ThermoCloudI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "ThermoCloud.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //