kLowReWallFunctionFvPatchScalarField.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) 2012-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::kLowReWallFunctionFvPatchScalarField
26 
27 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulence kinetic energy wall function
32  condition for low- and high-Reynolds number turbulent flow cases.
33 
34  The model operates in two modes, based on the computed laminar-to-turbulent
35  switch-over y+ value derived from kappa and E.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  Cmu | model coefficient | no | 0.09
41  kappa | Von Karman constant | no | 0.41
42  E | model coefficient | no | 9.8
43  Ceps2 | model coefficient | no | 1.9
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type kLowReWallFunction;
51  }
52  \endverbatim
53 
54 See also
55  Foam::fixedValueFvPatchField
56 
57 SourceFiles
58  kLowReWallFunctionFvPatchScalarField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef kLowReWallFunctionFvPatchScalarField_H
63 #define kLowReWallFunctionFvPatchScalarField_H
64 
65 #include "fixedValueFvPatchField.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class kLowReWallFunctionFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class kLowReWallFunctionFvPatchScalarField
77 :
78  public fixedValueFvPatchField<scalar>
79 {
80 protected:
81 
82  // Protected data
83 
84  //- Cmu coefficient
85  scalar Cmu_;
86 
87  //- Von Karman constant
88  scalar kappa_;
89 
90  //- E coefficient
91  scalar E_;
92 
93  //- Ceps2 coefficient
94  scalar Ceps2_;
95 
96  //- Y+ at the edge of the laminar sublayer
97  scalar yPlusLam_;
98 
99 
100  // Protected Member Functions
101 
102  //- Check the type of the patch
103  virtual void checkType();
104 
105  //- Calculate the Y+ at the edge of the laminar sublayer
106  scalar yPlusLam(const scalar kappa, const scalar E);
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("kLowReWallFunction");
113 
114 
115  // Constructors
116 
117  //- Construct from patch and internal field
119  (
120  const fvPatch&,
122  );
123 
124  //- Construct from patch, internal field and dictionary
126  (
127  const fvPatch&,
129  const dictionary&
130  );
131 
132  //- Construct by mapping given kLowReWallFunctionFvPatchScalarField
133  // onto a new patch
135  (
137  const fvPatch&,
139  const fvPatchFieldMapper&
140  );
141 
142  //- Construct as copy
144  (
146  );
147 
148  //- Construct and return a clone
149  virtual tmp<fvPatchScalarField> clone() const
150  {
152  (
154  );
155  }
156 
157  //- Construct as copy setting internal field reference
159  (
162  );
163 
164  //- Construct and return a clone setting internal field reference
166  (
168  ) const
169  {
171  (
173  );
174  }
175 
176 
177  // Member functions
178 
179  // Evaluation functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184  //- Evaluate the patchField
185  virtual void evaluate(const Pstream::commsTypes);
186 
187 
188  // I-O
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
virtual void checkType()
Check the type of the patch.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
commsTypes
Types of communications.
Definition: UPstream.H:64
This boundary condition provides a turbulence kinetic energy wall function condition for low- and hig...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual void evaluate(const Pstream::commsTypes)
Evaluate the patchField.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
TypeName("kLowReWallFunction")
Runtime type information.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
kLowReWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.