1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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
26 atmBoundaryLayerInletVelocityFvPatchVectorField
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.
34 U = (Ustar/K) ln((z - zGround + z0)/z0)
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.
46 Ustar = K Uref/ln((Zref + z0)/z0)
50 Uref is the reference velocity at Zref
51 Zref is the reference height.
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.
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
67 atmBoundaryLayerInletVelocityFvPatchVectorField.C
69 \*---------------------------------------------------------------------------*/
71 #ifndef atmBoundaryLayerInletVelocityFvPatchVectorField_H
72 #define atmBoundaryLayerInletVelocityFvPatchVectorField_H
74 #include "fvPatchFields.H"
75 #include "fixedValueFvPatchFields.H"
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 namespace incompressible
85 /*---------------------------------------------------------------------------*\
86 Class atmBoundaryLayerInletVelocityFvPatchVectorField Declaration
87 \*---------------------------------------------------------------------------*/
89 class atmBoundaryLayerInletVelocityFvPatchVectorField
91 public fixedValueFvPatchVectorField
95 //- Frictional velocity
101 //- Direction of the z-coordinate
104 //- Surface roughness lenght
107 //- Von Karman constant
110 //- Reference velocity
116 //- Minimum corrdinate value in z direction
117 scalarField zGround_;
122 //- Runtime type information
123 TypeName("atmBoundaryLayerInletVelocity");
128 //- Construct from patch and internal field
129 atmBoundaryLayerInletVelocityFvPatchVectorField
132 const DimensionedField<vector, volMesh>&
135 //- Construct from patch, internal field and dictionary
136 atmBoundaryLayerInletVelocityFvPatchVectorField
139 const DimensionedField<vector, volMesh>&,
143 //- Construct by mapping given
144 // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch
145 atmBoundaryLayerInletVelocityFvPatchVectorField
147 const atmBoundaryLayerInletVelocityFvPatchVectorField&,
149 const DimensionedField<vector, volMesh>&,
150 const fvPatchFieldMapper&
153 //- Construct and return a clone
154 virtual tmp<fvPatchVectorField> clone() const
156 return tmp<fvPatchVectorField>
158 new atmBoundaryLayerInletVelocityFvPatchVectorField(*this)
162 //- Construct as copy setting internal field reference
163 atmBoundaryLayerInletVelocityFvPatchVectorField
165 const atmBoundaryLayerInletVelocityFvPatchVectorField&,
166 const DimensionedField<vector, volMesh>&
169 //- Construct and return a clone setting internal field reference
170 virtual tmp<fvPatchVectorField> clone
172 const DimensionedField<vector, volMesh>& iF
175 return tmp<fvPatchVectorField>
177 new atmBoundaryLayerInletVelocityFvPatchVectorField(*this, iF)
190 //- Return flow direction
196 //- Return z direction
202 //- Update coefficients
203 virtual void updateCoeffs();
206 virtual void write(Ostream&) const;
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 } // End namespace incompressible
213 } // End namespace Foam
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 // ************************************************************************* //