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

LESModel.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 Namespace
00026     Foam::compressible::LESModels
00027 
00028 Description
00029     Namespace for compressible LES models.
00030 
00031 
00032 Class
00033     Foam::compressible::LESModel
00034 
00035 Description
00036     Base class for all compressible flow LES SGS models.
00037 
00038     This class defines the basic interface for a compressible flow SGS
00039     model, and encapsulates data of value to all possible models.
00040     In particular this includes references to all the dependent fields
00041     (rho, U, phi), the physical viscosity mu, and the LESProperties
00042     dictionary, which contains the model selection and model coefficients.
00043 
00044 SourceFiles
00045     LESModel.C
00046 
00047 \*---------------------------------------------------------------------------*/
00048 
00049 #ifndef compressibleLESModel_H
00050 #define compressibleLESModel_H
00051 
00052 #include "compressible/turbulenceModel/turbulenceModel.H"
00053 #include "LESdelta.H"
00054 #include "fvm.H"
00055 #include "fvc.H"
00056 #include "fvMatrices.H"
00057 #include "basicThermo.H"
00058 #include "bound.H"
00059 #include "autoPtr.H"
00060 #include "runTimeSelectionTables.H"
00061 
00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063 
00064 namespace Foam
00065 {
00066 namespace compressible
00067 {
00068 
00069 /*---------------------------------------------------------------------------*\
00070                            Class LESModel Declaration
00071 \*---------------------------------------------------------------------------*/
00072 
00073 class LESModel
00074 :
00075     public turbulenceModel,
00076     public IOdictionary
00077 {
00078 
00079 protected:
00080 
00081     // Protected data
00082 
00083         Switch printCoeffs_;
00084         dictionary coeffDict_;
00085 
00086         dimensionedScalar k0_;
00087 
00088         autoPtr<LESdelta> delta_;
00089 
00090 
00091     // Protected Member Functions
00092 
00093         //- Print model coefficients
00094         virtual void printCoeffs();
00095 
00096 
00097 private:
00098 
00099     // Private Member Functions
00100 
00101         //- Disallow default bitwise copy construct
00102         LESModel(const LESModel&);
00103 
00104         //- Disallow default bitwise assignment
00105         LESModel& operator=(const LESModel&);
00106 
00107 
00108 public:
00109 
00110     //- Runtime type information
00111     TypeName("LESModel");
00112 
00113 
00114     // Declare run-time constructor selection table
00115 
00116         declareRunTimeSelectionTable
00117         (
00118             autoPtr,
00119             LESModel,
00120             dictionary,
00121             (
00122                 const volScalarField& rho,
00123                 const volVectorField& U,
00124                 const surfaceScalarField& phi,
00125                 const basicThermo& thermoPhysicalModel
00126             ),
00127             (rho, U, phi, thermoPhysicalModel)
00128         );
00129 
00130 
00131     // Constructors
00132 
00133         //- Construct from components
00134         LESModel
00135         (
00136             const word& type,
00137             const volScalarField& rho,
00138             const volVectorField& U,
00139             const surfaceScalarField& phi,
00140             const basicThermo& thermoPhysicalModel
00141         );
00142 
00143 
00144     // Selectors
00145 
00146         //- Return a reference to the selected LES model
00147         static autoPtr<LESModel> New
00148         (
00149             const volScalarField& rho,
00150             const volVectorField& U,
00151             const surfaceScalarField& phi,
00152             const basicThermo& thermoPhysicalModel
00153         );
00154 
00155 
00156     //- Destructor
00157     virtual ~LESModel()
00158     {}
00159 
00160 
00161     // Member Functions
00162 
00163         // Access
00164 
00165             //- Const access to the coefficients dictionary,
00166             //  which provides info. about choice of models,
00167             //  and all related data (particularly model coefficients).
00168             inline const dictionary& coeffDict() const
00169             {
00170                 return coeffDict_;
00171             }
00172 
00173             //- Return the value of k0 which k is not allowed to be less than
00174             const dimensionedScalar& k0() const
00175             {
00176                 return k0_;
00177             }
00178 
00179             //- Allow k0 to be changed
00180             dimensionedScalar& k0()
00181             {
00182                 return k0_;
00183             }
00184 
00185             //- Access function to filter width
00186             inline const volScalarField& delta() const
00187             {
00188                 return delta_();
00189             }
00190 
00191 
00192         //- Return the SGS turbulent kinetic energy.
00193         virtual tmp<volScalarField> k() const = 0;
00194 
00195         //- Return the SGS turbulent dissipation.
00196         virtual tmp<volScalarField> epsilon() const = 0;
00197 
00198         //- Return the SGS turbulent viscosity
00199         virtual tmp<volScalarField> muSgs() const = 0;
00200 
00201         //- Return the effective viscosity
00202         virtual tmp<volScalarField> muEff() const
00203         {
00204             return tmp<volScalarField>
00205             (
00206                 new volScalarField("muEff", muSgs() + mu())
00207             );
00208         }
00209 
00210         //- Return the SGS turbulent thermal diffusivity
00211         virtual tmp<volScalarField> alphaSgs() const = 0;
00212 
00213         //- Return the SGS thermal conductivity.
00214         virtual tmp<volScalarField> alphaEff() const = 0;
00215 
00216         //- Return the sub-grid stress tensor.
00217         virtual tmp<volSymmTensorField> B() const = 0;
00218 
00219         //- Return the deviatoric part of the effective sub-grid
00220         //  turbulence stress tensor including the laminar stress
00221         virtual tmp<volSymmTensorField> devRhoBeff() const = 0;
00222 
00223         //- Returns div(rho*dev(B)).
00224         // This is the additional term due to the filtering of the NSE.
00225         virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const = 0;
00226 
00227 
00228         // RAS compatibility functions for the turbulenceModel base class
00229 
00230             //- Return the turbulence viscosity
00231             virtual tmp<volScalarField> mut() const
00232             {
00233                 return muSgs();
00234             }
00235 
00236             //- Return the turbulence thermal diffusivity
00237             virtual tmp<volScalarField> alphat() const
00238             {
00239                 return alphaSgs();
00240             }
00241 
00242             //- Return the Reynolds stress tensor
00243             virtual tmp<volSymmTensorField> R() const
00244             {
00245                 return B();
00246             }
00247 
00248             //- Return the effective stress tensor including the laminar stress
00249             virtual tmp<volSymmTensorField> devRhoReff() const
00250             {
00251                 return devRhoBeff();
00252             }
00253 
00254             //- Return the source term for the momentum equation
00255             virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const
00256             {
00257                 return divDevRhoBeff(U);
00258             }
00259 
00260 
00261         //- Correct Eddy-Viscosity and related properties.
00262         //  This calls correct(const tmp<volTensorField>& gradU) by supplying
00263         //  gradU calculated locally.
00264         void correct();
00265 
00266         //- Correct Eddy-Viscosity and related properties
00267         virtual void correct(const tmp<volTensorField>& gradU);
00268 
00269         //- Read LESProperties dictionary
00270         virtual bool read() = 0;
00271 };
00272 
00273 
00274 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00275 
00276 } // End namespace compressible
00277 } // End namespace Foam
00278 
00279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00280 
00281 #endif
00282 
00283 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd