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

turbulenceModel.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::turbulenceModels
00027 
00028 Description
00029     Namespace for compressible turbulence turbulence models.
00030 
00031 
00032 Class
00033     Foam::compressible::turbulenceModel
00034 
00035 Description
00036     Abstract base class for compressible turbulence models
00037     (RAS, LES and laminar).
00038 
00039 
00040 SourceFiles
00041     turbulenceModel.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef compressibleturbulenceModel_H
00046 #define compressibleturbulenceModel_H
00047 
00048 #include "primitiveFieldsFwd.H"
00049 #include "volFieldsFwd.H"
00050 #include "surfaceFieldsFwd.H"
00051 #include "fvMatricesFwd.H"
00052 #include "basicThermo.H"
00053 #include "autoPtr.H"
00054 #include "runTimeSelectionTables.H"
00055 
00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00057 
00058 namespace Foam
00059 {
00060 
00061 // Forward declarations
00062 class fvMesh;
00063 
00064 namespace compressible
00065 {
00066 
00067 /*---------------------------------------------------------------------------*\
00068                        Class turbulenceModel Declaration
00069 \*---------------------------------------------------------------------------*/
00070 
00071 class turbulenceModel
00072 {
00073 
00074 protected:
00075 
00076     // Protected data
00077 
00078         const Time& runTime_;
00079         const fvMesh& mesh_;
00080 
00081         const volScalarField& rho_;
00082         const volVectorField& U_;
00083         const surfaceScalarField& phi_;
00084 
00085         const basicThermo& thermophysicalModel_;
00086 
00087 
00088 private:
00089 
00090     // Private Member Functions
00091 
00092         //- Disallow default bitwise copy construct
00093         turbulenceModel(const turbulenceModel&);
00094 
00095         //- Disallow default bitwise assignment
00096         void operator=(const turbulenceModel&);
00097 
00098 
00099 public:
00100 
00101     //- Runtime type information
00102     TypeName("turbulenceModel");
00103 
00104 
00105     // Declare run-time constructor selection table
00106 
00107         declareRunTimeNewSelectionTable
00108         (
00109             autoPtr,
00110             turbulenceModel,
00111             turbulenceModel,
00112             (
00113                 const volScalarField& rho,
00114                 const volVectorField& U,
00115                 const surfaceScalarField& phi,
00116                 const basicThermo& thermoPhysicalModel
00117             ),
00118             (rho, U, phi, thermoPhysicalModel)
00119         );
00120 
00121 
00122     // Constructors
00123 
00124         //- Construct from components
00125         turbulenceModel
00126         (
00127             const volScalarField& rho,
00128             const volVectorField& U,
00129             const surfaceScalarField& phi,
00130             const basicThermo& thermoPhysicalModel
00131         );
00132 
00133 
00134     // Selectors
00135 
00136         //- Return a reference to the selected turbulence model
00137         static autoPtr<turbulenceModel> New
00138         (
00139             const volScalarField& rho,
00140             const volVectorField& U,
00141             const surfaceScalarField& phi,
00142             const basicThermo& thermoPhysicalModel
00143         );
00144 
00145 
00146     //- Destructor
00147     virtual ~turbulenceModel()
00148     {}
00149 
00150 
00151     // Member Functions
00152 
00153         //- Access function to density field
00154         const volScalarField& rho() const
00155         {
00156             return rho_;
00157         }
00158 
00159         //- Access function to velocity field
00160         const volVectorField& U() const
00161         {
00162             return U_;
00163         }
00164 
00165         //- Access function to flux field
00166         const surfaceScalarField& phi() const
00167         {
00168             return phi_;
00169         }
00170 
00171         //- Access function to thermophysical model
00172         const basicThermo& thermo() const
00173         {
00174              return thermophysicalModel_;
00175         }
00176 
00177         //- Return the laminar viscosity
00178         const volScalarField& mu() const
00179         {
00180             return thermophysicalModel_.mu();
00181         }
00182 
00183         //- Return the laminar thermal conductivity
00184         const volScalarField& alpha() const
00185         {
00186             return thermophysicalModel_.alpha();
00187         }
00188 
00189         //- Return the turbulence viscosity
00190         virtual tmp<volScalarField> mut() const = 0;
00191 
00192         //- Return the effective viscosity
00193         virtual tmp<volScalarField> muEff() const = 0;
00194 
00195         //- Return the effective turbulent thermal diffusivity
00196         virtual tmp<volScalarField> alphaEff() const = 0;
00197 
00198         //- Return the turbulence kinetic energy
00199         virtual tmp<volScalarField> k() const = 0;
00200 
00201         //- Return the turbulence kinetic energy dissipation rate
00202         virtual tmp<volScalarField> epsilon() const = 0;
00203 
00204         //- Return the Reynolds stress tensor
00205         virtual tmp<volSymmTensorField> R() const = 0;
00206 
00207         //- Return the effective stress tensor including the laminar stress
00208         virtual tmp<volSymmTensorField> devRhoReff() const = 0;
00209 
00210         //- Return the source term for the momentum equation
00211         virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0;
00212 
00213         //- Solve the turbulence equations and correct the turbulence viscosity
00214         virtual void correct() = 0;
00215 
00216         //- Read turbulenceProperties dictionary
00217         virtual bool read() = 0;
00218 };
00219 
00220 
00221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00222 
00223 } // End namespace compressible
00224 } // End namespace Foam
00225 
00226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00227 
00228 #endif
00229 
00230 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd