Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / turbulenceModels / incompressible / turbulenceModel / turbulenceModel.H
blob30952175f67e4f487cbbf0c41b6a74e933f93e41
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Namespace
25     Foam::incompressible::turbulenceModels
27 Description
28     Namespace for incompressible turbulence turbulence models.
30 Class
31     Foam::incompressible::turbulenceModel
33 Description
34     Abstract base class for incompressible turbulence models
35     (RAS, LES and laminar).
37 SourceFiles
38     turbulenceModel.C
39     newTurbulenceModel.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef turbulenceModel_H
44 #define turbulenceModel_H
46 #include "objectRegistry.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 #ifndef SWIG
106         declareRunTimeNewSelectionTable
107         (
108             autoPtr,
109             turbulenceModel,
110             turbulenceModel,
111             (
112                 const volVectorField& U,
113                 const surfaceScalarField& phi,
114                 transportModel& lamTransportModel
115             ),
116             (U, phi, lamTransportModel)
117         );
118 #endif
121     // Constructors
123         //- Construct from components
124         turbulenceModel
125         (
126             const volVectorField& U,
127             const surfaceScalarField& phi,
128             transportModel& lamTransportModel
129         );
132     // Selectors
134         //- Return a reference to the selected turbulence model
135         static autoPtr<incompressible::turbulenceModel> New
136         (
137             const volVectorField& U,
138             const surfaceScalarField& phi,
139             transportModel& lamTransportModel
140         );
143     // Destructor
145         virtual ~turbulenceModel()
146         {}
149     // Member Functions
151         //- Access function to velocity field
152         inline const volVectorField& U() const
153         {
154             return U_;
155         }
157         //- Access function to flux field
158         inline const surfaceScalarField& phi() const
159         {
160             return phi_;
161         }
163         //- Access function to incompressible transport model
164         inline transportModel& transport() const
165         {
166             return transportModel_;
167         }
169         //- Return the laminar viscosity
170         const volScalarField& nu() const
171         {
172             return transportModel_.nu();
173         }
175         //- Return the turbulence viscosity
176         virtual tmp<volScalarField> nut() const = 0;
178         //- Return the effective viscosity
179         virtual tmp<volScalarField> nuEff() const = 0;
181         //- Return the turbulence kinetic energy
182         virtual tmp<volScalarField> k() const = 0;
184         //- Return the turbulence kinetic energy dissipation rate
185         virtual tmp<volScalarField> epsilon() const = 0;
187         //- Return the Reynolds stress tensor
188         virtual tmp<volSymmTensorField> R() const = 0;
190         //- Return the effective stress tensor including the laminar stress
191         virtual tmp<volSymmTensorField> devReff() const = 0;
193         //- Return the source term for the momentum equation
194         virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
196         //- Solve the turbulence equations and correct the turbulence viscosity
197         virtual void correct() = 0;
199         //- Read turbulenceProperties dictionary
200         virtual bool read() = 0;
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace incompressible
207 } // End namespace Foam
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 #endif
213 // ************************************************************************* //