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

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