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-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::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 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  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type fWallFunction;
50  }
51  \endverbatim
52 
53 See also
54  Foam::fixedValueFvPatchField
55 
56 SourceFiles
57  fWallFunctionFvPatchScalarField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef fWallFunctionFvPatchScalarField_H
62 #define fWallFunctionFvPatchScalarField_H
63 
64 #include "fixedValueFvPatchField.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 namespace RASModels
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class fWallFunctionFvPatchScalarField Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class fWallFunctionFvPatchScalarField
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  //- Y+ at the edge of the laminar sublayer
95  scalar yPlusLam_;
96 
97 
98  // Protected Member Functions
99 
100  //- Check the type of the patch
101  virtual void checkType();
102 
103  //- Write local wall function variables
104  virtual void writeLocalEntries(Ostream&) const;
106  //- Calculate the Y+ at the edge of the laminar sublayer
107  scalar yPlusLam(const scalar kappa, const scalar E);
109 
110 public:
112  //- Runtime type information
113  TypeName("fWallFunction");
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 fWallFunctionFvPatchScalarField
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  (
173  new fWallFunctionFvPatchScalarField(*this, iF)
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 RASModels
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual void evaluate(const Pstream::commsTypes)
Evaluate the patchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
TypeName("fWallFunction")
Runtime type information.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
fWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
This boundary condition provides a turbulence damping function, f, wall function condition for low- a...
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
virtual void checkType()
Check the type of the patch.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Namespace for OpenFOAM.