wallFunctionBlenders.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) 2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::wallFunctionBlenders
28 
29 Description
30  The class \c wallFunctionBlenders is a base class that
31  hosts common entries for various derived wall-function boundary
32  conditions to be used in low- and high-Reynolds number applications.
33 
34  Reference:
35  \verbatim
36  Default model coefficients (tag:VM):
37  Versteeg, H. K., & Malalasekera, W. (2011).
38  An introduction to computational fluid dynamics: The finite
39  volume method. Harlow: Pearson Education.
40  Subsection "3.5.2 k-epsilon model".
41 
42  Binomial blending of the viscous and inertial sublayers (tag:ME):
43  Menter, F., & Esch, T. (2001).
44  Elements of industrial heat transfer prediction.
45  In Proceedings of the 16th Brazilian Congress of Mechanical
46  Engineering (COBEM), November 2001. vol. 20, p. 117-127.
47 
48  Exponential/Max blending of the viscous and inertial sublayers (tag:PH):
49  Popovac, M., & Hanjalić, K. (2007).
50  Compound wall treatment for RANS computation of complex
51  turbulent flows and heat transfer.
52  Flow, turbulence and combustion, 78(2), 177-202.
53  DOI:10.1007/s10494-006-9067-x
54 
55  Tanh blending of the viscous and inertial sublayers (tag:KAS):
56  Knopp, T., Alrutz, T., & Schwamborn, D. (2006).
57  A grid and flow adaptive wall-function method for RANS
58  turbulence modelling.
59  Journal of Computational Physics, 220(1), 19-40.
60  DOI:10.1016/j.jcp.2006.05.003
61  \endverbatim
62 
63 Usage
64  Example of the boundary condition specification:
65  \verbatim
66  <patchName>
67  {
68  // Top-level entries
69  ...
70 
71  // Optional entries
72  blending stepwise;
73  n 4.0;
74 
75  // Inherited entries
76  ...
77  }
78  \endverbatim
79 
80  where the entries mean:
81  \table
82  Property | Description | Type | Reqd | Deflt
83  blending | Viscous/inertial sublayer blending | word | no | stepwise
84  n | Binomial blending exponent | scalar | no | 2.0
85  \endtable
86 
87  Options for the \c blending entry:
88  \verbatim
89  stepwise | Stepwise switch (discontinuous)
90  max | Maximum value switch (discontinuous)
91  binomial | Binomial blending (smooth)
92  exponential | Exponential blending (smooth)
93  tanh | Tanh blending (smooth)
94  \endverbatim
95 
96  wherein predictions of a given quantity (e.g. \c nut) for viscous and
97  inertial sublayers are blended according to the following expressions:
98 
99  - \c stepwise (default):
100 
101  \f[
102  \phi = \phi_{log} \qquad if \quad y^+ > y^+_{intersection}
103  \f]
104 
105  \f[
106  \phi = \phi_{vis} \qquad if \quad y^+ <= y^+_{intersection}
107  \f]
108 
109  where
110  \vartable
111  \phi_{vis} | \f$\phi\f$ prediction in viscous sublayer
112  \phi_{log} | \f$\phi\f$ prediction in inertial sublayer
113  y^+ | estimated wall-normal height of cell centre in wall units
114  y^+_{intersection} | estimated \f$y^+\f$ where sublayers intersect
115  \endvartable
116 
117 
118  - \c max (PH:Eq. 27):
119 
120  \f[
121  \nu_t = max({\nu_t}_{vis}, {\nu_t}_{log})
122  \f]
123 
124 
125  - \c binomial (ME:Eqs. 15-16):
126 
127  \f[
128  \phi = ((\phi_{vis})^n + (\phi_{log})^n)^{1/n}
129  \f]
130  where
131  \vartable
132  n | Binomial blending exponent
133  \endvartable
134 
135 
136  - \c exponential (PH:Eq. 32):
137 
138  \f[
139  \phi = \phi_{vis} \exp[-\Gamma] + \phi_{log} \exp[-1/\Gamma]
140  \f]
141 
142  where (PH:Eq. 31)
143  \vartable
144  \Gamma | Blending expression
145  \Gamma | \f$0.01 (y^+)^4 / (1.0 + 5.0 y^+)\f$
146  \endvartable
147 
148 
149  - \c tanh (KAS:Eqs. 33-34):
150 
151  \f[
152  \phi = \eta \phi_{b1} + (1 - \eta)\phi_{b2}
153  \f]
154 
155  where
156  \vartable
157  \eta | \f$tanh((y^+/10)^4)\f$
158  \phi_{b1} | \f$\phi_{vis} + \phi_{log}\f$
159  \phi_{b2} | \f$(\phi_{vis}^{1.2} + \phi_{log}^1.2)^{1/1.2}\f$
160  \endvartable
161 
162  \c G predictions for viscous and inertial sublayers are blended
163  in a stepwise manner, and \c G below \f$y^+_{intersection}\f$
164  (i.e. in the viscous sublayer) is presumed to be zero.
165 
166  Blending treatments are enabled for the following wall functions:
167  - \link epsilonWallFunctionFvPatchScalarField.H \endlink
168  - \link omegaWallFunctionFvPatchScalarField.H \endlink
169  - \link nutkWallFunctionFvPatchScalarField.H \endlink
170  - \link nutUWallFunctionFvPatchScalarField.H \endlink
171 
172 SourceFiles
173  wallFunctionBlenders.C
174 
175 \*---------------------------------------------------------------------------*/
176 
177 #ifndef Foam_wallFunctionBlenders_H
178 #define Foam_wallFunctionBlenders_H
179 
180 #include "scalarFwd.H"
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 namespace Foam
185 {
186 
187 // Forward Declarations
188 class dictionary;
189 class Ostream;
190 template<class EnumType> class Enum;
191 
192 /*---------------------------------------------------------------------------*\
193  Class wallFunctionBlenders Declaration
194 \*---------------------------------------------------------------------------*/
195 
196 class wallFunctionBlenders
197 {
198 protected:
199 
200  // Protected Enumerations
201 
202  //- Options for the blending treatment of viscous and inertial sublayers
203  enum blenderType
204  {
205  STEPWISE,
206  MAX,
207  BINOMIAL,
208  EXPONENTIAL,
209  TANH
210  };
211 
212  //- Names for blenderType
213  static const Enum<blenderType> blenderTypeNames;
214 
215 
216  // Protected Data
217 
218  //- Blending treatment
219  enum blenderType blender_;
220 
221  //- Binomial blending exponent being used when
222  //- blenderType is blenderType::BINOMIAL
223  scalar n_;
224 
225 
226 public:
227 
228  // Constructors
229 
230  //- Default construct with default coefficients
232 
233  //- Construct from dictionary and default parameters
235  (
236  const dictionary& dict,
237  const blenderType blender,
238  const scalar n
239  );
240 
241 
242  // Member Functions
243 
244  // I-O
245 
246  //- Write wall-function blending data as dictionary entries
247  void writeEntries(Ostream&) const;
248 };
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
259 // ************************************************************************* //
scalar n_
Binomial blending exponent being used when blenderType is blenderType::BINOMIAL.
dictionary dict
"Stepwise switch (discontinuous)"
Typedefs for float/double/scalar without requiring scalar.H.
void writeEntries(Ostream &) const
Write wall-function blending data as dictionary entries.
"Maximum value switch (discontinuous)"
label n
enum blenderType blender_
Blending treatment.
static const Enum< blenderType > blenderTypeNames
Names for blenderType.
blenderType
Options for the blending treatment of viscous and inertial sublayers.
wallFunctionBlenders()
Default construct with default coefficients.
Namespace for OpenFOAM.
"Exponential blending (smooth)"