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-2023 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. The
30  condition manipulates the E parameter to account for roughness effects.
31 
32  Reference:
33  \verbatim
34  Cebeci, T., & Bradshaw, P. (1977).
35  Momentum transfer in boundary layers.
36  Washington, DC, Hemisphere Publishing Corp.; New York,
37  McGraw-Hill Book Co., 1977. 407 p.
38  \endverbatim
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  Ks | sand-grain roughness height | yes |
44  Cs | roughness constant | yes |
45  \endtable
46 
47  Parameter ranges
48  - roughness height (Ks) = sand-grain roughness (0 for smooth walls)
49  - roughness constant (Cs) = 0.5 - 1.0
50 
51  Example of the boundary condition specification:
52  \verbatim
53  <patchName>
54  {
55  type nutURoughWallFunction;
56  Ks uniform 1e-5;
57  Cs uniform 0.5;
58  value uniform 0;
59  }
60  \endverbatim
61 
62 See also
63  Foam::nutUWallFunctionFvPatchScalarField
64 
65 SourceFiles
66  nutURoughWallFunctionFvPatchScalarField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef nutURoughWallFunctionFvPatchScalarField_H
71 #define nutURoughWallFunctionFvPatchScalarField_H
72 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class nutURoughWallFunctionFvPatchScalarField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class nutURoughWallFunctionFvPatchScalarField
85 :
86  public nutUWallFunctionFvPatchScalarField
87 {
88  // Private Data
89 
90  //- Roughness height
91  scalarField Ks_;
92 
93  //- Roughness constant
94  scalarField Cs_;
95 
96 
97 protected:
98 
99  // Protected Member Functions
100 
101  //- Calculate yPLus
102  virtual tmp<scalarField> yPlus(const scalarField& magUp) const;
103 
104  //- Calculate the turbulence viscosity
105  virtual tmp<scalarField> nut() const;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("nutURoughWallFunction");
112 
113 
114  // Constructors
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // nutURoughWallFunctionFvPatchScalarField
126  // onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Disallow copy without setting internal field reference
137  (
139  ) = delete;
140 
141  //- Copy constructor setting internal field reference
143  (
146  );
147 
148  //- Construct and return a clone setting internal field reference
150  (
152  ) const
153  {
155  (
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Access functions
164 
165  //- Return the roughness height
166  const scalarField& Ks() const
167  {
168  return Ks_;
169  }
170 
171  //- Return reference to the roughness height to allow adjustment
172  scalarField& Ks()
173  {
174  return Ks_;
175  }
176 
177 
178  //- Return the roughness constant scale
179  const scalarField& Cs() const
180  {
181  return Cs_;
182  }
183 
184  //- Return reference to the roughness constant to allow adjustment
185  scalarField& Cs()
186  {
187  return Cs_;
188  }
189 
190 
191  // Mapping functions
192 
193  //- Map the given fvPatchField onto this fvPatchField
194  virtual void map
195  (
196  const fvPatchScalarField&,
197  const fvPatchFieldMapper&
198  );
199 
200  //- Reset the fvPatchField to the given fvPatchField
201  // Used for mesh to mesh mapping
202  virtual void reset(const fvPatchScalarField&);
203 
204 
205  // I-O
206 
207  //- Write
208  virtual void write(Ostream& os) const;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
TypeName("nutURoughWallFunction")
Runtime type information.
virtual tmp< scalarField > nut() const
Calculate the turbulence viscosity.
nutURoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
const scalarField & Ks() const
Return the roughness height.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
const scalarField & Cs() const
Return the roughness constant scale.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
A class for managing temporary objects.
Definition: tmp.H:55
const scalar magUp
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.