nutWallFunctionFvPatchScalarField.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 | Copyright (C) 2011-2016 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 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulent kinematic viscosity condition
32  when using wall functions, based on turbulence kinetic energy.
33  - replicates OpenFOAM v1.5 (and earlier) behaviour
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  Cmu | Cmu coefficient | no | 0.09
39  kappa | Von Karman constant | no | 0.41
40  E | E coefficient | no | 9.8
41  \endtable
42 
43  Examples of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type nutWallFunction;
48  value uniform 0.0;
49  }
50  \endverbatim
51 
52  Reference for the default model coefficients:
53  \verbatim
54  H. Versteeg, W. Malalasekera
55  An Introduction to Computational Fluid Dynamics: The Finite Volume
56  Method, subsection "3.5.2 k-epsilon model"
57  \endverbatim
58 
59 See also
60  Foam::fixedValueFvPatchField
61 
62 SourceFiles
63  nutWallFunctionFvPatchScalarField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef nutWallFunctionFvPatchScalarField_H
68 #define nutWallFunctionFvPatchScalarField_H
69 
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class nutWallFunctionFvPatchScalarField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class nutWallFunctionFvPatchScalarField
82 :
83  public fixedValueFvPatchScalarField
84 {
85 protected:
86 
87  // Protected data
88 
89  //- Cmu coefficient
90  scalar Cmu_;
91 
92  //- Von Karman constant
93  scalar kappa_;
94 
95  //- E coefficient
96  scalar E_;
97 
98  //- Y+ at the edge of the laminar sublayer
99  scalar yPlusLam_;
101 
102  // Protected Member Functions
103 
104  //- Check the type of the patch
105  virtual void checkType();
106 
107  //- Calculate the turbulence viscosity
108  virtual tmp<scalarField> calcNut() const = 0;
110  //- Write local wall function variables
111  virtual void writeLocalEntries(Ostream&) const;
113 
114 public:
116  //- Runtime type information
117  TypeName("nutWallFunction");
119 
120  // Constructors
121 
122  //- Construct from patch and internal field
124  (
125  const fvPatch&,
127  );
128 
129  //- Construct from patch, internal field and dictionary
131  (
132  const fvPatch&,
134  const dictionary&
135  );
136 
137  //- Construct by mapping given
138  // nutWallFunctionFvPatchScalarField
139  // onto a new patch
141  (
143  const fvPatch&,
145  const fvPatchFieldMapper&
146  );
147 
148  //- Construct as copy
150  (
152  );
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161 
162  // Member functions
163 
164  //- Calculate the Y+ at the edge of the laminar sublayer
165  static scalar yPlusLam(const scalar kappa, const scalar E);
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 // ************************************************************************* //
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].
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
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.
static scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
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:54
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.