initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / turbulenceModel / turbulenceModel.H
blob1474e5dfa340d81dded04e06344410e9c7482e82
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Namespace
26     Foam::incompressible::turbulenceModels
28 Description
29     Namespace for incompressible turbulence turbulence models.
31 Class
32     Foam::incompressible::turbulenceModel
34 Description
35     Abstract base class for incompressible turbulence models
36     (RAS, LES and laminar).
38 SourceFiles
39     turbulenceModel.C
40     newTurbulenceModel.C
42 \*---------------------------------------------------------------------------*/
44 #ifndef turbulenceModel_H
45 #define turbulenceModel_H
47 #include "primitiveFieldsFwd.H"
48 #include "volFieldsFwd.H"
49 #include "surfaceFieldsFwd.H"
50 #include "fvMatricesFwd.H"
51 #include "incompressible/transportModel/transportModel.H"
52 #include "autoPtr.H"
53 #include "runTimeSelectionTables.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 namespace Foam
60 // Forward declarations
61 class fvMesh;
63 namespace incompressible
66 /*---------------------------------------------------------------------------*\
67                            Class turbulenceModel Declaration
68 \*---------------------------------------------------------------------------*/
70 class turbulenceModel
73 protected:
75     // Protected data
77         const Time& runTime_;
78         const fvMesh& mesh_;
80         const volVectorField& U_;
81         const surfaceScalarField& phi_;
83         transportModel& transportModel_;
86 private:
88     // Private Member Functions
90         //- Disallow default bitwise copy construct
91         turbulenceModel(const turbulenceModel&);
93         //- Disallow default bitwise assignment
94         void operator=(const turbulenceModel&);
97 public:
99     //- Runtime type information
100     TypeName("turbulenceModel");
103     // Declare run-time New selection table
105         declareRunTimeNewSelectionTable
106         (
107             autoPtr,
108             turbulenceModel,
109             turbulenceModel,
110             (
111                 const volVectorField& U,
112                 const surfaceScalarField& phi,
113                 transportModel& lamTransportModel
114             ),
115             (U, phi, lamTransportModel)
116         );
119     // Constructors
121         //- Construct from components
122         turbulenceModel
123         (
124             const volVectorField& U,
125             const surfaceScalarField& phi,
126             transportModel& lamTransportModel
127         );
130     // Selectors
132         //- Return a reference to the selected turbulence model
133         static autoPtr<turbulenceModel> New
134         (
135             const volVectorField& U,
136             const surfaceScalarField& phi,
137             transportModel& lamTransportModel
138         );
141     //- Destructor
142     virtual ~turbulenceModel()
143     {}
146     // Member Functions
148         //- Access function to velocity field
149         inline const volVectorField& U() const
150         {
151             return U_;
152         }
154         //- Access function to flux field
155         inline const surfaceScalarField& phi() const
156         {
157             return phi_;
158         }
160         //- Access function to incompressible transport model
161         inline transportModel& transport() const
162         {
163             return transportModel_;
164         }
166         //- Return the laminar viscosity
167         const volScalarField& nu() const
168         {
169             return transportModel_.nu();
170         }
172         //- Return the turbulence viscosity
173         virtual tmp<volScalarField> nut() const = 0;
175         //- Return the effective viscosity
176         virtual tmp<volScalarField> nuEff() const = 0;
178         //- Return the turbulence kinetic energy
179         virtual tmp<volScalarField> k() const = 0;
181         //- Return the turbulence kinetic energy dissipation rate
182         virtual tmp<volScalarField> epsilon() const = 0;
184         //- Return the Reynolds stress tensor
185         virtual tmp<volSymmTensorField> R() const = 0;
187         //- Return the effective stress tensor including the laminar stress
188         virtual tmp<volSymmTensorField> devReff() const = 0;
190         //- Return the source term for the momentum equation
191         virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
193         //- Solve the turbulence equations and correct the turbulence viscosity
194         virtual void correct() = 0;
196         //- Read turbulenceProperties dictionary
197         virtual bool read() = 0;
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace incompressible
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #endif
210 // ************************************************************************* //