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