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-2015 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  \heading Patch usage
41 
42  \table
43  Property | Description | Required | Default value
44  Ks | sand-grain roughness height | yes |
45  Cs | roughness constant | yes |
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  myPatch
51  {
52  type nutkRoughWallFunction;
53  Ks uniform 0;
54  Cs uniform 0.5;
55  }
56  \endverbatim
57 
58 SeeAlso
59  Foam::nutkRoughWallFunctionFvPatchScalarField
60 
61 SourceFiles
62  nutkRoughWallFunctionFvPatchScalarField.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef nutkRoughWallFunctionFvPatchScalarField_H
67 #define nutkRoughWallFunctionFvPatchScalarField_H
68 
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class nutkRoughWallFunctionFvPatchScalarField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class nutkRoughWallFunctionFvPatchScalarField
81 :
82  public nutkWallFunctionFvPatchScalarField
83 {
84 protected:
85 
86  // Protected data
87 
88  //- Roughness height
90 
91  //- Roughness constant
93 
94 
95  // Protected Member Functions
96 
97  //- Compute the roughness function
98  virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
99 
100  //- Calculate the turbulence viscosity
101  virtual tmp<scalarField> calcNut() const;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("nutkRoughWallFunction");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // nutkRoughWallFunctionFvPatchScalarField
129  // onto a new patch
131  (
133  const fvPatch&,
135  const fvPatchFieldMapper&
136  );
137 
138  //- Construct as copy
140  (
142  );
143 
144  //- Construct and return a clone
145  virtual tmp<fvPatchScalarField> clone() const
146  {
148  (
150  );
151  }
152 
153  //- Construct as copy setting internal field reference
155  (
158  );
159 
160  //- Construct and return a clone setting internal field reference
162  (
164  ) const
165  {
167  (
169  );
170  }
171 
172 
173  // Member functions
174 
175  // Acces functions
176 
177  // Return Ks
178  scalarField& Ks()
179  {
180  return Ks_;
181  }
182 
183  // Return Cs
184  scalarField& Cs()
185  {
186  return Cs_;
187  }
188 
189 
190  // Mapping functions
191 
192  //- Map (and resize as needed) from self given a mapping object
193  virtual void autoMap(const fvPatchFieldMapper&);
194 
195  //- Reverse map the given fvPatchField onto this fvPatchField
196  virtual void rmap
197  (
199  const labelList&
200  );
201 
202 
203  // I-O
204 
205  //- Write
206  virtual void write(Ostream&) const;
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:48
Foam::nutkRoughWallFunctionFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:221
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::nutkRoughWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:62
Foam::nutkRoughWallFunctionFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:206
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField
nutkRoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:131
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::nutkRoughWallFunctionFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:195
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::nutkRoughWallFunctionFvPatchScalarField::Ks_
scalarField Ks_
Roughness height.
Definition: nutkRoughWallFunctionFvPatchScalarField.H:103
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::nutkRoughWallFunctionFvPatchScalarField::Ks
scalarField & Ks()
Definition: nutkRoughWallFunctionFvPatchScalarField.H:192
Foam::nutkRoughWallFunctionFvPatchScalarField::TypeName
TypeName("nutkRoughWallFunction")
Runtime type information.
Foam::nutkRoughWallFunctionFvPatchScalarField::fnRough
virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const
Compute the roughness function.
Definition: nutkRoughWallFunctionFvPatchScalarField.C:40
Foam::nutkRoughWallFunctionFvPatchScalarField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
Definition: nutkRoughWallFunctionFvPatchScalarField.H:94
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::nutkRoughWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutkRoughWallFunctionFvPatchScalarField.H:159
Foam::nutkRoughWallFunctionFvPatchScalarField::Cs_
scalarField Cs_
Roughness constant.
Definition: nutkRoughWallFunctionFvPatchScalarField.H:106
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
nutkWallFunctionFvPatchScalarField.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::nutkRoughWallFunctionFvPatchScalarField::Cs
scalarField & Cs()
Definition: nutkRoughWallFunctionFvPatchScalarField.H:198
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::nutkWallFunctionFvPatchScalarField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
Definition: nutkWallFunctionFvPatchScalarField.H:66