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