atmBoundaryLayer.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) 2014-2018 OpenFOAM Foundation
9 Copyright (C) 2015-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::atmBoundaryLayer
29
30Group
31 grpRASBoundaryConditions grpInletBoundaryConditions
32
33Description
34 Base class to set log-law type ground-normal inlet boundary conditions for
35 wind velocity and turbulence quantities for homogeneous, two-dimensional,
36 dry-air, equilibrium and neutral atmospheric boundary layer (ABL) modelling.
37
38 The ground-normal profile expressions are due to \c YGCJ
39 (refer to references below) whereat \c RH expressions were generalised:
40
41 \f[
42 u = \frac{u^*}{\kappa} \ln \left( \frac{z - d + z_0}{z_0} \right)
43 \f]
44
45 \f[
46 v = w = 0
47 \f]
48
49 \f[
50 k = \frac{(u^*)^2}{\sqrt{C_\mu}}
51 \sqrt{C_1 \ln \left( \frac{z - d + z_0}{z_0} \right) + C_2}
52 \f]
53
54 \f[
55 \epsilon = \frac{(u^*)^3}{\kappa (z - d + z_0)}
56 \sqrt{C_1 \ln \left( \frac{z - d + z_0}{z_0} \right) + C_2}
57 \f]
58
59 \f[
60 \omega = \frac{u^*}{\kappa \sqrt{C_\mu}} \frac{1}{z - d + z_0}
61 \f]
62
63 \f[
64 u^* =
65 \frac{u_{ref} \kappa}{\ln\left(\frac{z_{ref} + z_0}{z_0}\right)}
66 \f]
67
68 where
69 \vartable
70 u | Ground-normal streamwise flow speed profile [m/s]
71 v | Spanwise flow speed [m/s]
72 w | Ground-normal flow speed [m/s]
73 k | Ground-normal turbulent kinetic energy (TKE) profile [m^2/s^2]
74 \epsilon | Ground-normal TKE dissipation rate profile [m^2/s^3]
75 \omega | Ground-normal specific dissipation rate profile [m^2/s^3]
76 u^* | Friction velocity [m/s]
77 \kappa | von Kármán constant [-]
78 C_\mu | Empirical model constant [-]
79 z | Ground-normal coordinate component [m]
80 d | Ground-normal displacement height [m]
81 z_0 | Aerodynamic roughness length [m]
82 u_{ref} | Reference mean streamwise wind speed at \f$z_{ref}\f$ [m/s]
83 z_{ref} | Reference height being used in \f$u^*\f$ estimations [m]
84 C_1 | Curve-fitting coefficient for \c YGCJ profiles [-]
85 C_2 | Curve-fitting coefficient for \c YGCJ profiles [-]
86 \endvartable
87
88 Reference:
89 \verbatim
90 The ground-normal profile expressions (tag:RH):
91 Richards, P. J., & Hoxey, R. P. (1993).
92 Appropriate boundary conditions for computational wind
93 engineering models using the k-ε turbulence model.
94 In Computational Wind Engineering 1 (pp. 145-153).
95 DOI:10.1016/B978-0-444-81688-7.50018-8
96
97 Modifications to preserve the profiles downstream (tag:HW):
98 Hargreaves, D. M., & Wright, N. G. (2007).
99 On the use of the k–ε model in commercial CFD software
100 to model the neutral atmospheric boundary layer.
101 Journal of wind engineering and
102 industrial aerodynamics, 95(5), 355-369.
103 DOI:10.1016/j.jweia.2006.08.002
104
105 Expression generalisations to allow height
106 variation for turbulence quantities (tag:YGCJ):
107 Yang, Y., Gu, M., Chen, S., & Jin, X. (2009).
108 New inflow boundary conditions for modelling the neutral equilibrium
109 atmospheric boundary layer in computational wind engineering.
110 J. of Wind Engineering and Industrial Aerodynamics, 97(2), 88-95.
111 DOI:10.1016/j.jweia.2008.12.001
112
113 The generalised ground-normal profile expression for omega (tag:YGJ):
114 Yang, Y., Gu, M., & Jin, X., (2009).
115 New inflow boundary conditions for modelling the
116 neutral equilibrium atmospheric boundary layer in SST k-ω model.
117 In: The Seventh Asia-Pacific Conference on Wind Engineering,
118 November 8-12, Taipei, Taiwan.
119
120 Theoretical remarks (tag:E):
121 Emeis, S. (2013).
122 Wind Energy Meteorology: Atmospheric
123 Physics for Wind Power Generation.
124 Springer-Verlag Berlin Heidelberg.
125 DOI:10.1007/978-3-642-30523-8
126 \endverbatim
127
128Usage
129 Example of the entries provided for the inherited boundary conditions:
130 \verbatim
131 inlet
132 {
133 // Mandatory and other optional entries
134 ...
135
136 // Mandatory (inherited) entries (runtime modifiable)
137 flowDir (1 0 0);
138 zDir (0 0 1);
139 Uref 10.0;
140 Zref 0.0;
141 z0 uniform 0.1;
142 d uniform 0.0;
143
144 // Optional (inherited) entries (unmodifiable)
145 kappa 0.41;
146 Cmu 0.09;
147 initABL true;
148 phi phi;
149 C1 0.0;
150 C2 1.0;
151
152 // Conditional mandatory (inherited) entries (runtime modifiable)
153 value uniform 0; // when initABL=false
154 }
155 \endverbatim
156
157 where the entries mean:
158 \table
159 Property | Description | Type | Reqd | Deflt
160 flowDir | Flow direction | Function1<vector> | yes | -
161 zDir | Ground-normal direction | Function1<vector> | yes | -
162 Uref | Reference mean streamwise flow speed being used in <!--
163 --> \f$u^*\f$ estimations [m/s] | Function1<scalar> | yes | -
164 Zref | Reference height being used in \f$u^*\f$ estimations [m] <!--
165 --> | Function1<scalar> | yes | -
166 z0 | Surface roughness length [m] <!--
167 --> | PatchFunction1<scalar> | yes | -
168 d | Displacement height [m] - see Notes <!--
169 --> | PatchFunction1<scalar> | yes | -
170 kappa | von Kármán constant | scalar | no | 0.41
171 Cmu | Empirical model constant | scalar | no | 0.09
172 initABL | Flag to initialise profiles with the theoretical <!--
173 --> ABL expressions, otherwise use "value" list <!--
174 --> | bool | no | true
175 value | ABL profile content when initABL=false <!--
176 --> | scalarList | conditional | -
177 phi | Name of the flux field | word | no | phi
178 C1 | Curve-fitting coefficient \c YGCJ profiles | scalar | no | 0.0
179 C2 | Curve-fitting coefficient \c YGCJ profiles | scalar | no | 1.0
180 \endtable
181
182Note
183 - The \c RH expressions are special cases of those in \c YGCJ when \c C1=0
184 and \c C2=1. Both \c C1 and \c C2 can be determined by nonlinear fitting
185 of (\c YGCJ:Eqs. 19-20) with an experimental dataset for \c k. By default,
186 \c atmBoundaryLayerInlet boundary conditions compute \c RH expressions.
187 - \c z is the ground-normal height relative to the global minimum height
188 of the inlet patch; therefore, the minimum of \c z is always zero
189 irrespective of the absolute z-coordinate of the computational patch.
190 - The derived ABL expressions automatically satisfy the simplified transport
191 equation for \c k. Yet the same expressions only satisfy the simplified
192 transport equation for \c epsilon when the model constants \c sigmaEpsilon
193 is 1.11 with \c kappa=0.4 (\c HW:p. 358).
194 - \c atmBoundaryLayerInlet boundary conditions inherit \c inletOutlet
195 traits, so that a given inlet condition can be supplied from all sides of
196 the domain, e.g. a ground-normal cylinder domain having a single
197 inlet/outlet boundary where the changes between inlet and outlet depend
198 on the wind direction and patch normals, so that any change in inflow
199 orientation can be handled with the same mesh.
200 - \c d is the displacement height, and "is relevant for flows over forests
201 and cities" (E:p. 28). "The displacement height gives the vertical
202 displacement of the entire flow regime over areas which are densely covered
203 with obstacles such as trees or buildings" (E:p. 28).
204
205See also
206 - Foam::atmBoundaryLayerInletVelocityFvPatchVectorField
207 - Foam::atmBoundaryLayerInletKFvPatchScalarField
208 - Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField
209 - Foam::atmBoundaryLayerInletOmegaFvPatchScalarField
210
211SourceFiles
212 atmBoundaryLayer.C
213
214\*---------------------------------------------------------------------------*/
215
216#ifndef atmBoundaryLayer_H
217#define atmBoundaryLayer_H
218
219#include "fvPatchFields.H"
220#include "Function1.H"
221#include "PatchFunction1.H"
222
223// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224
225namespace Foam
226{
227
228/*---------------------------------------------------------------------------*\
229 Class atmBoundaryLayer Declaration
230\*---------------------------------------------------------------------------*/
231
232class atmBoundaryLayer
233{
234protected:
235
236 // Protected Data
237
238 //- Flag to initialise profiles with the theoretical ABL expressions,
239 //- otherwise initialises by using "value" entry content
240 bool initABL_;
241
242
243private:
244
245 // Private Data
246
247 //- von Kármán constant
248 const scalar kappa_;
249
250 //- Empirical model constant
251 const scalar Cmu_;
252
253 //- Curve-fitting coefficient
254 const scalar C1_;
255
256 //- Curve-fitting coefficient
257 const scalar C2_;
258
259 //- Minimum coordinate vector of this patch
260 const vector ppMin_;
261
262 //- Reference to the time database
263 const Time& time_;
264
265 //- Reference to the patch
266 const polyPatch& patch_;
267
268 //- Streamwise flow direction
269 autoPtr<Function1<vector>> flowDir_;
270
271 //- Direction of the ground-normal coordinate
272 autoPtr<Function1<vector>> zDir_;
273
274 //- Reference mean streamwise flow speed being used in Ustar estimations
275 autoPtr<Function1<scalar>> Uref_;
276
277 //- Reference height being used in Ustar estimations
278 autoPtr<Function1<scalar>> Zref_;
279
280 //- Surface roughness length
281 autoPtr<PatchFunction1<scalar>> z0_;
282
283 //- Displacement height
284 autoPtr<PatchFunction1<scalar>> d_;
285
286
287public:
288
289 // Constructors
290
291 //- Construct null from time
292 atmBoundaryLayer(const Time& time, const polyPatch& pp);
293
294 //- Construct from the time database and dictionary
296 (
297 const Time& time,
298 const polyPatch& pp,
299 const dictionary& dict
300 );
301
302 //- Construct by mapping given atmBoundaryLayer onto a new patch
304 (
305 const atmBoundaryLayer& abl,
306 const fvPatch& patch,
307 const fvPatchFieldMapper& mapper
308 );
309
310 //- Construct as copy
311 atmBoundaryLayer(const atmBoundaryLayer&);
312
313
314 // Member Functions
315
316 // Access
317
318 //- Return flow direction
319 vector flowDir() const;
320
321 //- Return the ground-normal direction
322 vector zDir() const;
323
324 //- Return friction velocity
325 tmp<scalarField> Ustar(const scalarField& z0) const;
326
327
328 // Mapping
329
330 //- Map (and resize as needed) from self given a mapping object
331 void autoMap(const fvPatchFieldMapper&);
332
333 //- Reverse map the given fvPatchField onto this fvPatchField
334 void rmap(const atmBoundaryLayer&, const labelList&);
335
336
337 // Evaluation
338
339 //- Return the velocity distribution for the ATM
340 tmp<vectorField> U(const vectorField& pCf) const;
341
342 //- Return the turbulent kinetic energy distribution for the ATM
343 tmp<scalarField> k(const vectorField& pCf) const;
344
345 //- Return the turbulent dissipation rate distribution for the ATM
346 tmp<scalarField> epsilon(const vectorField& pCf) const;
347
348 //- Return the specific dissipation rate distribution for the ATM
349 tmp<scalarField> omega(const vectorField& pCf) const;
350
351
352 //- Write
353 void write(Ostream&) const;
354};
355
356
357// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
358
359} // End namespace Foam
360
361// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
362
363#endif
364
365// ************************************************************************* //
label k
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Base class to set log-law type ground-normal inlet boundary conditions for wind velocity and turbulen...
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
tmp< scalarField > Ustar(const scalarField &z0) const
Return friction velocity.
atmBoundaryLayer(const Time &time, const polyPatch &pp)
Construct null from time.
tmp< scalarField > omega(const vectorField &pCf) const
Return the specific dissipation rate distribution for the ATM.
vector flowDir() const
Return flow direction.
vector zDir() const
Return the ground-normal direction.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
A class for managing temporary objects.
Definition: tmp.H:65
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
U
Definition: pEqn.H:72
scalar epsilon
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
runTime write()
dictionary dict