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