v2WallFunctionFvPatchScalarField.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::v2WallFunctionFvPatchScalarField
26 
27 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulence stress normal to streamlines
32  wall function condition for low- and high-Reynolds number, turbulent flow
33  cases.
34 
35  The model operates in two modes, based on the computed laminar-to-turbulent
36  switch-over y+ value derived from kappa and E.
37 
38 
39 Usage
40  \table
41  Property | Description | Required | Default value
42  Cmu | model coefficient | no | 0.09
43  kappa | Von Karman constant | no | 0.41
44  E | model coefficient | no | 9.8
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type v2WallFunction;
52  }
53  \endverbatim
54 
55 See also
56  Foam::fixedValueFvPatchField
57 
58 SourceFiles
59  v2WallFunctionFvPatchScalarField.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef v2WallFunctionFvPatchScalarField_H
64 #define v2WallFunctionFvPatchScalarField_H
65 
66 #include "fixedValueFvPatchField.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace RASModels
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class v2WallFunctionFvPatchScalarField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class v2WallFunctionFvPatchScalarField
80 :
81  public fixedValueFvPatchField<scalar>
82 {
83 protected:
84 
85  // Protected data
86 
87  //- Cmu coefficient
88  scalar Cmu_;
89 
90  //- Von Karman constant
91  scalar kappa_;
92 
93  //- E coefficient
94  scalar E_;
95 
96  //- Y+ at the edge of the laminar sublayer
97  scalar yPlusLam_;
98 
99 
100  // Protected Member Functions
101 
102  //- Check the type of the patch
103  virtual void checkType();
104 
105  //- Write local wall function variables
106  virtual void writeLocalEntries(Ostream&) const;
108  //- Calculate the Y+ at the edge of the laminar sublayer
109  scalar yPlusLam(const scalar kappa, const scalar E);
111 
112 public:
114  //- Runtime type information
115  TypeName("v2WallFunction");
117 
118  // Constructors
119 
120  //- Construct from patch and internal field
122  (
123  const fvPatch&,
125  );
126 
127  //- Construct from patch, internal field and dictionary
129  (
130  const fvPatch&,
132  const dictionary&
133  );
134 
135  //- Construct by mapping given v2WallFunctionFvPatchScalarField
136  // onto a new patch
138  (
140  const fvPatch&,
142  const fvPatchFieldMapper&
143  );
144 
145  //- Construct as copy
147  (
149  );
150 
151  //- Construct and return a clone
152  virtual tmp<fvPatchScalarField> clone() const
153  {
155  (
157  );
158  }
159 
160  //- Construct as copy setting internal field reference
162  (
165  );
166 
167  //- Construct and return a clone setting internal field reference
169  (
171  ) const
172  {
174  (
175  new v2WallFunctionFvPatchScalarField(*this, iF)
176  );
177  }
178 
179 
180  // Member functions
181 
182  // Evaluation functions
183 
184  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187  //- Evaluate the patchField
188  virtual void evaluate(const Pstream::commsTypes);
189 
190 
191  // I-O
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace RASModels
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
This boundary condition provides a turbulence stress normal to streamlines wall function condition fo...
commsTypes
Types of communications.
Definition: UPstream.H:64
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
TypeName("v2WallFunction")
Runtime type information.
scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
virtual void evaluate(const Pstream::commsTypes)
Evaluate the patchField.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::fvPatchFieldMapper.
v2WallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
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.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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.
Namespace for OpenFOAM.