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  //- Disallow copy without setting internal field reference
137  (
139  ) = delete;
140 
141  //- Copy constructor setting internal field reference
143  (
146  );
147 
148  //- Construct and return a clone setting internal field reference
150  (
152  ) const
153  {
155  (
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Access functions
164 
165  // Return z0
166  scalarField& z0()
167  {
168  return z0_;
169  }
170 
171 
172  // Mapping functions
173 
174  //- Map (and resize as needed) from self given a mapping object
175  virtual void autoMap(const fvPatchFieldMapper&);
176 
177  //- Reverse map the given fvPatchField onto this fvPatchField
178  virtual void rmap
179  (
180  const fvPatchScalarField&,
181  const labelList&
182  );
183 
184 
185  // I-O
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 };
190 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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:156
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:62
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.
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:54
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.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Namespace for OpenFOAM.