FreeFOAM The Cross-Platform CFD Toolkit
mutRoughWallFunctionFvPatchScalarField.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::mutRoughWallFunctionFvPatchScalarField
26 
27 Description
28  Boundary condition for turbulent (kinematic) viscosity when using wall
29  functions for rough walls.
30 
31  Manipulates the E parameter to account for roughness effects, based on
32  KsPlus.
33 
34  - roughness height = sand-grain roughness (0 for smooth walls)
35  - roughness constant = 0.5-1.0 (0.5 default)
36 
37 SourceFiles
38  mutRoughWallFunctionFvPatchScalarField.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H
43 #define compressibleMutRoughWallFunctionFvPatchScalarField_H
44 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace compressible
52 {
53 namespace RASModels
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class mutRoughWallFunctionFvPatchScalarField Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
63 {
64 protected:
65 
66  // Protected data
67 
68  //- Roughness height
70 
71  //- Roughness constant
73 
74 
75  // Private member functions
76 
77  //- Compute the roughness function
78  virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
79 
80  //- Calculate the turbulence viscosity
81  virtual tmp<scalarField> calcMut() const;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("mutRoughWallFunction");
88 
89 
90  // Constructors
91 
92  //- Construct from patch and internal field
94  (
95  const fvPatch&,
97  );
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const fvPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping given
108  // mutRoughWallFunctionFvPatchScalarField
109  // onto a new patch
111  (
113  const fvPatch&,
115  const fvPatchFieldMapper&
116  );
117 
118  //- Construct as copy
120  (
122  );
123 
124  //- Construct and return a clone
126  {
128  (
130  );
131  }
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140  //- Construct and return a clone setting internal field reference
141  virtual tmp<fvPatchScalarField> clone
142  (
144  ) const
145  {
147  (
149  );
150  }
151 
152 
153  // Member functions
154 
155  // Mapping functions
156 
157  //- Map (and resize as needed) from self given a mapping object
158  virtual void autoMap
159  (
160  const fvPatchFieldMapper&
161  );
162 
163  //- Reverse map the given fvPatchField onto this fvPatchField
164  virtual void rmap
165  (
166  const fvPatchScalarField&,
167  const labelList&
168  );
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: ************************ //