FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

nutRoughWallFunctionFvPatchScalarField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::incompressible::RASModels::nutRoughWallFunctionFvPatchScalarField
00026 
00027 Description
00028     Boundary condition for turbulent (kinematic) viscosity when using wall
00029     functions for rough walls.
00030 
00031     Manipulates the E parameter to account for roughness effects, based on
00032     KsPlus.
00033 
00034     - roughness height = sand-grain roughness (0 for smooth walls)
00035     - roughness constant = 0.5-1.0 (0.5 default)
00036 
00037 SourceFiles
00038     nutRoughWallFunctionFvPatchScalarField.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef nutRoughWallFunctionFvPatchScalarField_H
00043 #define nutRoughWallFunctionFvPatchScalarField_H
00044 
00045 #include <incompressibleRASModels/nutWallFunctionFvPatchScalarField.H>
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 namespace incompressible
00052 {
00053 namespace RASModels
00054 {
00055 
00056 /*---------------------------------------------------------------------------*\
00057            Class nutRoughWallFunctionFvPatchScalarField Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class nutRoughWallFunctionFvPatchScalarField
00061 :
00062     public nutWallFunctionFvPatchScalarField
00063 {
00064 protected:
00065 
00066     // Protected data
00067 
00068         //- Roughness height
00069         scalarField Ks_;
00070 
00071         //- Roughness constant
00072         scalarField Cs_;
00073 
00074 
00075     // Protected member functions
00076 
00077         //- Compute the roughness function
00078         virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
00079 
00080         //- Calculate the turbulence viscosity
00081         virtual tmp<scalarField> calcNut() const;
00082 
00083 
00084 public:
00085 
00086     //- Runtime type information
00087     TypeName("nutRoughWallFunction");
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct from patch and internal field
00093         nutRoughWallFunctionFvPatchScalarField
00094         (
00095             const fvPatch&,
00096             const DimensionedField<scalar, volMesh>&
00097         );
00098 
00099         //- Construct from patch, internal field and dictionary
00100         nutRoughWallFunctionFvPatchScalarField
00101         (
00102             const fvPatch&,
00103             const DimensionedField<scalar, volMesh>&,
00104             const dictionary&
00105         );
00106 
00107         //- Construct by mapping given
00108         //  nutRoughWallFunctionFvPatchScalarField
00109         //  onto a new patch
00110         nutRoughWallFunctionFvPatchScalarField
00111         (
00112             const nutRoughWallFunctionFvPatchScalarField&,
00113             const fvPatch&,
00114             const DimensionedField<scalar, volMesh>&,
00115             const fvPatchFieldMapper&
00116         );
00117 
00118         //- Construct as copy
00119         nutRoughWallFunctionFvPatchScalarField
00120         (
00121             const nutRoughWallFunctionFvPatchScalarField&
00122         );
00123 
00124         //- Construct and return a clone
00125         virtual tmp<fvPatchScalarField> clone() const
00126         {
00127             return tmp<fvPatchScalarField>
00128             (
00129                 new nutRoughWallFunctionFvPatchScalarField(*this)
00130             );
00131         }
00132 
00133         //- Construct as copy setting internal field reference
00134         nutRoughWallFunctionFvPatchScalarField
00135         (
00136             const nutRoughWallFunctionFvPatchScalarField&,
00137             const DimensionedField<scalar, volMesh>&
00138         );
00139 
00140         //- Construct and return a clone setting internal field reference
00141         virtual tmp<fvPatchScalarField> clone
00142         (
00143             const DimensionedField<scalar, volMesh>& iF
00144         ) const
00145         {
00146             return tmp<fvPatchScalarField>
00147             (
00148                 new nutRoughWallFunctionFvPatchScalarField(*this, iF)
00149             );
00150         }
00151 
00152 
00153     // Member functions
00154 
00155          // Acces functions
00156 
00157             scalarField& Ks()
00158             {
00159                 return Ks_;
00160             }
00161 
00162             scalarField& Cs()
00163             {
00164                 return Cs_;
00165             }
00166 
00167         // Mapping functions
00168 
00169             //- Map (and resize as needed) from self given a mapping object
00170             virtual void autoMap(const fvPatchFieldMapper&);
00171 
00172             //- Reverse map the given fvPatchField onto this fvPatchField
00173             virtual void rmap
00174             (
00175                 const fvPatchScalarField&,
00176                 const labelList&
00177             );
00178 
00179 
00180         // I-O
00181 
00182             //- Write
00183             virtual void write(Ostream&) const;
00184 };
00185 
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 } // End namespace RASModels
00190 } // End namespace incompressible
00191 } // End namespace Foam
00192 
00193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00194 
00195 #endif
00196 
00197 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines