nutUBlendedWallFunctionFvPatchScalarField.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) 2016-2020 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::nutUBlendedWallFunctionFvPatchScalarField
28 
29 Group
30  grpWallFunctions
31 
32 Description
33  This boundary condition provides a wall constraint on the turbulent
34  viscosity, i.e. \c nut, based on velocity, i.e. \c U, using a
35  binomial-function wall-function blending method between the viscous
36  and inertial sublayer predictions of \c nut for low- and high-Reynolds
37  number turbulence models.
38 
39  \f[
40  u_\tau = (u_{\tau,v}^n + u_{\tau,l}^n)^{1/n}
41  \f]
42 
43  where
44  \vartable
45  u_\tau | Friction velocity
46  u_{\tau,v} | Friction velocity in the viscous sublayer
47  u_{\tau,l} | Friction velocity in the inertial sublayer
48  \endvartable
49 
50  Reference:
51  \verbatim
52  See the section that describes 'automatic wall treatment':
53  Menter, F., Ferreira, J. C., Esch, T., Konno, B. (2003).
54  The SST turbulence model with improved wall treatment
55  for heat transfer predictions in gas turbines.
56  In Proceedings of the International Gas Turbine Congress.
57  November, 2003. Tokyo, Japan. pp. 2-7.
58  \endverbatim
59 
60 Usage
61  Example of the boundary condition specification:
62  \verbatim
63  <patchName>
64  {
65  // Mandatory entries (unmodifiable)
66  type nutUBlendedWallFunction;
67 
68  // Optional entries (unmodifiable)
69  n 4.0;
70 
71  // Optional (inherited) entries
72  ...
73  }
74  \endverbatim
75 
76  where the entries mean:
77  \table
78  Property | Description | Type | Req'd | Dflt
79  type | Type name: nutUBlendedWallFunction | word | yes | -
80  n | Blending factor | scalar | no | 4.0
81  \endtable
82 
83  The inherited entries are elaborated in:
84  - \link nutWallFunctionFvPatchScalarField.H \endlink
85 
86 Note
87  - The full 'automatic wall treatment' description also requires use of the
88  \link omegaWallFunctionFvPatchScalarField.H \endlink with the \c blending
89  option \c binomial or with the deprecated \c blended flag set to \c on.
90  - Suffers from non-exact restart since \c correctNut() (called through
91  \c turbulence->validate) returns a slightly different value every time
92  it is called.
93  See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
94 
95 See also
96  - Foam::nutWallFunctionFvPatchScalarField
97  - Foam::omegaWallFunctionFvPatchScalarField
98 
99 SourceFiles
100  nutUBlendedWallFunctionFvPatchScalarField.C
101 
102 \*---------------------------------------------------------------------------*/
103 
104 #ifndef nutUBlendedWallFunctionFvPatchScalarField_H
105 #define nutUBlendedWallFunctionFvPatchScalarField_H
106 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
113 
114 /*---------------------------------------------------------------------------*\
115  Class nutUBlendedWallFunctionFvPatchScalarField Declaration
116 \*---------------------------------------------------------------------------*/
117 
118 class nutUBlendedWallFunctionFvPatchScalarField
119 :
120  public nutWallFunctionFvPatchScalarField
121 {
122 protected:
123 
124  // Protected Data
125 
126  //- Model coefficient; default = 4
127  scalar n_;
128 
129 
130  // Protected Member Functions
131 
132  //- Calculate the turbulent viscosity
133  virtual tmp<scalarField> calcNut() const;
134 
135  //- Calculate the friction velocity
136  virtual tmp<scalarField> calcUTau(const scalarField& magGradU) const;
137 
138 
139 public:
140 
141  //- Runtime type information
142  TypeName("nutUBlendedWallFunction");
143 
144 
145  // Constructors
146 
147  //- Construct from patch and internal field
149  (
150  const fvPatch&,
152  );
153 
154  //- Construct from patch, internal field and dictionary
156  (
157  const fvPatch&,
159  const dictionary&
160  );
161 
162  //- Construct by mapping given
163  //- nutUBlendedWallFunctionFvPatchScalarField
164  //- onto a new patch
166  (
168  const fvPatch&,
170  const fvPatchFieldMapper&
171  );
172 
173  //- Construct as copy
175  (
177  );
178 
179  //- Construct and return a clone
180  virtual tmp<fvPatchScalarField> clone() const
181  {
183  (
185  );
186  }
187 
188  //- Construct as copy setting internal field reference
190  (
193  );
194 
195  //- Construct and return a clone setting internal field reference
197  (
199  ) const
200  {
202  (
204  );
205  }
206 
207 
208  // Member Functions
209 
210  // Evaluation functions
211 
212  //- Calculate and return the yPlus at the boundary
213  virtual tmp<scalarField> yPlus() const;
214 
215 
216  // I-O
217 
218  //- Write
219  virtual void write(Ostream& os) const;
220 };
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 } // End namespace Foam
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #endif
230 
231 // ************************************************************************* //
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::nutUBlendedWallFunctionFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: nutUBlendedWallFunctionFvPatchScalarField.C:211
Foam::nutUBlendedWallFunctionFvPatchScalarField::nutUBlendedWallFunctionFvPatchScalarField
nutUBlendedWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutUBlendedWallFunctionFvPatchScalarField.C:125
nutWallFunctionFvPatchScalarField.H
Foam::nutUBlendedWallFunctionFvPatchScalarField::yPlus
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
Definition: nutUBlendedWallFunctionFvPatchScalarField.C:188
Foam::nutUBlendedWallFunctionFvPatchScalarField::calcUTau
virtual tmp< scalarField > calcUTau(const scalarField &magGradU) const
Calculate the friction velocity.
Definition: nutUBlendedWallFunctionFvPatchScalarField.C:64
Foam::nutUBlendedWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the turbulent viscosity, i.e....
Definition: nutUBlendedWallFunctionFvPatchScalarField.H:147
Foam::Field< scalar >
Foam::nutUBlendedWallFunctionFvPatchScalarField::TypeName
TypeName("nutUBlendedWallFunction")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::nutUBlendedWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutUBlendedWallFunctionFvPatchScalarField.H:209
Foam::nutUBlendedWallFunctionFvPatchScalarField::n_
scalar n_
Model coefficient; default = 4.
Definition: nutUBlendedWallFunctionFvPatchScalarField.H:156
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::nutWallFunctionFvPatchScalarField
The class nutWallFunction is a base class that parents the derived boundary conditions which provide ...
Definition: nutWallFunctionFvPatchScalarField.H:251
Foam::nutUBlendedWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
Definition: nutUBlendedWallFunctionFvPatchScalarField.C:37
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54