Loading...
Searching...
No Matches
atmNutWallFunctionFvPatchScalarField.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) 2020 CENER
9 Copyright (C) 2020-2022 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::atmNutWallFunctionFvPatchScalarField
29
30Group
31 grpAtmWallFunctions
32
33Description
34 This boundary condition provides a wall constraint on the turbulent
35 viscosity (i.e. \c nut) based on the turbulent kinetic energy (i.e. \c k)
36 and velocity (i.e. \c U) for atmospheric boundary layer modelling.
37
38 The governing equation of the boundary condition:
39
40 \f[
41 \tau_w = {U^*_u} {U^*_k}
42 \f]
43
44 with
45
46 \f[
47 {U^*_u} = \frac{\kappa U_w}{ln(z_p / z_0)}
48 \f]
49
50 \f[
51 {U^*_k} = C_{\mu}^{1/4} \sqrt{k}
52 \f]
53
54 where
55 \vartable
56 \tau_w | wall shear stress
57 U^*_u | local friction velocity based on near-ground velocity
58 U^*_k | local friction velocity based on near-ground k
59 \kappa | von Kármán constant
60 U_w | near-ground velocity
61 z_p | vertical coordinate
62 z_0 | surface roughness length [m]
63 C_mu | empirical model constant
64 k | turbulent kinetic energy
65 \endvartable
66
67 References:
68 \verbatim
69 Theoretical expressions (tags:RH, SBJM, SM):
70 Richards, P. J., & Hoxey, R. P. (1993).
71 Appropriate boundary conditions for computational wind
72 engineering models using the k-ε turbulence model.
73 In Computational Wind Engineering 1 (pp. 145-153).
74 DOI:10.1016/B978-0-444-81688-7.50018-8
75
76 Sørensen, N. N., Bechmann, A., Johansen, J., Myllerup, L.,
77 Botha, P., Vinther, S., & Nielsen, B. S. (2007).
78 Identification of severe wind conditions using
79 a Reynolds Averaged Navier-Stokes solver.
80 In Journal of Physics: Conference
81 series (Vol. 75, No. 1, p. 012053).
82 DOI:10.1088/1742-6596/75/1/012053
83
84 Sumner, J., & Masson, C. (2012).
85 k−ε simulations of the neutral atmospheric boundary layer:
86 analysis and correction of discretization errors on practical grids.
87 International journal for numerical
88 methods in fluids, 70(6), 724-741.
89 DOI:10.1002/fld.2709
90 \endverbatim
91
92 Required fields:
93 \verbatim
94 nut | Turbulent viscosity [m2/s]
95 k | Turbulent kinetic energy [m2/s2]
96 \endverbatim
97
98Usage
99 Example of the boundary condition specification:
100 \verbatim
101 <patchName>
102 {
103 // Mandatory entries
104 type atmNutWallFunction;
105 z0Min <scalar>;
106 z0 <PatchFunction1<scalar>>;
107
108 // Inherited entries
109 ...
110 }
111 \endverbatim
112
113 where the entries mean:
114 \table
115 Property | Description | Type | Reqd | Deflt
116 type | Type name: nutAtmWallFunction | word | yes | -
117 z0Min | Minimum surface roughness length [m] | scalar | yes | -
118 z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
119 \endtable
120
121 The inherited entries are elaborated in:
122 - \link nutkWallFunctionFvPatchScalarField.H \endlink
123 - \link PatchFunction1.H \endlink
124
125SourceFiles
126 atmNutWallFunctionFvPatchScalarField.C
127
128\*---------------------------------------------------------------------------*/
129
130#ifndef atmNutWallFunctionFvPatchScalarField_H
131#define atmNutWallFunctionFvPatchScalarField_H
132
134#include "PatchFunction1.H"
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138namespace Foam
139{
140
141/*---------------------------------------------------------------------------*\
142 Class atmNutWallFunctionFvPatchScalarField Declaration
143\*---------------------------------------------------------------------------*/
144
146:
148{
149
150 // Private Data
151
152 //- Minimum surface roughness length [m]
153 const scalar z0Min_;
154
155 //- Surface roughness length field [m]
156 autoPtr<PatchFunction1<scalar>> z0_;
157
158
159protected:
160
161 // Protected Member Functions
162
163 //- Calculate the turbulent viscosity
164 virtual tmp<scalarField> calcNut() const;
165
166 //- Write local wall function variables
167 void writeLocalEntries(Ostream&) const;
168
169
170public:
171
172 //- Runtime type information
173 TypeName("atmNutWallFunction");
174
175
176 // Constructors
177
178 //- Construct from patch and internal field
180 (
181 const fvPatch&,
182 const DimensionedField<scalar, volMesh>&
183 );
184
185 //- Construct from patch, internal field and dictionary
187 (
188 const fvPatch&,
189 const DimensionedField<scalar, volMesh>&,
190 const dictionary&
191 );
192
193 //- Construct by mapping given
194 //- atmNutWallFunctionFvPatchScalarField
195 //- onto a new patch
197 (
199 const fvPatch&,
201 const fvPatchFieldMapper&
202 );
203
204 //- Construct as copy
206 (
208 );
209
210 //- Construct as copy setting internal field reference
212 (
215 );
216
217 //- Return a clone
218 virtual tmp<fvPatchField<scalar>> clone() const
219 {
220 return fvPatchField<scalar>::Clone(*this);
221 }
222
223 //- Clone with an internal field reference
225 (
227 ) const
228 {
229 return fvPatchField<scalar>::Clone(*this, iF);
230 }
231
232
233 // Member Functions
234
235 // Mapping
236
237 //- Map (and resize as needed) from self given a mapping object
238 virtual void autoMap(const fvPatchFieldMapper&);
239
240 //- Reverse map the given fvPatchField onto this fvPatchField
241 virtual void rmap
242 (
243 const fvPatchScalarField&,
244 const labelList&
245 );
246
247
248 // I-O
249
250 //- Write
251 virtual void write(Ostream&) const;
252};
253
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257} // End namespace Foam
258
259// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260
261#endif
262
263// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
This boundary condition provides a wall constraint on the turbulent viscosity (i.e....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("atmNutWallFunction")
Runtime type information.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
void writeLocalEntries(Ostream &) const
Write local wall function variables.
atmNutWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
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
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
This boundary condition provides a wall function for the turbulent viscosity (i.e....
nutkWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
fvPatchField< scalar > fvPatchScalarField
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68