OpenFOAM logo
Open Source CFD Toolkit

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-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     LESmodel
00027 
00028 Description
00029     Base class for all incompressible flow LES SGS models.
00030 
00031     This class defines the basic interface for an incompressible flow SGS model,
00032     and encapsulates data of value to all possible models. In particular
00033     this includes references to all the dependent fields (U, phi),
00034     the physical viscosity nu, and the turbulenceProperties dictionary
00035     which contains the model selection and model coefficients.
00036 
00037 SourceFiles
00038     LESmodel.C
00039     newIsoLESmodel.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef LESmodel_H
00044 #define LESmodel_H
00045 
00046 #include "LESdelta.H"
00047 #include "fvm.H"
00048 #include "fvc.H"
00049 #include "fvMatrices.H"
00050 #include "incompressible/transportModel/transportModel.H"
00051 #include "wallFvPatch.H"
00052 #include "bound.H"
00053 #include "autoPtr.H"
00054 #include "runTimeSelectionTables.H"
00055 
00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00057 
00058 namespace Foam
00059 {
00060 
00061 /*---------------------------------------------------------------------------*\
00062                            Class LESmodel Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 class LESmodel
00066 :
00067     public IOdictionary
00068 {
00069 
00070 protected:
00071 
00072     // Protected data
00073 
00074         const Time& runTime_;
00075         const fvMesh& mesh_;
00076 
00077 
00078 private:
00079 
00080     // Private data
00081 
00082         const volVectorField& U_;
00083         const surfaceScalarField& phi_;
00084 
00085         transportModel& transport_;
00086 
00087         dictionary LESmodelProperties_;
00088 
00089         dimensionedScalar k0_;
00090 
00091         autoPtr<LESdelta> delta_;
00092 
00093 
00094     // Private Member Functions
00095 
00096         // Disallow default bitwise copy construct and assignment
00097         LESmodel(const LESmodel&);
00098         LESmodel& operator=(const LESmodel&);
00099 
00100 
00101 public:
00102 
00103     //- Runtime type information
00104     TypeName("LESmodel");
00105 
00106 
00107     // Declare run-time constructor selection table
00108 
00109         declareRunTimeSelectionTable
00110         (
00111             autoPtr,
00112             LESmodel,
00113             dictionary,
00114             (
00115                 const volVectorField& U,
00116                 const surfaceScalarField& phi,
00117                 transportModel& transport
00118             ),
00119             (U, phi, transport)
00120         );
00121 
00122 
00123     // Constructors
00124 
00125         //- Construct from components
00126         LESmodel
00127         (
00128             const word& type,
00129             const volVectorField& U,
00130             const surfaceScalarField& phi,
00131             transportModel& transport
00132         );
00133 
00134 
00135     // Selectors
00136 
00137         //- Return a reference to the selected LES model
00138         static autoPtr<LESmodel> New
00139         (
00140             const volVectorField& U,
00141             const surfaceScalarField& phi,
00142             transportModel& transport
00143         );
00144 
00145 
00146     // Destructor
00147 
00148         virtual ~LESmodel()
00149         {}
00150 
00151 
00152     // Member Functions
00153 
00154         // Access
00155 
00156             //- Access function to velocity field
00157             inline const volVectorField& U() const
00158             {
00159                 return U_;
00160             }
00161 
00162             //- Access function to flux field
00163             inline const surfaceScalarField& phi() const
00164             {
00165                 return phi_;
00166             }
00167 
00168             //- Access function to incompressible transport model
00169             inline transportModel& transport() const
00170             {
00171                 return transport_;
00172             }
00173 
00174             //- Access the dictionary which provides info. about choice of
00175             //  models, and all related data (particularly model coefficients).
00176             inline const dictionary& LESmodelProperties()
00177             {
00178                 return LESmodelProperties_;
00179             }
00180 
00181             //- Access function to filter width
00182             inline const volScalarField& delta() const
00183             {
00184                 return delta_();
00185             }
00186 
00187             //- Access function to incompressible viscosity
00188             inline const volScalarField& nu() const
00189             {
00190                 return transport_.nu();
00191             }
00192 
00193             //- Return the value of k0 which k is not allowed to be less than
00194             const dimensionedScalar& k0() const
00195             {
00196                 return k0_;
00197             }
00198 
00199             //- Allow k0 to be changed
00200             dimensionedScalar& k0()
00201             {
00202                 return k0_;
00203             }
00204 
00205 
00206         //- Return B.
00207         virtual tmp<volTensorField> B() const = 0;
00208 
00209         //- Return the SGS turbulent kinetic energy.
00210         virtual tmp<volScalarField> k() const = 0;
00211 
00212         //- Return the SGS turbulent dissipation.
00213         virtual tmp<volScalarField> epsilon() const = 0;
00214 
00215         //- Return the SGS viscosity.
00216         virtual tmp<volScalarField> nuSgs() const = 0;
00217 
00218         //- Return the effective viscosity
00219         virtual tmp<volScalarField> nuEff() const
00220         {
00221             return tmp<volScalarField>
00222             (
00223                 new volScalarField("nuEff", nuSgs() + nu())
00224             );
00225         }
00226 
00227         //- Returns div(B).
00228         // This is the additional term due to the filtering of the NSE.
00229         virtual tmp<fvVectorMatrix> divB(volVectorField& U) const = 0;
00230 
00231         //- Correct Eddy-Viscosity and related properties
00232         virtual void correct(const tmp<volTensorField>& gradU);
00233 
00234         //- Correct Eddy-Viscosity and related properties.
00235         //  This calls correct(const tmp<volTensorField>& gradU) by supplying
00236         //  gradU calculated locally.
00237         void correct();
00238 
00239         //- Read turbulenceProperties dictionary
00240         virtual bool read() = 0;
00241 };
00242 
00243 
00244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00245 
00246 } // End namespace Foam
00247 
00248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00249 
00250 #endif
00251 
00252 // ************************************************************************* //
For further information go to www.openfoam.org