FreeFOAM The Cross-Platform CFD Toolkit
nutRoughWallFunctionFvPatchScalarField.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::incompressible::RASModels::nutRoughWallFunctionFvPatchScalarField
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  nutRoughWallFunctionFvPatchScalarField.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef nutRoughWallFunctionFvPatchScalarField_H
43 #define nutRoughWallFunctionFvPatchScalarField_H
44 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace incompressible
52 {
53 namespace RASModels
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class nutRoughWallFunctionFvPatchScalarField Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
63 {
64 protected:
65 
66  // Protected data
67 
68  //- Roughness height
70 
71  //- Roughness constant
73 
74 
75  // Protected 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> calcNut() const;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("nutRoughWallFunction");
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  // nutRoughWallFunctionFvPatchScalarField
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
142  (
144  ) const
145  {
147  (
149  );
150  }
151 
152 
153  // Member functions
154 
155  // Acces functions
156 
158  {
159  return Ks_;
160  }
161 
163  {
164  return Cs_;
165  }
166 
167  // Mapping functions
168 
169  //- Map (and resize as needed) from self given a mapping object
170  virtual void autoMap(const fvPatchFieldMapper&);
171 
172  //- Reverse map the given fvPatchField onto this fvPatchField
173  virtual void rmap
174  (
175  const fvPatchScalarField&,
176  const labelList&
177  );
178 
179 
180  // I-O
181 
182  //- Write
183  virtual void write(Ostream&) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace RASModels
190 } // End namespace incompressible
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************ vim: set sw=4 sts=4 et: ************************ //