FreeFOAM The Cross-Platform CFD Toolkit
atmBoundaryLayerInletEpsilonFvPatchScalarField.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  atmBoundaryLayerInletEpsilonFvPatchScalarField
27 
28 Description
29  Boundary condition specifies a epsilon inlet for the atmospheric boundary
30  layer (ABL). This boundaty is to be used in conjunction with
31  ABLInletVelocity.
32 
33  @verbatim
34  epsilon = Ustar^3 / (K(z - zGround + z0))
35 
36  where:
37 
38  Ustar is the frictional velocity
39  K is karman's constant
40  z is the verical coordinate
41  z0 is the surface roughness lenght
42  zGround minium vlaue in z direction
43 
44  @endverbatim
45 
46  Reference:
47  D.M. Hargreaves and N.G. Wright
48  "On the use of the k-epsilon model in commercial CFD software to model the
49  neutral atmospheric boundary layer"
50  Journal of Wind Engineering and Industrial Aerodynamics 95(2007) 355-369.
51 
52 SourceFiles
53  atmBoundaryLayerInletEpsilonFvPatchScalarField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef atmBoundaryLayerInletEpsilonFvPatchScalarField_H
58 #define atmBoundaryLayerInletEpsilonFvPatchScalarField_H
59 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace incompressible
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class atmBoundaryLayerInletEpsilonFvPatchScalarField Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public fixedValueFvPatchScalarField
77 {
78  // Private data
79 
80  //- Frictional velocity
81  const scalar Ustar_;
82 
83  //- Direction of the z-coordinate
84  vector z_;
85 
86  //- Surface roughness lenght
87  const scalar z0_;
88 
89  //- Von Karman constant
90  const scalar kappa_;
91 
92  //- Minimum corrdinate value in z direction
93  const scalar zGround_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("atmBoundaryLayerInletEpsilon");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // atmBoundaryLayerInletEpsilonFvPatchScalarField onto a new patch
122  (
124  const fvPatch&,
126  const fvPatchFieldMapper&
127  );
128 
129  //- Construct and return a clone
131  {
133  (
135  );
136  }
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  );
155  }
156 
157 
158  // Member functions
159 
160  //- Return max value
161  scalar Ustar() const
162  {
163  return Ustar_;
164  }
165 
166  //- Return z direction
167  const vector& z() const
168  {
169  return z_;
170  }
171 
172  //- Update coefficients
173  virtual void updateCoeffs();
174 
175  //- Write
176  virtual void write(Ostream&) const;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace incompressible
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //