OpenFOAM logo
Open Source CFD Toolkit

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-2005 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 2 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     GenEddyVisc
00027 
00028 Description
00029     General base class for all models that can be implemented as
00030     an eddy viscosity, i.e. algebraic and one-equation models.
00031 
00032     Contains fields for k (SGS turbulent kinetic energy), gamma
00033     (modelled viscosity) and epsilon (SGS dissipation).
00034 
00035 SourceFiles
00036     GenEddyVisc.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef compressibleGenEddyVisc_H
00041 #define compressibleGenEddyVisc_H
00042 
00043 #include "LESmodel.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 namespace compressible
00050 {
00051 namespace LESmodels
00052 {
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class GenEddyVisc Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class GenEddyVisc
00059 :
00060     virtual public LESmodel
00061 {
00062     // Private Member Functions
00063 
00064         // Disallow default bitwise copy construct and assignment
00065         GenEddyVisc(const GenEddyVisc&);
00066         GenEddyVisc& operator=(const GenEddyVisc&);
00067 
00068 
00069 protected:
00070 
00071         dimensionedScalar ce_;
00072 
00073         volScalarField k_;
00074         volScalarField muSgs_;
00075 
00076 
00077 public:
00078 
00079     // Constructors
00080 
00081         //- Construct from components
00082         GenEddyVisc
00083         (
00084             const volScalarField& rho,
00085             const volVectorField& U,
00086             const surfaceScalarField& phi,
00087             const basicThermo& thermoPhysicalModel
00088         );
00089 
00090 
00091     // Destructor
00092 
00093         virtual ~GenEddyVisc()
00094         {}
00095 
00096 
00097     // Member Functions
00098 
00099         //- Evaluate B. This is done on the fly : its not usually necessary,
00100         //  but will be if we want to compare with experiments or DNS
00101         virtual tmp<volTensorField> B() const;
00102 
00103         //- Return SGS kinetic energy
00104         virtual tmp<volScalarField> k() const
00105         {
00106             return k_;
00107         }
00108 
00109         //- Return sub-grid disipation rate
00110         virtual tmp<volScalarField> epsilon() const
00111         {
00112             return ce_*k_*sqrt(k_)/delta();
00113         }
00114 
00115         //- Return viscosity
00116         virtual tmp<volScalarField> muSgs() const
00117         {
00118             return muSgs_;
00119         }
00120 
00121         //- Return thermal conductivity
00122         virtual tmp<volScalarField> alphaEff() const
00123         {
00124             return tmp<volScalarField>
00125             (
00126                 new volScalarField("alphaEff", muSgs_ + alpha())
00127             );
00128         }
00129 
00130         //- Returns divergence of B : i.e. the additional term in the
00131         //  filtered NSE.
00132         virtual tmp<fvVectorMatrix> divRhoB(volVectorField& U) const;
00133 
00134         //- Correct Eddy-Viscosity and related properties
00135         virtual void correct(const tmp<volTensorField>& gradU);
00136 
00137         //- Read turbulenceProperties dictionary
00138         bool read();
00139 };
00140 
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 } // End namespace LESmodels
00145 } // End namespace compressible
00146 } // End namespace Foam
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 #endif
00151 
00152 // ************************************************************************* //
For further information go to www.openfoam.org