fWallFunctionFvPatchScalarField.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::RASModels::fWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulence damping function, f, wall
29  function 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  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type fWallFunction;
47  }
48  \endverbatim
49 
50 See also
51  Foam::fixedValueFvPatchField
52 
53 SourceFiles
54  fWallFunctionFvPatchScalarField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef fWallFunctionFvPatchScalarField_H
59 #define fWallFunctionFvPatchScalarField_H
60 
61 #include "fixedValueFvPatchField.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace RASModels
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class fWallFunctionFvPatchScalarField Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class fWallFunctionFvPatchScalarField
75 :
76  public fixedValueFvPatchField<scalar>
77 {
78 protected:
79 
80  // Protected data
81 
82  //- Cmu coefficient
83  scalar Cmu_;
84 
85  //- Von Karman constant
86  scalar kappa_;
87 
88  //- E coefficient
89  scalar E_;
90 
91  //- Y+ at the edge of the laminar sublayer
92  scalar yPlusLam_;
93 
94 
95  // Protected Member Functions
96 
97  //- Check the type of the patch
98  virtual void checkType();
99 
100  //- Write local wall function variables
101  virtual void writeLocalEntries(Ostream&) const;
103  //- Calculate the Y+ at the edge of the laminar sublayer
104  scalar yPlusLam(const scalar kappa, const scalar E);
106 
107 public:
109  //- Runtime type information
110  TypeName("fWallFunction");
112 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const fvPatch&,
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const fvPatch&,
127  const dictionary&
128  );
129 
130  //- Construct by mapping given fWallFunctionFvPatchScalarField
131  // onto a new patch
133  (
135  const fvPatch&,
137  const fvPatchFieldMapper&
138  );
139 
140  //- Construct as copy
142  (
144  );
145 
146  //- Construct and return a clone
147  virtual tmp<fvPatchScalarField> clone() const
148  {
150  (
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
164  (
166  ) const
167  {
169  (
170  new fWallFunctionFvPatchScalarField(*this, iF)
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Evaluation functions
178 
179  //- Update the coefficients associated with the patch field
180  virtual void updateCoeffs();
181 
182  //- Evaluate the patchField
183  virtual void evaluate(const Pstream::commsTypes);
184 
185 
186  // I-O
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace RASModels
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
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
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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:53
virtual void checkType()
Check the type of the patch.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Namespace for OpenFOAM.