nutUTabulatedWallFunctionFvPatchScalarField.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 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::nutUTabulatedWallFunctionFvPatchScalarField
29 
30 Group
31  grpWallFunctions
32 
33 Description
34  This boundary condition provides a wall constraint on the turbulent
35  kinematic viscosity, i.e. \c nut, when using wall functions, based on
36  velocity, i.e. \c U.
37 
38  As input, the user specifies a look-up table of \c U+ as a function of
39  near-wall Reynolds number.
40 
41  The table should be located in the $FOAM_CASE/constant directory.
42 
43 Usage
44  \table
45  Property | Description | Required | Default value
46  uPlusTable | U+ as a function of Re table name | yes |
47  Cmu | Model coefficient | no | 0.09
48  kappa | Von Karman constant | no | 0.41
49  E | Model coefficient | no | 9.8
50  \endtable
51 
52  Example of the boundary condition specification:
53  \verbatim
54  <patchName>
55  {
56  // Mandatory entries
57  type nutTabulatedWallFunction;
58  uPlusTable myUPlusTable;
59 
60  // Optional entries
61  }
62  \endverbatim
63 
64 Note
65  The tables are not registered since the same table object may be used for
66  more than one patch.
67 
68 See also
69  Foam::nutWallFunctionFvPatchScalarField
70 
71 SourceFiles
72  nutUTabulatedWallFunctionFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef nutUTabulatedWallFunctionFvPatchScalarField_H
77 #define nutUTabulatedWallFunctionFvPatchScalarField_H
78 
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class nutUTabulatedWallFunctionFvPatchScalarField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class nutUTabulatedWallFunctionFvPatchScalarField
92 :
93  public nutWallFunctionFvPatchScalarField
94 {
95 protected:
96 
97  // Protected Data
98 
99  //- Name of u+ table
100  word uPlusTableName_;
101 
102  //- u+ table
103  uniformInterpolationTable<scalar> uPlusTable_;
104 
105 
106  // Protected Member Functions
107 
108  //- Calculate the turbulence viscosity
109  virtual tmp<scalarField> calcNut() const;
110 
111  //- Calculate wall u+ from table
112  virtual tmp<scalarField> calcUPlus(const scalarField& Rey) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("nutTabulatedWallFunction");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given
139  //- nutUTabulatedWallFunctionFvPatchScalarField
140  //- onto a new patch
142  (
144  const fvPatch&,
146  const fvPatchFieldMapper&
147  );
148 
149  //- Construct as copy
151  (
153  );
154 
155  //- Construct and return a clone
156  virtual tmp<fvPatchScalarField> clone() const
157  {
159  (
161  );
162  }
163 
164  //- Construct as copy setting internal field reference
166  (
169  );
170 
171  //- Construct and return a clone setting internal field reference
173  (
175  ) const
176  {
178  (
180  );
181  }
182 
183 
184  // Member Functions
185 
186  // Evaluation functions
187 
188  //- Calculate and return the yPlus at the boundary
189  virtual tmp<scalarField> yPlus() const;
190 
191 
192  // I-O
193 
194  //- Write
195  virtual void write(Ostream& os) const;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus
virtual tmp< scalarField > calcUPlus(const scalarField &Rey) const
Calculate wall u+ from table.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:71
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::uniformInterpolationTable< scalar >
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::nutUTabulatedWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the turbulent kinematic viscosity,...
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:115
nutWallFunctionFvPatchScalarField.H
uniformInterpolationTable.H
Foam::nutUTabulatedWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:39
Foam::nutUTabulatedWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:180
Foam::nutUTabulatedWallFunctionFvPatchScalarField::yPlus
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:183
Foam::Field< scalar >
Foam::nutUTabulatedWallFunctionFvPatchScalarField::uPlusTable_
uniformInterpolationTable< scalar > uPlusTable_
u+ table
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:127
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Foam::nutUTabulatedWallFunctionFvPatchScalarField::nutUTabulatedWallFunctionFvPatchScalarField
nutUTabulatedWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:91
Foam::nutUTabulatedWallFunctionFvPatchScalarField::TypeName
TypeName("nutTabulatedWallFunction")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::nutUTabulatedWallFunctionFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:207
Foam::nutUTabulatedWallFunctionFvPatchScalarField::uPlusTableName_
word uPlusTableName_
Name of u+ table.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:124
Rey
scalar Rey
Definition: evaluateNearWall.H:28
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:110
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54