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-2020 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 and internal field
118  (
119  const fvPatch&,
121  );
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given
132  // nutURoughWallFunctionFvPatchScalarField
133  // onto a new patch
135  (
137  const fvPatch&,
139  const fvPatchFieldMapper&
140  );
141 
142  //- Disallow copy without setting internal field reference
144  (
146  ) = delete;
147 
148  //- Copy constructor 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 functions
172  //- Return the roughness height
173  const scalarField& Ks() const
174  {
175  return Ks_;
176  }
177 
178  //- Return reference to the roughness height to allow adjustment
179  scalarField& Ks()
180  {
181  return Ks_;
182  }
183 
184 
185  //- Return the roughness constant scale
186  const scalarField& Cs() const
187  {
188  return Cs_;
189  }
190 
191  //- Return reference to the roughness constant to allow adjustment
192  scalarField& Cs()
193  {
194  return Cs_;
195  }
196 
197 
198  // Mapping functions
199 
200  //- Map (and resize as needed) from self given a mapping object
201  virtual void autoMap(const fvPatchFieldMapper&);
202 
203  //- Reverse map the given fvPatchField onto this fvPatchField
204  virtual void rmap
205  (
207  const labelList&
208  );
209 
210 
211  // I-O
212 
213  //- Write
214  virtual void write(Ostream& os) const;
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > nut() const
Calculate the turbulence viscosity.
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:156
TypeName("nutURoughWallFunction")
Runtime type information.
const scalarField & Cs() const
Return the roughness constant scale.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
scalar magUp
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const scalarField & Ks() const
Return the roughness height.
nutURoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
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
Namespace for OpenFOAM.