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