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