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

mutRoughWallFunctionFvPatchScalarField.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::compressible::RASModels::mutRoughWallFunctionFvPatchScalarField
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     mutRoughWallFunctionFvPatchScalarField.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H
00043 #define compressibleMutRoughWallFunctionFvPatchScalarField_H
00044 
00045 #include <compressibleRASModels/mutWallFunctionFvPatchScalarField.H>
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 namespace compressible
00052 {
00053 namespace RASModels
00054 {
00055 
00056 /*---------------------------------------------------------------------------*\
00057           Class mutRoughWallFunctionFvPatchScalarField Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class mutRoughWallFunctionFvPatchScalarField
00061 :
00062     public mutWallFunctionFvPatchScalarField
00063 {
00064 protected:
00065 
00066     // Protected data
00067 
00068         //- Roughness height
00069         scalarField Ks_;
00070 
00071         //- Roughness constant
00072         scalarField Cs_;
00073 
00074 
00075     // Private 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> calcMut() const;
00082 
00083 
00084 public:
00085 
00086     //- Runtime type information
00087     TypeName("mutRoughWallFunction");
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct from patch and internal field
00093         mutRoughWallFunctionFvPatchScalarField
00094         (
00095             const fvPatch&,
00096             const DimensionedField<scalar, volMesh>&
00097         );
00098 
00099         //- Construct from patch, internal field and dictionary
00100         mutRoughWallFunctionFvPatchScalarField
00101         (
00102             const fvPatch&,
00103             const DimensionedField<scalar, volMesh>&,
00104             const dictionary&
00105         );
00106 
00107         //- Construct by mapping given
00108         //  mutRoughWallFunctionFvPatchScalarField
00109         //  onto a new patch
00110         mutRoughWallFunctionFvPatchScalarField
00111         (
00112             const mutRoughWallFunctionFvPatchScalarField&,
00113             const fvPatch&,
00114             const DimensionedField<scalar, volMesh>&,
00115             const fvPatchFieldMapper&
00116         );
00117 
00118         //- Construct as copy
00119         mutRoughWallFunctionFvPatchScalarField
00120         (
00121             const mutRoughWallFunctionFvPatchScalarField&
00122         );
00123 
00124         //- Construct and return a clone
00125         virtual tmp<fvPatchScalarField> clone() const
00126         {
00127             return tmp<fvPatchScalarField>
00128             (
00129                 new mutRoughWallFunctionFvPatchScalarField(*this)
00130             );
00131         }
00132 
00133         //- Construct as copy setting internal field reference
00134         mutRoughWallFunctionFvPatchScalarField
00135         (
00136             const mutRoughWallFunctionFvPatchScalarField&,
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 mutRoughWallFunctionFvPatchScalarField(*this, iF)
00149             );
00150         }
00151 
00152 
00153     // Member functions
00154 
00155         // Mapping functions
00156 
00157             //- Map (and resize as needed) from self given a mapping object
00158             virtual void autoMap
00159             (
00160                 const fvPatchFieldMapper&
00161             );
00162 
00163             //- Reverse map the given fvPatchField onto this fvPatchField
00164             virtual void rmap
00165             (
00166                 const fvPatchScalarField&,
00167                 const labelList&
00168             );
00169 
00170 
00171         // I-O
00172 
00173             //- Write
00174             virtual void write(Ostream&) const;
00175 };
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 } // End namespace RASModels
00181 } // End namespace compressible
00182 } // End namespace Foam
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 #endif
00187 
00188 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines