FreeFOAM The Cross-Platform CFD Toolkit
atmBoundaryLayerInletVelocityFvPatchVectorField.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) 2010-2010 OpenCFD Ltd.
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 the
13  Free Software Foundation; either version 3 of the License, or (at your
14  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, write to the Free Software Foundation,
23  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 Class
26  atmBoundaryLayerInletVelocityFvPatchVectorField
27 
28 Description
29  Boundary condition specifies a atmospheric boundary layer (ABL)
30  velocity inlet profile given the friction velocity value,
31  flow direction n and direction of the parabolic coordinate z.
32 
33  @verbatim
34  U = (Ustar/K) ln((z - zGround + z0)/z0)
35 
36  where:
37 
38  Ustar is the frictional velocity
39  K is karman's constant
40  z0 is the surface roughness lenght
41  z is the verical coordinate
42  zGround is the minumum coordinate value in z direction.
43 
44  and:
45 
46  Ustar = K Uref/ln((Zref + z0)/z0)
47 
48  where:
49 
50  Uref is the reference velocity at Zref
51  Zref is the reference height.
52 
53  @endverbatim
54 
55  Reference:
56  D.M. Hargreaves and N.G. Wright
57  "On the use of the k-epsilon model in commercial CFD software to model the
58  neutral atmospheric boundary layer"
59  Journal of Wind Engineering and Industrial Aerodynamics 95(2007) 355-369.
60 
61 NOTE: D.M. Hargreaves and N.G. Wright recommend Gamma epsilon in the k-epsilon
62  model should be changed from 1.3 to 1.11 for consistency.
63  The roughness height (Er) is given by Er = 20 z0 following the same
64  reference
65 
66 SourceFiles
67  atmBoundaryLayerInletVelocityFvPatchVectorField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef atmBoundaryLayerInletVelocityFvPatchVectorField_H
72 #define atmBoundaryLayerInletVelocityFvPatchVectorField_H
73 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 namespace incompressible
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class atmBoundaryLayerInletVelocityFvPatchVectorField Declaration
86 \*---------------------------------------------------------------------------*/
87 
89 :
90  public fixedValueFvPatchVectorField
91 {
92  // Private data
93 
94  //- Frictional velocity
95  scalar Ustar_;
96 
97  //- Flow direction
98  vector n_;
99 
100  //- Direction of the z-coordinate
101  vector z_;
102 
103  //- Surface roughness lenght
104  const scalar z0_;
105 
106  //- Von Karman constant
107  const scalar kappa_;
108 
109  //- Reference velocity
110  const scalar Uref_;
111 
112  //- Reference hight
113  const scalar Href_;
114 
115  //- Minimum corrdinate value in z direction
116  const scalar zGround_;
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("atmBoundaryLayerInletVelocity");
123 
124 
125  // Constructors
126 
127  //- Construct from patch and internal field
129  (
130  const fvPatch&,
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const fvPatch&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping given
143  // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch
145  (
147  const fvPatch&,
149  const fvPatchFieldMapper&
150  );
151 
152  //- Construct and return a clone
154  {
156  (
158  );
159  }
160 
161  //- Construct as copy setting internal field reference
163  (
166  );
167 
168  //- Construct and return a clone setting internal field reference
170  (
172  ) const
173  {
175  (
177  );
178  }
179 
180 
181  // Member functions
182 
183  //- Return Ustar
184  scalar& Ustar()
185  {
186  return Ustar_;
187  }
188 
189  //- Return flow direction
191  {
192  return n_;
193  }
194 
195  //- Return z direction
197  {
198  return z_;
199  }
200 
201  //- Update coefficients
202  virtual void updateCoeffs();
203 
204  //- Write
205  virtual void write(Ostream&) const;
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace incompressible
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //