nutkAtmRoughWallFunctionFvPatchScalarField.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::nutkAtmRoughWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulent kinematic viscosity for
29  atmospheric velocity profiles. It is designed to be used in conjunction
30  with the atmBoundaryLayerInletVelocity boundary condition. The values
31  are calculated using:
32 
33  \f[
34  U = frac{U_f}{\kappa} ln(\frac{z + z_0}{z_0})
35  \f]
36 
37  where
38 
39  \vartable
40  U_f | frictional velocity
41  \kappa | Von Karman's constant
42  z_0 | surface roughness length
43  z | vertical co-ordinate
44  \endvartable
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  z0 | surface roughness length| yes |
50  \endtable
51 
52  Example of the boundary condition specification:
53  \verbatim
54  <patchName>
55  {
56  type nutkAtmRoughWallFunction;
57  z0 uniform 0;
58  }
59  \endverbatim
60 
61 See also
62  Foam::nutkWallFunctionFvPatchField
63 
64 SourceFiles
65  nutkAtmRoughWallFunctionFvPatchScalarField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H
70 #define nutkAtmRoughWallFunctionFvPatchScalarField_H
71 
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class nutkAtmRoughWallFunctionFvPatchScalarField
84 :
85  public nutkWallFunctionFvPatchScalarField
86 {
87 protected:
88 
89  // Protected data
90 
91  //- Surface roughness length
93 
94 
95  // Protected Member Functions
96 
97  //- Calculate the turbulence viscosity
98  virtual tmp<scalarField> nut() const;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("nutkAtmRoughWallFunction");
105 
106 
107  // Constructors
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given
125  // nutkAtmRoughWallFunctionFvPatchScalarField
126  // onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Copy constructor
137  (
139  );
140 
141  //- Construct and return a clone
142  virtual tmp<fvPatchScalarField> clone() const
143  {
145  (
147  );
148  }
149 
150  //- Copy constructor setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
164  (
166  );
167  }
168 
169 
170  // Member Functions
171 
172  // Access functions
173 
174  // Return z0
175  scalarField& z0()
176  {
177  return z0_;
178  }
179 
180 
181  // Mapping functions
182 
183  //- Map (and resize as needed) from self given a mapping object
184  virtual void autoMap(const fvPatchFieldMapper&);
185 
186  //- Reverse map the given fvPatchField onto this fvPatchField
187  virtual void rmap
188  (
189  const fvPatchScalarField&,
190  const labelList&
191  );
192 
193 
194  // I-O
195 
196  //- Write
197  virtual void write(Ostream&) const;
198 };
199 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
nutkAtmRoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
TypeName("nutkAtmRoughWallFunction")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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
This boundary condition provides a turbulent kinematic viscosity for atmospheric velocity profiles...
virtual tmp< scalarField > nut() const
Calculate the turbulence viscosity.
Namespace for OpenFOAM.