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