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