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-2015 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  \heading Patch usage
50 
51  \table
52  Property | Description | Required | Default value
53  z0 | surface roughness length| yes |
54  \endtable
55 
56  Example of the boundary condition specification:
57  \verbatim
58  myPatch
59  {
60  type nutkAtmRoughWallFunction;
61  z0 uniform 0;
62  }
63  \endverbatim
64 
65 SeeAlso
66  Foam::nutkWallFunctionFvPatchField
67 
68 SourceFiles
69  nutkAtmRoughWallFunctionFvPatchScalarField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H
74 #define nutkAtmRoughWallFunctionFvPatchScalarField_H
75 
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class nutkAtmRoughWallFunctionFvPatchScalarField
88 :
89  public nutkWallFunctionFvPatchScalarField
90 {
91 protected:
92 
93  // Protected data
94 
95  //- Surface roughness length
97 
98 
99  // Protected Member Functions
100 
101 
102  //- Calculate the turbulence viscosity
103  virtual tmp<scalarField> calcNut() const;
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("nutkAtmRoughWallFunction");
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const fvPatch&,
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const fvPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given
130  // nutkAtmRoughWallFunctionFvPatchScalarField
131  // onto a new patch
133  (
135  const fvPatch&,
137  const fvPatchFieldMapper&
138  );
139 
140  //- Construct as copy
142  (
144  );
145 
146  //- Construct and return a clone
147  virtual tmp<fvPatchScalarField> clone() const
148  {
150  (
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
164  (
166  ) const
167  {
169  (
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Acces functions
178 
179  // Return z0
180  scalarField& z0()
181  {
182  return z0_;
183  }
184 
185 
186  // Mapping functions
187 
188  //- Map (and resize as needed) from self given a mapping object
189  virtual void autoMap(const fvPatchFieldMapper&);
190 
191  //- Reverse map the given fvPatchField onto this fvPatchField
192  virtual void rmap
193  (
194  const fvPatchScalarField&,
195  const labelList&
196  );
197 
198 
199  // I-O
200 
201  //- Write
202  virtual void write(Ostream&) const;
203 };
204 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
TypeName("nutkAtmRoughWallFunction")
Runtime type information.
Foam::fvPatchFieldMapper.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
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
This boundary condition provides a turbulent kinematic viscosity for atmospheric velocity profiles...
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual tmp< scalarField > calcNut() const
Calculate the turbulence viscosity.
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.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
A class for managing temporary objects.
Definition: PtrList.H:118