FreeFOAM The Cross-Platform CFD Toolkit
mutWallFunctionFvPatchScalarField.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) 2008-2010 OpenCFD Ltd.
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::compressible::RASModels::mutWallFunctionFvPatchScalarField
26 
27 Description
28  Boundary condition for turbulent (kinematic) viscosity when using wall
29  functions
30  - replicates OpenFOAM v1.5 (and earlier) behaviour
31 
32 SourceFiles
33  mutWallFunctionFvPatchScalarField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef compressibleMutWallFunctionFvPatchScalarField_H
38 #define compressibleMutWallFunctionFvPatchScalarField_H
39 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace compressible
47 {
48 namespace RASModels
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class mutWallFunctionFvPatchScalarField Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public fixedValueFvPatchScalarField
58 {
59 protected:
60 
61  // Protected data
62 
63  //- Cmu coefficient
64  scalar Cmu_;
65 
66  //- Von Karman constant
67  scalar kappa_;
68 
69  //- E coefficient
70  scalar E_;
71 
72  //- Y+ at the edge of the laminar sublayer
73  scalar yPlusLam_;
74 
75 
76  // Protected member functions
77 
78  //- Check the type of the patch
79  virtual void checkType();
80 
81  //- Calculate the Y+ at the edge of the laminar sublayer
82  virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
83 
84  //- Calculate the turbulence viscosity
85  virtual tmp<scalarField> calcMut() const;
86 
87  //- Write local wall function variables
88  virtual void writeLocalEntries(Ostream&) const;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("mutWallFunction");
95 
96 
97  // Constructors
98 
99  //- Construct from patch and internal field
101  (
102  const fvPatch&,
104  );
105 
106  //- Construct from patch, internal field and dictionary
108  (
109  const fvPatch&,
111  const dictionary&
112  );
113 
114  //- Construct by mapping given
115  // mutWallFunctionFvPatchScalarField
116  // onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Construct as copy
127  (
129  );
130 
131  //- Construct and return a clone
133  {
135  (
137  );
138  }
139 
140  //- Construct as copy setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
148  virtual tmp<fvPatchScalarField> clone
149  (
151  ) const
152  {
154  (
155  new mutWallFunctionFvPatchScalarField(*this, iF)
156  );
157  }
158 
159 
160  // Member functions
161 
162  // Evaluation functions
163 
164  //- Calculate and return the yPlus at the boundary
165  virtual tmp<scalarField> yPlus() const;
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170 
171  // I-O
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace RASModels
181 } // End namespace compressible
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************ vim: set sw=4 sts=4 et: ************************ //