nutWallFunctionFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::nutWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulent kinematic viscosity condition
29  when using wall functions, based on turbulence kinetic energy.
30  - replicates OpenFOAM v1.5 (and earlier) behaviour
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  Cmu | Cmu coefficient | no | 0.09
36  kappa | Von Karman constant | no | 0.41
37  E | E coefficient | no | 9.8
38  \endtable
39 
40  Examples of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type nutWallFunction;
45  value uniform 0.0;
46  }
47  \endverbatim
48 
49  Reference for the default model coefficients:
50  \verbatim
51  H. Versteeg, W. Malalasekera
52  An Introduction to Computational Fluid Dynamics: The Finite Volume
53  Method, subsection "3.5.2 k-epsilon model"
54  \endverbatim
55 
56 See also
57  Foam::fixedValueFvPatchField
58 
59 SourceFiles
60  nutWallFunctionFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef nutWallFunctionFvPatchScalarField_H
65 #define nutWallFunctionFvPatchScalarField_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class nutWallFunctionFvPatchScalarField Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class nutWallFunctionFvPatchScalarField
79 :
80  public fixedValueFvPatchScalarField
81 {
82 protected:
83 
84  // Protected data
85 
86  //- Cmu coefficient
87  scalar Cmu_;
88 
89  //- Von Karman constant
90  scalar kappa_;
91 
92  //- E coefficient
93  scalar E_;
94 
95  //- Y+ at the edge of the laminar sublayer
96  scalar yPlusLam_;
97 
98 
99  // Protected Member Functions
100 
101  //- Check the type of the patch
102  virtual void checkType();
103 
104  //- Calculate the turbulence viscosity
105  virtual tmp<scalarField> calcNut() const = 0;
107  //- Write local wall function variables
108  virtual void writeLocalEntries(Ostream&) const;
110 
111 public:
113  //- Runtime type information
114  TypeName("nutWallFunction");
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const fvPatch&,
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const fvPatch&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping given
135  // nutWallFunctionFvPatchScalarField
136  // onto a new patch
138  (
140  const fvPatch&,
142  const fvPatchFieldMapper&
143  );
144 
145  //- Construct as copy
147  (
149  );
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158 
159  // Member functions
160 
161  //- Calculate the Y+ at the edge of the laminar sublayer
162  static scalar yPlusLam(const scalar kappa, const scalar E);
163 
164  //- Return the Y+ at the edge of the laminar sublayer
165  scalar yPlusLam() const;
166 
167  //- Calculate and return the yPlus at the boundary
168  virtual tmp<scalarField> yPlus() const = 0;
169 
170 
171  // Evaluation functions
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176 
177  // I-O
178 
179  //- Write
180  virtual void write(Ostream&) const;
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
scalar yPlusLam() const
Return the Y+ at the edge of the laminar sublayer.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< scalarField > calcNut() const =0
Calculate the turbulence viscosity.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions...
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void checkType()
Check the type of the patch.
TypeName("nutWallFunction")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
nutWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:53
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
virtual tmp< scalarField > yPlus() const =0
Calculate and return the yPlus at the boundary.
Namespace for OpenFOAM.