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-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::nutUTabulatedWallFunctionFvPatchScalarField
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  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 \c $FOAM_CASE/constant directory.
42 
43 Usage
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  // Mandatory entries (unmodifiable)
49  type nutTabulatedWallFunction;
50  uPlusTable myUPlusTable;
51 
52  // Optional (inherited) entries
53  ...
54  }
55  \endverbatim
56 
57  where the entries mean:
58  \table
59  Property | Description | Type | Req'd | Dflt
60  type | Type name: nutUTabulatedWallFunction | word | yes | -
61  uPlusTable | u+ as a function of Re table name | word | yes | -
62  \endtable
63 
64  The inherited entries are elaborated in:
65  - \link nutWallFunctionFvPatchScalarField.H \endlink
66 
67 Note
68  - The tables are not registered since the same table object may be used for
69  more than one patch.
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 turbulent 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::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::uniformInterpolationTable< scalar >
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::nutUTabulatedWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the turbulent viscosity, i.e....
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:108
nutWallFunctionFvPatchScalarField.H
uniformInterpolationTable.H
Foam::nutUTabulatedWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.C:39
Foam::nutUTabulatedWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutUTabulatedWallFunctionFvPatchScalarField.H:173
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:120
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
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:123
os
OBJstream os(runTime.globalPath()/outputName)
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:117
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: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