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

GenEddyVisc.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) 1991-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::LESModels::GenEddyVisc
00026 
00027 Description
00028     General base class for all compressible models that can be implemented as
00029     an eddy viscosity, i.e. algebraic and one-equation models.
00030 
00031     Contains fields for k (SGS turbulent kinetic energy), gamma
00032     (modelled viscosity) and epsilon (SGS dissipation).
00033 
00034 SourceFiles
00035     GenEddyVisc.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef compressibleGenEddyVisc_H
00040 #define compressibleGenEddyVisc_H
00041 
00042 #include <compressibleLESModels/LESModel.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 namespace compressible
00049 {
00050 namespace LESModels
00051 {
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class GenEddyVisc Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class GenEddyVisc
00058 :
00059     virtual public LESModel
00060 {
00061     // Private Member Functions
00062 
00063         // Disallow default bitwise copy construct and assignment
00064         GenEddyVisc(const GenEddyVisc&);
00065         GenEddyVisc& operator=(const GenEddyVisc&);
00066 
00067 
00068 protected:
00069 
00070     // Model coefficients
00071 
00072         dimensionedScalar ce_;
00073         dimensionedScalar Prt_;
00074 
00075 
00076     // Fields
00077 
00078         volScalarField k_;
00079         volScalarField muSgs_;
00080         volScalarField alphaSgs_;
00081 
00082 
00083 public:
00084 
00085     // Constructors
00086 
00087         //- Construct from components
00088         GenEddyVisc
00089         (
00090             const volScalarField& rho,
00091             const volVectorField& U,
00092             const surfaceScalarField& phi,
00093             const basicThermo& thermoPhysicalModel
00094         );
00095 
00096 
00097     //- Destructor
00098     virtual ~GenEddyVisc()
00099     {}
00100 
00101 
00102     // Member Functions
00103 
00104         //- Return SGS kinetic energy
00105         virtual tmp<volScalarField> k() const
00106         {
00107             return k_;
00108         }
00109 
00110         //- Return sub-grid disipation rate
00111         virtual tmp<volScalarField> epsilon() const
00112         {
00113             return ce_*k_*sqrt(k_)/delta();
00114         }
00115 
00116         //- Return viscosity
00117         virtual tmp<volScalarField> muSgs() const
00118         {
00119             return muSgs_;
00120         }
00121 
00122         //- Return thermal diffusivity
00123         virtual tmp<volScalarField> alphaSgs() const
00124         {
00125             return alphaSgs_;
00126         }
00127 
00128         //- Return thermal diffusivity
00129         virtual tmp<volScalarField> alphaEff() const
00130         {
00131             return tmp<volScalarField>
00132             (
00133                 new volScalarField("alphaEff", alphaSgs_ + alpha())
00134             );
00135         }
00136 
00137         //- Return the sub-grid stress tensor.
00138         virtual tmp<volSymmTensorField> B() const;
00139 
00140         //- Return the deviatoric part of the effective sub-grid
00141         //  turbulence stress tensor including the laminar stress
00142         virtual tmp<volSymmTensorField> devRhoBeff() const;
00143 
00144         //- Returns div(rho*dev(B)).
00145         // This is the additional term due to the filtering of the NSE.
00146         virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const;
00147 
00148         //- Correct Eddy-Viscosity and related properties
00149         virtual void correct(const tmp<volTensorField>& gradU);
00150 
00151         //- Read LESProperties dictionary
00152         virtual bool read();
00153 };
00154 
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 } // End namespace LESModels
00159 } // End namespace compressible
00160 } // End namespace Foam
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 #endif
00165 
00166 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines