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-2015 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  \heading Patch usage
36 
37  \table
38  Property | Description | Required | Default value
39  Cmu | Cmu coefficient | no | 0.09
40  kappa | Von Karman constant | no | 0.41
41  E | E coefficient | no | 9.8
42  \endtable
43 
44  Examples of the boundary condition specification:
45  \verbatim
46  myPatch
47  {
48  type nutWallFunction;
49  value uniform 0.0;
50  }
51  \endverbatim
52 
53  Reference for the default model coefficients:
54  \verbatim
55  H. Versteeg, W. Malalasekera
56  An Introduction to Computational Fluid Dynamics: The Finite Volume
57  Method, subsection "3.5.2 k-epsilon model"
58  \endverbatim
59 
60 SeeAlso
61  Foam::fixedValueFvPatchField
62 
63 SourceFiles
64  nutWallFunctionFvPatchScalarField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef nutWallFunctionFvPatchScalarField_H
69 #define nutWallFunctionFvPatchScalarField_H
70 
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class nutWallFunctionFvPatchScalarField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class nutWallFunctionFvPatchScalarField
83 :
84  public fixedValueFvPatchScalarField
85 {
86 protected:
87 
88  // Protected data
89 
90  //- Cmu coefficient
91  scalar Cmu_;
92 
93  //- Von Karman constant
94  scalar kappa_;
95 
96  //- E coefficient
97  scalar E_;
98 
99  //- Y+ at the edge of the laminar sublayer
100  scalar yPlusLam_;
101 
102 
103  // Protected Member Functions
104 
105  //- Check the type of the patch
106  virtual void checkType();
107 
108  //- Calculate the turbulence viscosity
109  virtual tmp<scalarField> calcNut() const = 0;
110 
111  //- Write local wall function variables
112  virtual void writeLocalEntries(Ostream&) const;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("nutWallFunction");
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  // nutWallFunctionFvPatchScalarField
140  // onto a new patch
142  (
144  const fvPatch&,
146  const fvPatchFieldMapper&
147  );
148 
149  //- Construct as copy
151  (
153  );
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162 
163  // Member functions
164 
165  //- Calculate the Y+ at the edge of the laminar sublayer
166  static scalar yPlusLam(const scalar kappa, const scalar E);
167 
168  //- Calculate and return the yPlus at the boundary
169  virtual tmp<scalarField> yPlus() const = 0;
170 
171 
172  // Evaluation functions
173 
174  //- Update the coefficients associated with the patch field
175  virtual void updateCoeffs();
176 
177 
178  // I-O
179 
180  //- Write
181  virtual void write(Ostream&) const;
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
nutWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutWallFunctionFvPatchScalarField.C:69
Foam::nutWallFunctionFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: nutWallFunctionFvPatchScalarField.C:169
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::nutWallFunctionFvPatchScalarField::yPlusLam_
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
Definition: nutWallFunctionFvPatchScalarField.H:119
Foam::nutWallFunctionFvPatchScalarField::yPlus
virtual tmp< scalarField > yPlus() const =0
Calculate and return the yPlus at the boundary.
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::nutWallFunctionFvPatchScalarField::kappa_
scalar kappa_
Von Karman constant.
Definition: nutWallFunctionFvPatchScalarField.H:113
Foam::nutWallFunctionFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: nutWallFunctionFvPatchScalarField.C:182
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::nutWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const =0
Calculate the turbulence viscosity.
Foam::nutWallFunctionFvPatchScalarField::TypeName
TypeName("nutWallFunction")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::nutWallFunctionFvPatchScalarField::E_
scalar E_
E coefficient.
Definition: nutWallFunctionFvPatchScalarField.H:116
Foam::nutWallFunctionFvPatchScalarField::Cmu_
scalar Cmu_
Cmu coefficient.
Definition: nutWallFunctionFvPatchScalarField.H:110
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::nutWallFunctionFvPatchScalarField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
Definition: nutWallFunctionFvPatchScalarField.H:101
Foam::nutWallFunctionFvPatchScalarField::yPlusLam
static scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
Definition: nutWallFunctionFvPatchScalarField.C:153
Foam::nutWallFunctionFvPatchScalarField::writeLocalEntries
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
Definition: nutWallFunctionFvPatchScalarField.C:58
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::nutWallFunctionFvPatchScalarField::checkType
virtual void checkType()
Check the type of the patch.
Definition: nutWallFunctionFvPatchScalarField.C:44