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

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