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::incompressible::LESModels
00027 
00028 Description
00029     Namespace for incompressible LES models.
00030 
00031 Class
00032     Foam::incompressible::LESModel
00033 
00034 Description
00035     Base class for all incompressible flow LES SGS models.
00036 
00037     This class defines the basic interface for an incompressible flow SGS
00038     model, and encapsulates data of value to all possible models.
00039     In particular this includes references to all the dependent fields
00040     (U, phi), the physical viscosity nu, and the LESProperties
00041     dictionary, which contains the model selection and model coefficients.
00042 
00043 SourceFiles
00044     LESModel.C
00045 
00046 \*---------------------------------------------------------------------------*/
00047 
00048 #ifndef LESModel_H
00049 #define LESModel_H
00050 
00051 #include "incompressible/turbulenceModel/turbulenceModel.H"
00052 #include "LESdelta.H"
00053 #include "fvm.H"
00054 #include "fvc.H"
00055 #include "fvMatrices.H"
00056 #include "incompressible/transportModel/transportModel.H"
00057 #include "wallFvPatch.H"
00058 #include "bound.H"
00059 #include "autoPtr.H"
00060 #include "runTimeSelectionTables.H"
00061 
00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063 
00064 namespace Foam
00065 {
00066 namespace incompressible
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 volVectorField& U,
00123                 const surfaceScalarField& phi,
00124                 transportModel& lamTransportModel
00125             ),
00126             (U, phi, lamTransportModel)
00127         );
00128 
00129 
00130     // Constructors
00131 
00132         //- Construct from components
00133         LESModel
00134         (
00135             const word& type,
00136             const volVectorField& U,
00137             const surfaceScalarField& phi,
00138             transportModel& lamTransportModel
00139         );
00140 
00141 
00142     // Selectors
00143 
00144         //- Return a reference to the selected LES model
00145         static autoPtr<LESModel> New
00146         (
00147             const volVectorField& U,
00148             const surfaceScalarField& phi,
00149             transportModel& lamTransportModel
00150         );
00151 
00152 
00153     //- Destructor
00154     virtual ~LESModel()
00155     {}
00156 
00157 
00158     // Member Functions
00159 
00160         //- Const access to the coefficients dictionary,
00161         //  which provides info. about choice of models,
00162         //  and all related data (particularly model coefficients).
00163         inline const dictionary& coeffDict() const
00164         {
00165             return coeffDict_;
00166         }
00167 
00168         //- Access function to filter width
00169         inline const volScalarField& delta() const
00170         {
00171             return delta_();
00172         }
00173 
00174         //- Return the value of k0 which k is not allowed to be less than
00175         const dimensionedScalar& k0() const
00176         {
00177             return k0_;
00178         }
00179 
00180         //- Allow k0 to be changed
00181         dimensionedScalar& k0()
00182         {
00183             return k0_;
00184         }
00185 
00186 
00187         //- Return the SGS turbulent kinetic energy.
00188         virtual tmp<volScalarField> k() const = 0;
00189 
00190         //- Return the SGS turbulent dissipation.
00191         virtual tmp<volScalarField> epsilon() const = 0;
00192 
00193         //- Return the SGS viscosity.
00194         virtual tmp<volScalarField> nuSgs() const = 0;
00195 
00196         //- Return the effective viscosity
00197         virtual tmp<volScalarField> nuEff() const
00198         {
00199             return tmp<volScalarField>
00200             (
00201                 new volScalarField("nuEff", nuSgs() + nu())
00202             );
00203         }
00204 
00205         //- Return the sub-grid stress tensor.
00206         virtual tmp<volSymmTensorField> B() const = 0;
00207 
00208         //- Return the deviatoric part of the effective sub-grid
00209         //  turbulence stress tensor including the laminar stress
00210         virtual tmp<volSymmTensorField> devBeff() const = 0;
00211 
00212         //- Returns div(dev(Beff)).
00213         //  This is the additional term due to the filtering of the NSE.
00214         virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const = 0;
00215 
00216 
00217         // RAS compatibility functions for the turbulenceModel base class
00218 
00219             //- Return the turbulence viscosity
00220             virtual tmp<volScalarField> nut() const
00221             {
00222                 return nuSgs();
00223             }
00224 
00225             //- Return the Reynolds stress tensor
00226             virtual tmp<volSymmTensorField> R() const
00227             {
00228                 return B();
00229             }
00230 
00231             //- Return the effective stress tensor including the laminar stress
00232             virtual tmp<volSymmTensorField> devReff() const
00233             {
00234                 return devBeff();
00235             }
00236 
00237             //- Return the source term for the momentum equation
00238             virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const
00239             {
00240                 return divDevBeff(U);
00241             }
00242 
00243 
00244         //- Correct Eddy-Viscosity and related properties.
00245         //  This calls correct(const tmp<volTensorField>& gradU) by supplying
00246         //  gradU calculated locally.
00247         void correct();
00248 
00249         //- Correct Eddy-Viscosity and related properties
00250         virtual void correct(const tmp<volTensorField>& gradU);
00251 
00252         //- Read LESProperties dictionary
00253         virtual bool read() = 0;
00254 };
00255 
00256 
00257 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00258 
00259 } // End namespace incompressible
00260 } // End namespace Foam
00261 
00262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00263 
00264 #endif
00265 
00266 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd