nutkRoughWallFunctionFvPatchScalarField.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::nutkRoughWallFunctionFvPatchScalarField
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 turbulence kinetic
33  energy. The condition manipulates the E parameter to account for roughness
34  effects.
35 
36  Parameter ranges
37  - roughness height = sand-grain roughness (0 for smooth walls)
38  - roughness constant = 0.5-1.0
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  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type nutkRoughWallFunction;
52  Ks uniform 0;
53  Cs uniform 0.5;
54  }
55  \endverbatim
56 
57 See also
58  Foam::nutkRoughWallFunctionFvPatchScalarField
59 
60 SourceFiles
61  nutkRoughWallFunctionFvPatchScalarField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef nutkRoughWallFunctionFvPatchScalarField_H
66 #define nutkRoughWallFunctionFvPatchScalarField_H
67 
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class nutkRoughWallFunctionFvPatchScalarField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class nutkRoughWallFunctionFvPatchScalarField
80 :
81  public nutkWallFunctionFvPatchScalarField
82 {
83 protected:
84 
85  // Protected data
86 
87  //- Roughness height
89 
90  //- Roughness constant
92 
93 
94  // Protected Member Functions
95 
96  //- Compute the roughness function
97  virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
98 
99  //- Calculate the turbulence viscosity
100  virtual tmp<scalarField> calcNut() const;
101 
103 public:
104 
105  //- Runtime type information
106  TypeName("nutkRoughWallFunction");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const fvPatch&,
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const fvPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping given
127  // nutkRoughWallFunctionFvPatchScalarField
128  // onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchScalarField> clone() const
145  {
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
173 
174  // Acces functions
176  // Return Ks
177  scalarField& Ks()
178  {
179  return Ks_;
180  }
181 
182  // Return Cs
183  scalarField& Cs()
184  {
185  return Cs_;
186  }
187 
188 
189  // Mapping functions
190 
191  //- Map (and resize as needed) from self given a mapping object
192  virtual void autoMap(const fvPatchFieldMapper&);
193 
194  //- Reverse map the given fvPatchField onto this fvPatchField
195  virtual void rmap
196  (
198  const labelList&
199  );
200 
201 
202  // I-O
203 
204  //- Write
205  virtual void write(Ostream&) const;
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const
Compute the roughness function.
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:65
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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:54
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
Namespace for OpenFOAM.