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-2020 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 constraint on the turbulent
35  viscosity, i.e. \c nut, based on velocity, i.e. \c U, for low- and
36  high-Reynolds number turbulence models.
37 
38 Usage
39  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  // Mandatory entries (unmodifiable)
44  type nutUWallFunction;
45 
46  // Optional (inherited) entries
47  ...
48  }
49  \endverbatim
50 
51  where the entries mean:
52  \table
53  Property | Description | Type | Req'd | Dflt
54  type | Type name: nutUWallFunction | word | yes | -
55  \endtable
56 
57  The inherited entries are elaborated in:
58  - \link nutWallFunctionFvPatchScalarField.H \endlink
59 
60 Note
61  - Suffers from non-exact restart since \c correctNut() (called through
62  \c turbulence->validate) returns a slightly different value every time
63  it is called.
64  See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
65  - See \link nutWallFunctionFvPatchScalarField.H \endlink for the wall
66  function blending treatments.
67 
68 SourceFiles
69  nutUWallFunctionFvPatchScalarField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef nutUWallFunctionFvPatchScalarField_H
74 #define nutUWallFunctionFvPatchScalarField_H
75 
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class nutUWallFunctionFvPatchScalarField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class nutUWallFunctionFvPatchScalarField
88 :
89  public nutWallFunctionFvPatchScalarField
90 {
91 protected:
92 
93  // Protected Member Functions
94 
95  //- Calculate yPlus
96  virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
97 
98  //- Calculate the turbulent viscosity
99  virtual tmp<scalarField> calcNut() const;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("nutUWallFunction");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  //- nutUWallFunctionFvPatchScalarField
127  //- onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchScalarField> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member Functions
172 
173  // Evaluation functions
174 
175  //- Calculate and return the yPlus at the boundary
176  virtual tmp<scalarField> yPlus() const;
177 
178 
179  // I-O
180 
181  //- Write
182  virtual void write(Ostream& os) const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::nutUWallFunctionFvPatchScalarField::yPlus
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
Definition: nutUWallFunctionFvPatchScalarField.C:183
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
nutWallFunctionFvPatchScalarField.H
magUp
scalar magUp
Definition: evaluateNearWall.H:10
Foam::nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
nutUWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutUWallFunctionFvPatchScalarField.C:129
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::nutUWallFunctionFvPatchScalarField::TypeName
TypeName("nutUWallFunction")
Runtime type information.
Foam::nutUWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutUWallFunctionFvPatchScalarField.H:154
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::nutUWallFunctionFvPatchScalarField::calcYPlus
virtual tmp< scalarField > calcYPlus(const scalarField &magUp) const
Calculate yPlus.
Definition: nutUWallFunctionFvPatchScalarField.C:81
Foam::nutUWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the turbulent viscosity, i.e....
Definition: nutUWallFunctionFvPatchScalarField.H:98
Foam::nutUWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
Definition: nutUWallFunctionFvPatchScalarField.C:39
Foam::nutUWallFunctionFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: nutUWallFunctionFvPatchScalarField.C:226
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54