kLowReWallFunctionFvPatchScalarField.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) 2012-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::kLowReWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulence kinetic energy wall function
29  condition for low- and high-Reynolds number turbulent flow cases.
30 
31  The model operates in two modes, based on the computed laminar-to-turbulent
32  switch-over y+ value derived from kappa and E.
33 
34 Usage
35  \table
36  Property | Description | Required | Default value
37  Cmu | model coefficient | no | 0.09
38  kappa | Von Karman constant | no | 0.41
39  E | model coefficient | no | 9.8
40  Ceps2 | model coefficient | no | 1.9
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type kLowReWallFunction;
48  }
49  \endverbatim
50 
51 See also
52  Foam::fixedValueFvPatchField
53 
54 SourceFiles
55  kLowReWallFunctionFvPatchScalarField.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef kLowReWallFunctionFvPatchScalarField_H
60 #define kLowReWallFunctionFvPatchScalarField_H
61 
62 #include "fixedValueFvPatchField.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class kLowReWallFunctionFvPatchScalarField Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class kLowReWallFunctionFvPatchScalarField
74 :
75  public fixedValueFvPatchField<scalar>
76 {
77 protected:
78 
79  // Protected data
80 
81  //- Cmu coefficient
82  scalar Cmu_;
83 
84  //- Von Karman constant
85  scalar kappa_;
86 
87  //- E coefficient
88  scalar E_;
89 
90  //- Ceps2 coefficient
91  scalar Ceps2_;
92 
93  //- Y+ at the edge of the laminar sublayer
94  scalar yPlusLam_;
95 
96 
97  // Protected Member Functions
98 
99  //- Check the type of the patch
100  virtual void checkType();
101 
102  //- Calculate the Y+ at the edge of the laminar sublayer
103  scalar yPlusLam(const scalar kappa, const scalar E);
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("kLowReWallFunction");
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const fvPatch&,
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const fvPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given kLowReWallFunctionFvPatchScalarField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchScalarField> clone() const
147  {
149  (
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
170  );
171  }
172 
173 
174  // Member functions
175 
176  // Evaluation functions
177 
178  //- Update the coefficients associated with the patch field
179  virtual void updateCoeffs();
180 
181  //- Evaluate the patchField
182  virtual void evaluate(const Pstream::commsTypes);
183 
184 
185  // I-O
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
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:53
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.