nutkAtmRoughWallFunctionFvPatchScalarField.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-2016 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 Group
28  grpWallFunctions
29 
30 Description
31  This boundary condition provides a turbulent kinematic viscosity for
32  atmospheric velocity profiles. It is desinged to be used in conjunction
33  with the atmBoundaryLayerInletVelocity boundary condition. The values
34  are calculated using:
35 
36  \f[
37  U = frac{U_f}{K} ln(\frac{z + z_0}{z_0})
38  \f]
39 
40  where
41 
42  \vartable
43  U_f | frictional velocity
44  K | Von Karman's constant
45  z_0 | surface roughness length
46  z | vertical co-ordinate
47  \endvartable
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  z0 | surface roughness length| yes |
53  \endtable
54 
55  Example of the boundary condition specification:
56  \verbatim
57  <patchName>
58  {
59  type nutkAtmRoughWallFunction;
60  z0 uniform 0;
61  }
62  \endverbatim
63 
64 See also
65  Foam::nutkWallFunctionFvPatchField
66 
67 SourceFiles
68  nutkAtmRoughWallFunctionFvPatchScalarField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H
73 #define nutkAtmRoughWallFunctionFvPatchScalarField_H
74 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class nutkAtmRoughWallFunctionFvPatchScalarField
87 :
88  public nutkWallFunctionFvPatchScalarField
89 {
90 protected:
91 
92  // Protected data
93 
94  //- Surface roughness length
96 
97 
98  // Protected Member Functions
99 
100 
101  //- Calculate the turbulence viscosity
102  virtual tmp<scalarField> calcNut() const;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("nutkAtmRoughWallFunction");
109 
110 
111  // Constructors
112 
113  //- Construct from patch and internal field
115  (
116  const fvPatch&,
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given
129  // nutkAtmRoughWallFunctionFvPatchScalarField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchScalarField> clone() const
147  {
149  (
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
170  );
171  }
172 
173 
174  // Member functions
175 
176  // Acces functions
177 
178  // Return z0
179  scalarField& z0()
180  {
181  return z0_;
182  }
183 
184 
185  // Mapping functions
186 
187  //- Map (and resize as needed) from self given a mapping object
188  virtual void autoMap(const fvPatchFieldMapper&);
189 
190  //- Reverse map the given fvPatchField onto this fvPatchField
191  virtual void rmap
192  (
193  const fvPatchScalarField&,
194  const labelList&
195  );
196 
197 
198  // I-O
199 
200  //- Write
201  virtual void write(Ostream&) const;
202 };
203 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
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:65
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:53
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
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:54
This boundary condition provides a turbulent kinematic viscosity for atmospheric velocity profiles...
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Namespace for OpenFOAM.