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

mutkWallFunctionFvPatchScalarField.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::mutkWallFunctionFvPatchScalarField
00026 
00027 Description
00028     Boundary condition for turbulent (kinematic) viscosity when using wall
00029     functions, based on turbulence kinetic energy.
00030     - replicates OpenFOAM v1.5 (and earlier) behaviour
00031 
00032 SourceFiles
00033     mutkWallFunctionFvPatchScalarField.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef compressibleMutkWallFunctionFvPatchScalarField_H
00038 #define compressibleMutkWallFunctionFvPatchScalarField_H
00039 
00040 #include <finiteVolume/fixedValueFvPatchFields.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 namespace compressible
00047 {
00048 namespace RASModels
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052              Class mutkWallFunctionFvPatchScalarField Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class mutkWallFunctionFvPatchScalarField
00056 :
00057     public fixedValueFvPatchScalarField
00058 {
00059 protected:
00060 
00061     // Protected data
00062 
00063         //- Cmu coefficient
00064         scalar Cmu_;
00065 
00066         //- Von Karman constant
00067         scalar kappa_;
00068 
00069         //- E coefficient
00070         scalar E_;
00071 
00072         //- Y+ at the edge of the laminar sublayer
00073         scalar yPlusLam_;
00074 
00075 
00076     // Protected member functions
00077 
00078         //- Check the type of the patch
00079         virtual void checkType();
00080 
00081         //- Calculate the Y+ at the edge of the laminar sublayer
00082         virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
00083 
00084         //- Calculate the turbulence viscosity
00085         virtual tmp<scalarField> calcMut() const;
00086 
00087         //- Write local wall function variables
00088         virtual void writeLocalEntries(Ostream&) const;
00089 
00090 
00091 public:
00092 
00093     //- Runtime type information
00094     TypeName("mutkWallFunction");
00095 
00096 
00097     // Constructors
00098 
00099         //- Construct from patch and internal field
00100         mutkWallFunctionFvPatchScalarField
00101         (
00102             const fvPatch&,
00103             const DimensionedField<scalar, volMesh>&
00104         );
00105 
00106         //- Construct from patch, internal field and dictionary
00107         mutkWallFunctionFvPatchScalarField
00108         (
00109             const fvPatch&,
00110             const DimensionedField<scalar, volMesh>&,
00111             const dictionary&
00112         );
00113 
00114         //- Construct by mapping given
00115         //  mutkWallFunctionFvPatchScalarField
00116         //  onto a new patch
00117         mutkWallFunctionFvPatchScalarField
00118         (
00119             const mutkWallFunctionFvPatchScalarField&,
00120             const fvPatch&,
00121             const DimensionedField<scalar, volMesh>&,
00122             const fvPatchFieldMapper&
00123         );
00124 
00125         //- Construct as copy
00126         mutkWallFunctionFvPatchScalarField
00127         (
00128             const mutkWallFunctionFvPatchScalarField&
00129         );
00130 
00131         //- Construct and return a clone
00132         virtual tmp<fvPatchScalarField> clone() const
00133         {
00134             return tmp<fvPatchScalarField>
00135             (
00136                 new mutkWallFunctionFvPatchScalarField(*this)
00137             );
00138         }
00139 
00140         //- Construct as copy setting internal field reference
00141         mutkWallFunctionFvPatchScalarField
00142         (
00143             const mutkWallFunctionFvPatchScalarField&,
00144             const DimensionedField<scalar, volMesh>&
00145         );
00146 
00147         //- Construct and return a clone setting internal field reference
00148         virtual tmp<fvPatchScalarField> clone
00149         (
00150             const DimensionedField<scalar, volMesh>& iF
00151         ) const
00152         {
00153             return tmp<fvPatchScalarField>
00154             (
00155                 new mutkWallFunctionFvPatchScalarField(*this, iF)
00156             );
00157         }
00158 
00159 
00160     // Member functions
00161 
00162         // Evaluation functions
00163 
00164             //- Calculate and return the yPlus at the boundary
00165             virtual tmp<scalarField> yPlus() const;
00166 
00167             //- Update the coefficients associated with the patch field
00168             virtual void updateCoeffs();
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