OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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