fWallFunctionFvPatchScalarField.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::RASModels::fWallFunctionFvPatchScalarField
26 
27 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulence damping function, f, wall
32  function 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  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  myPatch
49  {
50  type fWallFunction;
51  }
52  \endverbatim
53 
54 SeeAlso
55  Foam::fixedValueFvPatchField
56 
57 SourceFiles
58  fWallFunctionFvPatchScalarField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef fWallFunctionFvPatchScalarField_H
63 #define fWallFunctionFvPatchScalarField_H
64 
65 #include "fixedValueFvPatchField.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace RASModels
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class fWallFunctionFvPatchScalarField Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class fWallFunctionFvPatchScalarField
79 :
80  public fixedValueFvPatchField<scalar>
81 {
82 protected:
83 
84  // Protected data
85 
86  //- Cmu coefficient
87  scalar Cmu_;
88 
89  //- Von Karman constant
90  scalar kappa_;
91 
92  //- E coefficient
93  scalar E_;
94 
95  //- Y+ at the edge of the laminar sublayer
96  scalar yPlusLam_;
97 
98 
99  // Protected Member Functions
100 
101  //- Check the type of the patch
102  virtual void checkType();
103 
104  //- Write local wall function variables
105  virtual void writeLocalEntries(Ostream&) const;
107  //- Calculate the Y+ at the edge of the laminar sublayer
108  scalar yPlusLam(const scalar kappa, const scalar E);
110 
111 public:
113  //- Runtime type information
114  TypeName("fWallFunction");
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const fvPatch&,
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const fvPatch&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping given fWallFunctionFvPatchScalarField
135  // onto a new patch
137  (
139  const fvPatch&,
141  const fvPatchFieldMapper&
142  );
143 
144  //- Construct as copy
146  (
148  );
149 
150  //- Construct and return a clone
151  virtual tmp<fvPatchScalarField> clone() const
152  {
154  (
156  );
157  }
158 
159  //- Construct as copy setting internal field reference
161  (
164  );
165 
166  //- Construct and return a clone setting internal field reference
168  (
170  ) const
171  {
173  (
174  new fWallFunctionFvPatchScalarField(*this, iF)
175  );
176  }
177 
178 
179  // Member functions
180 
181  // Evaluation functions
182 
183  //- Update the coefficients associated with the patch field
184  virtual void updateCoeffs();
185 
186  //- Evaluate the patchField
187  virtual void evaluate(const Pstream::commsTypes);
188 
189 
190  // I-O
191 
192  //- Write
193  virtual void write(Ostream&) const;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace RASModels
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the 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...
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
This boundary condition provides a turbulence damping function, f, wall function condition for low- a...
fWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
commsTypes
Types of communications.
Definition: UPstream.H:64
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
TypeName("fWallFunction")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual void checkType()
Check the type of the patch.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
A class for managing temporary objects.
Definition: PtrList.H:118