kL.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) 2021 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::RASModels::kL
28
29Group
30 grpRASTurbulence
31
32Description
33 A one-equation (turbulent kinetic energy \c k) turbulence closure
34 model for incompressible and compressible geophysical applications.
35
36 Turbulent kinetic energy (\c k) is computed with a transport equation
37 and the turbulent length scale (\c L) is computed with an algebraic
38 expression which depends on the local stratification.
39
40 References:
41 \verbatim
42 Standard model (tag:A):
43 Axell, L. B., & Liungman, O. (2001).
44 A one-equation turbulence model for geophysical applications:
45 comparison with data and the k−ε model.
46 Environmental Fluid Mechanics, 1(1), 71-106.
47 DOI:10.1023/A:1011560202388
48
49 Canopy-related models (tag:W):
50 Wilson, J. D., & Flesch, T. K. (1999).
51 Wind and remnant tree sway in forest cutblocks.
52 III. A windflow model to diagnose spatial variation.
53 Agricultural and Forest Meteorology, 93(4), 259-282.
54 DOI:10.1016/S0168-1923(98)00121-X
55 \endverbatim
56
57Usage
58 Example by using \c constant/turbulenceProperties:
59 \verbatim
60 RAS
61 {
62 // Mandatory entries
63 RASModel kL;
64
65 // Optional entries
66 kLCoeffs
67 {
68 kappa <scalar>;
69 sigmak <scalar>;
70 beta <scalar>;
71 Cmu0 <scalar>;
72 Lmax <scalar>;
73 CbStable <scalar>;
74 CbUnstable <scalar>;
75 }
76
77 // Inherited entries
78 ...
79 }
80 \endverbatim
81
82 where the entries mean:
83 \table
84 Property | Description | Type | Reqd | Deflt
85 RASModel | Type name: kL | word | yes | -
86 kappa | von Karman constant | scalar | no | 0.41
87 sigmak | Empirical model coefficient | scalar | no | 1.0
88 beta | Thermal expansion coefficient [1/K] | scalar | no | 3.3e-3
89 Cmu0 | Empirical model coefficient | scalar | no | 0.556
90 Lmax | Maximum mixing-length scale [m] | scalar | no | GREAT
91 CbStable | Stable stratification constant | scalar | no | 0.25
92 CbUnstable | Unstable stratification constant | scalar | no | 0.35
93 \endtable
94
95 The inherited entries are elaborated in:
96 - \link eddyViscosity.H \endlink
97
98 \heading Input fields (mandatory)
99 \plaintable
100 k | Turbulent kinetic energy [m2/s2]
101 T | Potential temperature [K]
102 \endplaintable
103
104 \heading Input fields (optional)
105 \plaintable
106 canopyHeight | Canopy height [m]
107 plantCd | Plant canopy drag coefficient [-]
108 leafAreaDensity | Leaf area density [1/m]
109 Rt | Turbulent Richardson number [-]
110 L | Characteristic length scale [m]
111 \endplaintable
112
113Note
114 - Optional input fields can/should be input
115 by using \c readFields function object.
116
117SourceFiles
118 kL.C
119
120\*---------------------------------------------------------------------------*/
121
122#ifndef kL_H
123#define kL_H
124
125#include "RASModel.H"
126#include "eddyViscosity.H"
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131namespace Foam
132{
133namespace RASModels
134{
135
136/*---------------------------------------------------------------------------*\
137 Class kL Declaration
138\*---------------------------------------------------------------------------*/
139
140template<class BasicTurbulenceModel>
141class kL
142:
143 public eddyViscosity<RASModel<BasicTurbulenceModel>>
144{
145 // Private Member Functions
146
147 //- Return modified stability function of Launder,
148 //- calibrated with the results of Hogstrom (A:Eq. 31)
149 tmp<volScalarField> Cmu() const;
150
151 //- Return modified stability function of Launder,
152 //- calibrated with the results of Hogstrom (A:Eq. 32)
153 tmp<volScalarField> CmuPrime() const;
154
155 //- Return eddy diffusivity (A:Eq. 12)
156 tmp<volScalarField> nutPrime() const;
157
158 //- Return turbulent kinetic energy dissipation rate due to canopy
159 tmp<volScalarField> epsilonCanopy() const;
160
161 //- Return turbulent kinetic energy
162 //- dissipation rate due to plains and canopy
163 tmp<volScalarField> epsilon() const;
164
165 //- Return canopy height
166 tmp<volScalarField> canopyHeight() const;
167
168 //- Return characteristic length scale
169 tmp<volScalarField> L() const;
170
171 //- Modify characteristic length scale
172 //- according to the specified stratification
173 void stratification(const volScalarField& fVB);
174
175 // Generated Methods
176
177 //- No copy construct
178 kL(const kL&) = delete;
179
180 //- No copy assignment
181 void operator=(const kL&) = delete;
182
183
184protected:
185
186 // Protected Data
187
188 // Model coefficients
189
190 //- von Karman constant
192
193 //- Empirical model coefficient
195
196 //- Thermal expansion coefficient [1/K]
198
199 //- Empirical model coefficient
201
202 //- Maximum mixing-length scalar [m]
204
205 //- Stable stratification constant
207
208 //- Unstable stratification constant
210
211
212 // Fields
213
214 //- Turbulent kinetic energy [m2/s2]
216
217 //- Characteristic length scale [m]
219
220 //- Turbulent Richardson number [-]
223 //- Gravitational acceleration [m2/s2]
225
226 //- Wall distance
227 // Note: different to wall distance in parent RASModel
228 // which is for near-wall cells only
229 const volScalarField& y_;
230
231
232 // Protected Member Functions
233
234 //- Correct the turbulence viscosity
235 virtual void correctNut();
236
237 //- Add explicit source for turbulent kinetic energy
238 virtual tmp<fvScalarMatrix> kSource() const;
239
240
241public:
242
243 typedef typename BasicTurbulenceModel::alphaField alphaField;
244 typedef typename BasicTurbulenceModel::rhoField rhoField;
245 typedef typename BasicTurbulenceModel::transportModel transportModel;
246
247
248 //- Runtime type information
249 TypeName("kL");
250
251
252 // Constructors
253
254 //- Construct from components
255 kL
256 (
257 const alphaField& alpha,
258 const rhoField& rho,
259 const volVectorField& U,
260 const surfaceScalarField& alphaRhoPhi,
261 const surfaceScalarField& phi,
262 const transportModel& transport,
263 const word& propertiesName = turbulenceModel::propertiesName,
264 const word& type = typeName
265 );
266
267
268 //- Destructor
269 virtual ~kL() = default;
270
271
272 // Member Functions
273
274 //- Re-read model coefficients if they have changed
275 virtual bool read();
276
277 //- Return the effective diffusivity for k
279 {
282 "DkEff",
283 (this->nut_/sigmak_ + this->nu())
284 );
285 }
286
287 //- Return the turbulent kinetic energy field
288 virtual tmp<volScalarField> k() const
289 {
290 return k_;
291 }
292
293 //- Solve the turbulence equations and correct the turbulence viscosity
294 virtual void correct();
295};
297
298// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
300} // End namespace RASModels
301} // End namespace Foam
303// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304
305#ifdef NoRepository
306 #include "kL.C"
307#endif
308
309// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
311#endif
312
313// ************************************************************************* //
surfaceScalarField & phi
A one-equation (turbulent kinetic energy k) turbulence closure model for incompressible and compressi...
Definition: kL.H:225
BasicTurbulenceModel::alphaField alphaField
Definition: kL.H:324
dimensionedScalar sigmak_
Empirical model coefficient.
Definition: kL.H:275
BasicTurbulenceModel::rhoField rhoField
Definition: kL.H:325
volScalarField k_
Turbulent kinetic energy [m2/s2].
Definition: kL.H:296
volScalarField L_
Characteristic length scale [m].
Definition: kL.H:299
virtual ~kL()=default
Destructor.
const uniformDimensionedVectorField & g_
Gravitational acceleration [m2/s2].
Definition: kL.H:305
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kL.C:412
dimensionedScalar kappa_
von Karman constant
Definition: kL.H:272
dimensionedScalar CbUnstable_
Unstable stratification constant.
Definition: kL.H:290
dimensionedScalar Cmu0_
Empirical model coefficient.
Definition: kL.H:281
volScalarField Rt_
Turbulent Richardson number [-].
Definition: kL.H:302
const volScalarField & y_
Wall distance.
Definition: kL.H:310
dimensionedScalar CbStable_
Stable stratification constant.
Definition: kL.H:287
virtual void correctNut()
Correct the turbulence viscosity.
Definition: kL.C:225
virtual tmp< fvScalarMatrix > kSource() const
Add explicit source for turbulent kinetic energy.
Definition: kL.C:236
BasicTurbulenceModel::transportModel transportModel
Definition: kL.H:326
dimensionedScalar Lmax_
Maximum mixing-length scalar [m].
Definition: kL.H:284
virtual tmp< volScalarField > k() const
Return the turbulent kinetic energy field.
Definition: kL.H:369
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kL.C:392
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kL.H:359
dimensionedScalar beta_
Thermal expansion coefficient [1/K].
Definition: kL.H:278
TypeName("kL")
Runtime type information.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:58
A class for managing temporary objects.
Definition: tmp.H:65
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
volScalarField & nu
volScalarField & alpha
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73