00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 3 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 atmBoundaryLayerInletEpsilonFvPatchScalarField 00027 00028 Description 00029 Boundary condition specifies a epsilon inlet for the atmospheric boundary 00030 layer (ABL). This boundaty is to be used in conjunction with 00031 ABLInletVelocity. 00032 00033 @verbatim 00034 epsilon = Ustar^3 / (K(z - zGround + z0)) 00035 00036 where: 00037 00038 Ustar is the frictional velocity 00039 K is karman's constant 00040 z is the verical coordinate 00041 z0 is the surface roughness lenght 00042 zGround minium vlaue in z direction 00043 00044 @endverbatim 00045 00046 Reference: 00047 D.M. Hargreaves and N.G. Wright 00048 "On the use of the k-epsilon model in commercial CFD software to model the 00049 neutral atmospheric boundary layer" 00050 Journal of Wind Engineering and Industrial Aerodynamics 95(2007) 355-369. 00051 00052 SourceFiles 00053 atmBoundaryLayerInletEpsilonFvPatchScalarField.C 00054 00055 \*---------------------------------------------------------------------------*/ 00056 00057 #ifndef atmBoundaryLayerInletEpsilonFvPatchScalarField_H 00058 #define atmBoundaryLayerInletEpsilonFvPatchScalarField_H 00059 00060 #include <finiteVolume/fvPatchFields.H> 00061 #include <finiteVolume/fixedValueFvPatchFields.H> 00062 00063 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00064 00065 namespace Foam 00066 { 00067 namespace incompressible 00068 { 00069 00070 /*---------------------------------------------------------------------------*\ 00071 Class atmBoundaryLayerInletEpsilonFvPatchScalarField Declaration 00072 \*---------------------------------------------------------------------------*/ 00073 00074 class atmBoundaryLayerInletEpsilonFvPatchScalarField 00075 : 00076 public fixedValueFvPatchScalarField 00077 { 00078 // Private data 00079 00080 //- Frictional velocity 00081 const scalar Ustar_; 00082 00083 //- Direction of the z-coordinate 00084 vector z_; 00085 00086 //- Surface roughness lenght 00087 const scalar z0_; 00088 00089 //- Von Karman constant 00090 const scalar kappa_; 00091 00092 //- Minimum corrdinate value in z direction 00093 const scalar zGround_; 00094 00095 00096 public: 00097 00098 //- Runtime type information 00099 TypeName("atmBoundaryLayerInletEpsilon"); 00100 00101 00102 // Constructors 00103 00104 //- Construct from patch and internal field 00105 atmBoundaryLayerInletEpsilonFvPatchScalarField 00106 ( 00107 const fvPatch&, 00108 const DimensionedField<scalar, volMesh>& 00109 ); 00110 00111 //- Construct from patch, internal field and dictionary 00112 atmBoundaryLayerInletEpsilonFvPatchScalarField 00113 ( 00114 const fvPatch&, 00115 const DimensionedField<scalar, volMesh>&, 00116 const dictionary& 00117 ); 00118 00119 //- Construct by mapping given 00120 // atmBoundaryLayerInletEpsilonFvPatchScalarField onto a new patch 00121 atmBoundaryLayerInletEpsilonFvPatchScalarField 00122 ( 00123 const atmBoundaryLayerInletEpsilonFvPatchScalarField&, 00124 const fvPatch&, 00125 const DimensionedField<scalar, volMesh>&, 00126 const fvPatchFieldMapper& 00127 ); 00128 00129 //- Construct and return a clone 00130 virtual tmp<fvPatchScalarField> clone() const 00131 { 00132 return tmp<fvPatchScalarField> 00133 ( 00134 new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this) 00135 ); 00136 } 00137 00138 //- Construct as copy setting internal field reference 00139 atmBoundaryLayerInletEpsilonFvPatchScalarField 00140 ( 00141 const atmBoundaryLayerInletEpsilonFvPatchScalarField&, 00142 const DimensionedField<scalar, volMesh>& 00143 ); 00144 00145 //- Construct and return a clone setting internal field reference 00146 virtual tmp<fvPatchScalarField> clone 00147 ( 00148 const DimensionedField<scalar, volMesh>& iF 00149 ) const 00150 { 00151 return tmp<fvPatchScalarField> 00152 ( 00153 new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this, iF) 00154 ); 00155 } 00156 00157 00158 // Member functions 00159 00160 //- Return max value 00161 scalar Ustar() const 00162 { 00163 return Ustar_; 00164 } 00165 00166 //- Return z direction 00167 const vector& z() const 00168 { 00169 return z_; 00170 } 00171 00172 //- Update coefficients 00173 virtual void updateCoeffs(); 00174 00175 //- Write 00176 virtual void write(Ostream&) const; 00177 }; 00178 00179 00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00181 00182 } // End namespace incompressible 00183 } // End namespace Foam 00184 00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00186 00187 #endif 00188 00189 // ************************************************************************* //