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-2023 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
108 
109  //- Construct from patch, internal field and dictionary
111  (
112  const fvPatch&,
114  const dictionary&
115  );
116 
117  //- Construct by mapping given
118  // nutkAtmRoughWallFunctionFvPatchScalarField
119  // onto a new patch
121  (
123  const fvPatch&,
125  const fvPatchFieldMapper&
126  );
127 
128  //- Disallow copy without setting internal field reference
130  (
132  ) = delete;
133 
134  //- Copy constructor setting internal field reference
136  (
139  );
140 
141  //- Construct and return a clone setting internal field reference
143  (
145  ) const
146  {
148  (
150  );
151  }
152 
153 
154  // Member Functions
155 
156  // Access functions
157 
158  // Return z0
159  scalarField& z0()
160  {
161  return z0_;
162  }
163 
164 
165  // Mapping functions
166 
167  //- Map the given fvPatchField onto this fvPatchField
168  virtual void map
169  (
170  const fvPatchScalarField&,
171  const fvPatchFieldMapper&
172  );
173 
174  //- Reset the fvPatchField to the given fvPatchField
175  // Used for mesh to mesh mapping
176  virtual void reset(const fvPatchScalarField&);
177 
178 
179  // I-O
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a turbulent kinematic viscosity for atmospheric velocity profiles....
virtual tmp< scalarField > nut() const
Calculate the turbulence viscosity.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
nutkAtmRoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("nutkAtmRoughWallFunction")
Runtime type information.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.