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-2018 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 desinged 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}{K} ln(\frac{z + z_0}{z_0})
35  \f]
36 
37  where
38 
39  \vartable
40  U_f | frictional velocity
41  K | 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 
98  //- Calculate the turbulence viscosity
99  virtual tmp<scalarField> calcNut() const;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("nutkAtmRoughWallFunction");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // nutkAtmRoughWallFunctionFvPatchScalarField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchScalarField> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member functions
172 
173  // Access functions
174 
175  // Return z0
176  scalarField& z0()
177  {
178  return z0_;
179  }
180 
181 
182  // Mapping functions
183 
184  //- Map (and resize as needed) from self given a mapping object
185  virtual void autoMap(const fvPatchFieldMapper&);
186 
187  //- Reverse map the given fvPatchField onto this fvPatchField
188  virtual void rmap
189  (
190  const fvPatchScalarField&,
191  const labelList&
192  );
193 
194 
195  // I-O
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 };
200 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
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:137
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.
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
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...
Namespace for OpenFOAM.