ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / turbulenceModels / incompressible / RAS / derivedFvPatchFields / atmBoundaryLayerInletVelocity / atmBoundaryLayerInletVelocityFvPatchVectorField.H
blobb5b5bdd3cbb03ef7a03f7303799f8002f0661b9c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     atmBoundaryLayerInletVelocityFvPatchVectorField
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.
33     \verbatim
34         U = (Ustar/K) ln((z - zGround + z0)/z0)
36     where:
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.
44     and:
46         Ustar = K Uref/ln((Zref + z0)/z0)
48     where:
50         Uref is the reference velocity at Zref
51         Zref is the reference height.
53     \endverbatim
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.
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
66 SourceFiles
67     atmBoundaryLayerInletVelocityFvPatchVectorField.C
69 \*---------------------------------------------------------------------------*/
71 #ifndef atmBoundaryLayerInletVelocityFvPatchVectorField_H
72 #define atmBoundaryLayerInletVelocityFvPatchVectorField_H
74 #include "fvPatchFields.H"
75 #include "fixedValueFvPatchFields.H"
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 namespace Foam
82 namespace incompressible
85 /*---------------------------------------------------------------------------*\
86        Class atmBoundaryLayerInletVelocityFvPatchVectorField Declaration
87 \*---------------------------------------------------------------------------*/
89 class atmBoundaryLayerInletVelocityFvPatchVectorField
91     public fixedValueFvPatchVectorField
93     // Private data
95         //- Frictional velocity
96         scalar Ustar_;
98         //- Flow direction
99         vector n_;
101         //- Direction of the z-coordinate
102         vector z_;
104         //- Surface roughness lenght
105         const scalar z0_;
107         //- Von Karman constant
108         const scalar kappa_;
110         //- Reference velocity
111         const scalar Uref_;
113         //- Reference hight
114         const scalar Href_;
116         //- Minimum corrdinate value in z direction
117         scalarField zGround_;
120 public:
122     //- Runtime type information
123     TypeName("atmBoundaryLayerInletVelocity");
126     // Constructors
128         //- Construct from patch and internal field
129         atmBoundaryLayerInletVelocityFvPatchVectorField
130         (
131             const fvPatch&,
132             const DimensionedField<vector, volMesh>&
133         );
135         //- Construct from patch, internal field and dictionary
136         atmBoundaryLayerInletVelocityFvPatchVectorField
137         (
138             const fvPatch&,
139             const DimensionedField<vector, volMesh>&,
140             const dictionary&
141         );
143         //- Construct by mapping given
144         // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch
145         atmBoundaryLayerInletVelocityFvPatchVectorField
146         (
147             const atmBoundaryLayerInletVelocityFvPatchVectorField&,
148             const fvPatch&,
149             const DimensionedField<vector, volMesh>&,
150             const fvPatchFieldMapper&
151         );
153         //- Construct and return a clone
154         virtual tmp<fvPatchVectorField> clone() const
155         {
156             return tmp<fvPatchVectorField>
157             (
158                 new atmBoundaryLayerInletVelocityFvPatchVectorField(*this)
159             );
160         }
162         //- Construct as copy setting internal field reference
163         atmBoundaryLayerInletVelocityFvPatchVectorField
164         (
165             const atmBoundaryLayerInletVelocityFvPatchVectorField&,
166             const DimensionedField<vector, volMesh>&
167         );
169         //- Construct and return a clone setting internal field reference
170         virtual tmp<fvPatchVectorField> clone
171         (
172             const DimensionedField<vector, volMesh>& iF
173         ) const
174         {
175             return tmp<fvPatchVectorField>
176             (
177                 new atmBoundaryLayerInletVelocityFvPatchVectorField(*this, iF)
178             );
179         }
182     // Member functions
184         //- Return Ustar
185         scalar& Ustar()
186         {
187             return Ustar_;
188         }
190         //- Return flow direction
191         vector& n()
192         {
193             return n_;
194         }
196         //- Return z direction
197         vector& z()
198         {
199             return z_;
200         }
202         //- Update coefficients
203         virtual void updateCoeffs();
205         //- Write
206         virtual void write(Ostream&) const;
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 } // End namespace incompressible
213 } // End namespace Foam
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 #endif
219 // ************************************************************************* //