All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
nutkRoughWallFunctionFvPatchScalarField.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::nutkRoughWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulent kinematic viscosity condition
29  when using wall functions for rough walls, based on turbulence kinetic
30  energy. The condition manipulates the E parameter to account for roughness
31  effects.
32 
33  Parameter ranges
34  - roughness height = sand-grain roughness (0 for smooth walls)
35  - roughness constant = 0.5-1.0
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  Ks | sand-grain roughness height | yes |
41  Cs | roughness constant | yes |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  type nutkRoughWallFunction;
49  Ks uniform 0;
50  Cs uniform 0.5;
51  }
52  \endverbatim
53 
54 See also
55  Foam::nutkRoughWallFunctionFvPatchScalarField
56 
57 SourceFiles
58  nutkRoughWallFunctionFvPatchScalarField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef nutkRoughWallFunctionFvPatchScalarField_H
63 #define nutkRoughWallFunctionFvPatchScalarField_H
64 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class nutkRoughWallFunctionFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class nutkRoughWallFunctionFvPatchScalarField
77 :
78  public nutkWallFunctionFvPatchScalarField
79 {
80 protected:
81 
82  // Protected data
83 
84  //- Roughness height
86 
87  //- Roughness constant
89 
90 
91  // Protected Member Functions
92 
93  //- Compute the roughness function
94  virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
95 
96  //- Calculate the turbulence viscosity
97  virtual tmp<scalarField> calcNut() const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("nutkRoughWallFunction");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const fvPatch&,
113  );
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given
124  // nutkRoughWallFunctionFvPatchScalarField
125  // onto a new patch
127  (
129  const fvPatch&,
131  const fvPatchFieldMapper&
132  );
133 
134  //- Construct as copy
136  (
138  );
139 
140  //- Construct and return a clone
141  virtual tmp<fvPatchScalarField> clone() const
142  {
144  (
146  );
147  }
148 
149  //- Construct as copy setting internal field reference
151  (
154  );
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
163  (
165  );
166  }
167 
168 
169  // Member functions
170 
171  // Access functions
173  // Return Ks
174  scalarField& Ks()
175  {
176  return Ks_;
177  }
178 
179  // Return Cs
180  scalarField& Cs()
181  {
182  return Cs_;
183  }
184 
185 
186  // Mapping functions
187 
188  //- Map (and resize as needed) from self given a mapping object
189  virtual void autoMap(const fvPatchFieldMapper&);
190 
191  //- Reverse map the given fvPatchField onto this fvPatchField
192  virtual void rmap
193  (
195  const labelList&
196  );
197 
198 
199  // I-O
200 
201  //- Write
202  virtual void write(Ostream&) const;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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 ...
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
nutkRoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
TypeName("nutkRoughWallFunction")
Runtime type information.
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 scalar fnRough(const scalar KsPlus, const scalar Cs) const
Compute the roughness function.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Namespace for OpenFOAM.