nutURoughWallFunctionFvPatchScalarField.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::nutURoughWallFunctionFvPatchScalarField
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 velocity.
33 
34  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  roughnessHeight | roughness height | yes |
39  roughnessConstant | roughness constanr | yes |
40  roughnessFactor | scaling factor | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  myPatch
46  {
47  type nutURoughWallFunction;
48  roughnessHeight 1e-5;
49  roughnessConstant 0.5;
50  roughnessFactor 1;
51  }
52  \endverbatim
53 
54 SeeAlso
55  Foam::nutWallFunctionFvPatchScalarField
56 
57 SourceFiles
58  nutURoughWallFunctionFvPatchScalarField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef nutURoughWallFunctionFvPatchScalarField_H
63 #define nutURoughWallFunctionFvPatchScalarField_H
64 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class nutURoughWallFunctionFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class nutURoughWallFunctionFvPatchScalarField
77 :
78  public nutWallFunctionFvPatchScalarField
79 {
80  // Private data
81 
82  // Roughness model parameters
83 
84  //- Height
85  scalar roughnessHeight_;
86 
87  //- Constant
88  scalar roughnessConstant_;
89 
90  //- Scale factor
91  scalar roughnessFactor_;
92 
93 
94  // Protected Member Functions
95 
96  //- Calculate yPLus
97  virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
98 
99  //- Calculate the turbulence viscosity
100  virtual tmp<scalarField> calcNut() const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("nutURoughWallFunction");
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  // nutURoughWallFunctionFvPatchScalarField
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  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
173 
174  // Access
175 
176  //- Return the roughness height
177  scalar roughnessHeight() const
178  {
179  return roughnessHeight_;
180  }
181 
182  //- Return reference to the roughness height to allow adjustment
183  scalar& roughnessHeight()
184  {
185  return roughnessHeight_;
186  }
187 
188 
189  //- Return the roughness constant scale
190  scalar roughnessConstant() const
191  {
192  return roughnessConstant_;
193  }
194 
195  //- Return reference to the roughness constant to allow adjustment
197  {
198  return roughnessConstant_;
199  }
200 
201  //- Return the roughness scale factor
202  scalar roughnessFactor() const
203  {
204  return roughnessFactor_;
205  }
206 
207  //- Return reference to the roughness scale factor to allow
208  // adjustment
209  scalar& roughnessFactor()
210  {
211  return roughnessFactor_;
212  }
213 
214 
215  // I-O
216 
217  // Evaluation functions
218 
219  //- Calculate and return the yPlus at the boundary
220  virtual tmp<scalarField> yPlus() const;
221 
222 
223  // I-O
224 
225  //- Write
226  virtual void write(Ostream& os) const;
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessHeight
scalar & roughnessHeight()
Return reference to the roughness height to allow adjustment.
Definition: nutURoughWallFunctionFvPatchScalarField.H:202
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::nutURoughWallFunctionFvPatchScalarField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
Definition: nutURoughWallFunctionFvPatchScalarField.H:95
Foam::nutURoughWallFunctionFvPatchScalarField::calcYPlus
virtual tmp< scalarField > calcYPlus(const scalarField &magUp) const
Calculate yPLus.
Definition: nutURoughWallFunctionFvPatchScalarField.C:79
nutWallFunctionFvPatchScalarField.H
magUp
scalar magUp
Definition: evaluateNearWall.H:10
Foam::nutURoughWallFunctionFvPatchScalarField::TypeName
TypeName("nutURoughWallFunction")
Runtime type information.
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::nutURoughWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: nutURoughWallFunctionFvPatchScalarField.H:163
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessConstant
scalar roughnessConstant() const
Return the roughness constant scale.
Definition: nutURoughWallFunctionFvPatchScalarField.H:209
Foam::nutURoughWallFunctionFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: nutURoughWallFunctionFvPatchScalarField.C:293
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessFactor
scalar roughnessFactor() const
Return the roughness scale factor.
Definition: nutURoughWallFunctionFvPatchScalarField.H:221
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
nutURoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: nutURoughWallFunctionFvPatchScalarField.C:206
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessConstant
scalar & roughnessConstant()
Return reference to the roughness constant to allow adjustment.
Definition: nutURoughWallFunctionFvPatchScalarField.H:215
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessFactor_
scalar roughnessFactor_
Scale factor.
Definition: nutURoughWallFunctionFvPatchScalarField.H:110
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessConstant_
scalar roughnessConstant_
Constant.
Definition: nutURoughWallFunctionFvPatchScalarField.H:107
Foam::nutURoughWallFunctionFvPatchScalarField::yPlus
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
Definition: nutURoughWallFunctionFvPatchScalarField.C:274
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessHeight_
scalar roughnessHeight_
Height.
Definition: nutURoughWallFunctionFvPatchScalarField.H:104
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::nutWallFunctionFvPatchScalarField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
Definition: nutWallFunctionFvPatchScalarField.H:101
Foam::nutURoughWallFunctionFvPatchScalarField::roughnessHeight
scalar roughnessHeight() const
Return the roughness height.
Definition: nutURoughWallFunctionFvPatchScalarField.H:196
Foam::nutURoughWallFunctionFvPatchScalarField::calcNut
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
Definition: nutURoughWallFunctionFvPatchScalarField.C:39
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51