nutUWallFunctionFvPatchScalarField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::nutUWallFunctionFvPatchScalarField
29 
30 Group
31  grpWallFunctions
32 
33 Description
34  This boundary condition provides a wall function for the turbulent
35  viscosity (i.e. \c nut) based on velocity (i.e. \c U) for low- and
36  high-Reynolds number applications.
37 
38 Usage
39  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  // Mandatory entries
44  type nutUWallFunction;
45 
46  // Inherited entries
47  ...
48  }
49  \endverbatim
50 
51  where the entries mean:
52  \table
53  Property | Description | Type | Reqd | Deflt
54  type | Type name: nutUWallFunction | word | yes | -
55  \endtable
56 
57  The inherited entries are elaborated in:
58  - \link nutWallFunctionFvPatchScalarField.H \endlink
59  - \link wallFunctionBlenders.H \endlink
60 
61 Note
62  - Suffers from non-exact restart since \c correctNut() (called through
63  \c turbulence->validate) returns a slightly different value every time
64  it is called.
65  See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
66 
67 SourceFiles
68  nutUWallFunctionFvPatchScalarField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef nutUWallFunctionFvPatchScalarField_H
73 #define nutUWallFunctionFvPatchScalarField_H
74 
76 #include "wallFunctionBlenders.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class nutUWallFunctionFvPatchScalarField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class nutUWallFunctionFvPatchScalarField
88 :
89  public nutWallFunctionFvPatchScalarField,
90  private wallFunctionBlenders
91 {
92 protected:
93 
94  // Protected Member Functions
95 
96  //- Calculate the turbulent viscosity
97  virtual tmp<scalarField> calcNut() const;
98 
99  //- Calculate yPlus
101 
102  //- Write local wall function variables
103  void writeLocalEntries(Ostream&) const;
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("nutUWallFunction");
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const fvPatch&,
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const fvPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given
130  //- nutUWallFunctionFvPatchScalarField
131  //- onto a new patch
133  (
135  const fvPatch&,
137  const fvPatchFieldMapper&
138  );
139 
140  //- Construct as copy
142  (
144  );
145 
146  //- Construct and return a clone
147  virtual tmp<fvPatchScalarField> clone() const
148  {
150  (
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
164  (
166  ) const
167  {
169  (
171  );
172  }
173 
174 
175  // Member Functions
176 
177  // Evaluation
178 
179  //- Calculate and return the yPlus at the boundary
180  virtual tmp<scalarField> yPlus() const;
181 
182 
183  // I-O
184 
185  //- Write
186  virtual void write(Ostream& os) const;
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
This boundary condition provides a wall function for the turbulent viscosity (i.e. nut) based on velocity (i.e. U) for low- and high-Reynolds number applications.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
scalar magUp
tmp< scalarField > calcYPlus(const scalarField &magUp) const
Calculate yPlus.
A FieldMapper for finite-volume patch fields.
TypeName("nutUWallFunction")
Runtime type information.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
nutUWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
OBJstream os(runTime.globalPath()/outputName)
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void writeLocalEntries(Ostream &) const
Write local wall function variables.
Namespace for OpenFOAM.