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-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::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  \heading Patch usage
40 
41  \table
42  Property | Description | Required | Default value
43  Cmu | model coefficient | no | 0.09
44  kappa | Von Karman constant | no | 0.41
45  E | model coefficient | no | 9.8
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  myPatch
51  {
52  type v2WallFunction;
53  }
54  \endverbatim
55 
56 SeeAlso
57  Foam::fixedValueFvPatchField
58 
59 SourceFiles
60  v2WallFunctionFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef v2WallFunctionFvPatchScalarField_H
65 #define v2WallFunctionFvPatchScalarField_H
66 
67 #include "fixedValueFvPatchField.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace RASModels
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class v2WallFunctionFvPatchScalarField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class v2WallFunctionFvPatchScalarField
81 :
82  public fixedValueFvPatchField<scalar>
83 {
84 protected:
85 
86  // Protected data
87 
88  //- Cmu coefficient
89  scalar Cmu_;
90 
91  //- Von Karman constant
92  scalar kappa_;
93 
94  //- E coefficient
95  scalar E_;
96 
97  //- Y+ at the edge of the laminar sublayer
98  scalar yPlusLam_;
99 
100 
101  // Protected Member Functions
102 
103  //- Check the type of the patch
104  virtual void checkType();
105 
106  //- Write local wall function variables
107  virtual void writeLocalEntries(Ostream&) const;
109  //- Calculate the Y+ at the edge of the laminar sublayer
110  scalar yPlusLam(const scalar kappa, const scalar E);
112 
113 public:
115  //- Runtime type information
116  TypeName("v2WallFunction");
118 
119  // Constructors
120 
121  //- Construct from patch and internal field
123  (
124  const fvPatch&,
126  );
127 
128  //- Construct from patch, internal field and dictionary
130  (
131  const fvPatch&,
133  const dictionary&
134  );
135 
136  //- Construct by mapping given v2WallFunctionFvPatchScalarField
137  // onto a new patch
139  (
141  const fvPatch&,
143  const fvPatchFieldMapper&
144  );
145 
146  //- Construct as copy
148  (
150  );
151 
152  //- Construct and return a clone
153  virtual tmp<fvPatchScalarField> clone() const
154  {
156  (
158  );
159  }
160 
161  //- Construct as copy setting internal field reference
163  (
166  );
167 
168  //- Construct and return a clone setting internal field reference
170  (
172  ) const
173  {
175  (
176  new v2WallFunctionFvPatchScalarField(*this, iF)
177  );
178  }
179 
180 
181  // Member functions
182 
183  // Evaluation functions
184 
185  //- Update the coefficients associated with the patch field
186  virtual void updateCoeffs();
187 
188  //- Evaluate the patchField
189  virtual void evaluate(const Pstream::commsTypes);
190 
191 
192  // I-O
193 
194  //- Write
195  virtual void write(Ostream&) const;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace RASModels
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
virtual void evaluate(const Pstream::commsTypes)
Evaluate the patchField.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
TypeName("v2WallFunction")
Runtime type information.
commsTypes
Types of communications.
Definition: UPstream.H:64
scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
This boundary condition provides a turbulence stress normal to streamlines wall function condition fo...
virtual void checkType()
Check the type of the patch.
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
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
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
A class for managing temporary objects.
Definition: PtrList.H:118