FreeFOAM The Cross-Platform CFD Toolkit
mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.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) 1991-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::mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
26 
27 Description
28  Wall function boundary condition for rough walls
29 
30 SourceFiles
31  mutSpalartAllamarasStandardWallFunctionFvPatchScalarField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
36 #define compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace compressible
45 {
46 namespace RASModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50 Class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
56 {
57 protected:
58 
59  // Protected data
60 
61  // Roughness parameters
62 
63  //- Height
65 
66  //- Constant
68 
69  //- Scale factor
71 
72 
73  // Protected member functions
74 
75  //- Calculate yPLus
76  virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
77 
78  //- Calculate the turbulence viscosity
79  virtual tmp<scalarField> calcMut() const;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("mutSpalartAllmarasStandardRoughWallFunction");
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch&,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given
106  // mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
107  // onto a new patch
109  (
111  const fvPatch&,
113  const fvPatchFieldMapper&
114  );
115 
116  //- Construct as copy
118  (
120  );
121 
122  //- Construct and return a clone
124  {
126  (
128  (
129  *this
130  )
131  );
132  }
133 
134  //- Construct as copy setting internal field reference
136  (
139  );
140 
141  //- Construct and return a clone setting internal field reference
142  virtual tmp<fvPatchScalarField> clone
143  (
145  ) const
146  {
148  (
150  (
151  *this,
152  iF
153  )
154  );
155  }
156 
157 
158  // Member functions
159 
160  // Access
161 
162  //- Return the roughness height scale
163  const scalar& roughnessHeight() const
164  {
165  return roughnessHeight_;
166  }
167 
168  //- Return reference to the roughness height to allow adjustment
169  scalar& roughnessHeight()
170  {
171  return roughnessHeight_;
172  }
173 
174  //- Return the roughness constant scale
175  const scalar& roughnessConstant() const
176  {
177  return roughnessConstant_;
178  }
179 
180  //- Return reference to the roughness constant to allow adjustment
182  {
183  return roughnessConstant_;
184  }
185 
186  //- Return the roughness scale factor
187  const scalar& roughnessFudgeFactor() const
188  {
189  return roughnessFudgeFactor_;
190  }
191 
192  //- Return reference to the roughness scale factor to allow
193  // adjustment
195  {
196  return roughnessFudgeFactor_;
197  }
198 
199 
200  // Evaluation functions
201 
202  //- Calculate and return the yPlus at the boundary
203  virtual tmp<scalarField> yPlus() const;
204 
205 
206  // I-O
207 
208  //- Write
209  virtual void write(Ostream& os) const;
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace RASModels
216 } // End namespace compressible
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************ vim: set sw=4 sts=4 et: ************************ //