-
Notifications
You must be signed in to change notification settings - Fork 1
/
turbulentPotential.H
403 lines (324 loc) · 10.6 KB
/
turbulentPotential.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
395
396
397
398
399
400
401
402
403
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::incompressible::RASModels::turbulentPotential
Description
Implementation of the Turbulent Potential turbulence model for incompressible
flows.
Turbulence model described in:
@verbatim
Perot, J. Blair
"Turbulence modeling using body force potentials"
Physic of Fluids,
1999
@endverbatim
The default model coefficients correspond to the following:
@verbatim
turbulentPotentialCoeffs
{
}
@endverbatim
SourceFiles
turbulentPotential.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentPotential_H
#define turbulentPotential_H
#include "RASModel.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class turbulentPotential Declaration
\*---------------------------------------------------------------------------*/
class turbulentPotential
:
public RASModel
{
// Private data
// Model coefficients
dimensionedScalar cEp1_;
dimensionedScalar cEp2con_;
dimensionedScalar cEp3_;
dimensionedScalar cD1_;
dimensionedScalar cD2_;
dimensionedScalar cD3_;
dimensionedScalar cD4_;
dimensionedScalar cP1_;
dimensionedScalar cP2_;
dimensionedScalar cP3_;
dimensionedScalar cP4_;
dimensionedScalar cL1_;
dimensionedScalar cL2_;
dimensionedScalar cMu_;
dimensionedScalar betaK_;
dimensionedScalar cT_;
dimensionedScalar cA_;
dimensionedScalar cEhmM_;
dimensionedScalar cNF_;
dimensionedScalar pMix_;
dimensionedScalar cPrK_;
dimensionedScalar cPrP_;
dimensionedScalar cNL_;
dimensionedScalar nutRatMax_;
dimensionedScalar sigmaK_;
dimensionedScalar sigmaEps_;
dimensionedScalar sigmaPhi_;
dimensionedScalar sigmaPsi_;
dimensionedScalar prodType_;
dimensionedScalar dampType_;
dimensionedScalar cEp1Type_;
dimensionedScalar gType_;
word solveK_;
word solveEps_;
word solvePsi_;
word solvePhi_;
word solveNut_;
word eqncEp1_;
word eqncEp2_;
word eqnEpsHat_;
word debugWrite_;
word tslimiter_;
word lslimiter_;
word eqncMu_;
word nutReal_;
//- Wall distance field
// Note: different to wall distance in parent RASModel
wallDist y_;
// Fields
volScalarField k_;
volVectorField gradk_;
volScalarField epsilon_;
volScalarField nut_;
volScalarField nutNorm_;
volScalarField tpphi_;
volScalarField tpphiSqrt_;
volVectorField vorticity_;
volVectorField tppsi_;
volTensorField uGrad_;
volScalarField epsHat_;
volScalarField kSqrt_;
volScalarField alpha_;
volScalarField gamma_;
volScalarField phiSqrt_;
volVectorField gradkSqrt_;
volScalarField cEp2_;
volScalarField tpProd_;
volScalarField cP1eqn_;
volVectorField gradTpphi_;
volTensorField gradTppsi_;
volScalarField tpProdSqr_;
volScalarField tpProd3d_;
// Private member functions
//- Return time scale, Ts using epsilon
tmp<volScalarField> Ts() const;
tmp<volScalarField> Ls() const;
//- Return time scale, TsEh using epsHat
//tmp<volScalarField> TsEh() const;
public:
//- Runtime type information
TypeName("turbulentPotential");
// Constructors
//- Construct from components
turbulentPotential
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport
);
//- Destructor
virtual ~turbulentPotential()
{}
// Member Functions
//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const
{
//return mag(tppsi_)*k_/(mag(vorticity_) + (cNL_*nu()/sqr(Ls())));
return mag(tppsi_)*k_/(mag(vorticity_) + (cNL_/Ts()));
}
//- Return the phi/k
tmp<volScalarField> PhiOverK() const
{
return tmp<volScalarField>
(
new volScalarField("PhiOverK", tpphi_)
);
}
//- Return the gradK
tmp<volScalarField> gradsqK() const
{
return tmp<volScalarField>
(
new volScalarField("gradsqK", mag(fvc::grad(sqrt(k_))))
);
}
//- Return the gradK
tmp<volVectorField> gradtpphi() const
{
return tmp<volVectorField>
(
new volVectorField("gradtpphi", fvc::grad(tpphi_))
);
}
//- Return the local turbulent reynolds number
tmp<volScalarField> reTau() const
{
return tmp<volScalarField>
(
new volScalarField("reTau", (k_*k_ + k0_*k0_)/(nu()*(epsilon_ + epsilonSmall_)))
);
}
//- Return the epsilon hat
tmp<volScalarField> EpsHat() const
{
return epsHat_;
}
//- Return the nut fraction
tmp<volScalarField> nutFrac() const
{
return tmp<volScalarField>
(
new volScalarField("nutFrac", nut_/(nut_+cNF_*nu()))
);
}
//- Return Alpha
tmp<volScalarField> Alpha() const
{
return alpha_;
}
//- Return cEp2
tmp<volScalarField> cEp2() const
{
return cEp2_;
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> nuEff() const
{
return tmp<volScalarField>
(
new volScalarField("nuEff", nut_ + nu())
);
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
return tmp<volScalarField>
(
new volScalarField("DkEff", nut_*sigmaK_ + nu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DepsilonEff() const
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", nut_*sigmaEps_ + nu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DphiEff() const
{
return tmp<volScalarField>
(
new volScalarField("DphiEff", nut_*sigmaPhi_ + nu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DpsiEff() const
{
return tmp<volScalarField>
(
new volScalarField("DpsiEff", nut_*sigmaPsi_ + nu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DEff() const
{
return tmp<volScalarField>
(
new volScalarField("DEff", nut_ + nu())
);
}
//- Return the Reynolds number
tmp<volScalarField> tpReynolds() const
{
return tmp<volScalarField>
(
new volScalarField("tpReynolds", k_*k_/(epsilon_*nu()))
);
}
//- Return the vorticity
virtual tmp<volVectorField> vorticity() const
{
return vorticity_;
}
//- Return the production
virtual tmp<volScalarField> production() const
{
return tpProd_;
}
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the turbulent potential psi
virtual tmp<volVectorField> psiReal() const
{
return k_*tppsi_;
}
//- Return the turbulent potential psi
virtual tmp<volScalarField> phiReal() const
{
return tpphi_*k_;
}
//- Return the turbulence kinetic energy
virtual tmp<volVectorField> U() const
{
return U_;
}
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff() const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
//- Read RASProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //