nutURoughWallFunctionFvPatchScalarField.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) 2011-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::nutURoughWallFunctionFvPatchScalarField
26 
27 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulent kinematic viscosity condition
32  when using wall functions for rough walls, based on velocity.
33 
34  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  roughnessHeight | roughness height | yes |
39  roughnessConstant | roughness constanr | yes |
40  roughnessFactor | scaling factor | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  myPatch
46  {
47  type nutURoughWallFunction;
48  roughnessHeight 1e-5;
49  roughnessConstant 0.5;
50  roughnessFactor 1;
51  }
52  \endverbatim
53 
54 SeeAlso
55  Foam::nutWallFunctionFvPatchScalarField
56 
57 SourceFiles
58  nutURoughWallFunctionFvPatchScalarField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef nutURoughWallFunctionFvPatchScalarField_H
63 #define nutURoughWallFunctionFvPatchScalarField_H
64 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class nutURoughWallFunctionFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class nutURoughWallFunctionFvPatchScalarField
77 :
78  public nutWallFunctionFvPatchScalarField
79 {
80  // Private data
81 
82  // Roughness model parameters
83 
84  //- Height
85  scalar roughnessHeight_;
86 
87  //- Constant
88  scalar roughnessConstant_;
89 
90  //- Scale factor
91  scalar roughnessFactor_;
92 
93 
94  // Protected Member Functions
95 
96  //- Calculate yPLus
97  virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
98 
99  //- Calculate the turbulence viscosity
100  virtual tmp<scalarField> calcNut() const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("nutURoughWallFunction");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const fvPatch&,
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const fvPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping given
127  // nutURoughWallFunctionFvPatchScalarField
128  // onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchScalarField> clone() const
145  {
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
173 
174  // Access
175 
176  //- Return the roughness height
177  scalar roughnessHeight() const
178  {
179  return roughnessHeight_;
180  }
181 
182  //- Return reference to the roughness height to allow adjustment
183  scalar& roughnessHeight()
184  {
185  return roughnessHeight_;
186  }
187 
188 
189  //- Return the roughness constant scale
190  scalar roughnessConstant() const
191  {
192  return roughnessConstant_;
193  }
194 
195  //- Return reference to the roughness constant to allow adjustment
197  {
198  return roughnessConstant_;
199  }
200 
201  //- Return the roughness scale factor
202  scalar roughnessFactor() const
203  {
204  return roughnessFactor_;
205  }
206 
207  //- Return reference to the roughness scale factor to allow
208  // adjustment
209  scalar& roughnessFactor()
210  {
211  return roughnessFactor_;
212  }
213 
214 
215  // I-O
216 
217  // Evaluation functions
218 
219  //- Calculate and return the yPlus at the boundary
220  virtual tmp<scalarField> yPlus() const;
222 
223  // I-O
224 
225  //- Write
226  virtual void write(Ostream& os) const;
227 };
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
scalar magUp
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
scalar roughnessHeight() const
Return the roughness height.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
scalar roughnessFactor() const
Return the roughness scale factor.
nutURoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
TypeName("nutURoughWallFunction")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
A class for managing temporary objects.
Definition: PtrList.H:118
scalar roughnessConstant() const
Return the roughness constant scale.