1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::incompressible::turbulenceModels
28 Namespace for incompressible turbulence turbulence models.
31 Foam::incompressible::turbulenceModel
34 Abstract base class for incompressible turbulence models
35 (RAS, LES and laminar).
41 \*---------------------------------------------------------------------------*/
43 #ifndef turbulenceModel_H
44 #define turbulenceModel_H
46 #include "primitiveFieldsFwd.H"
47 #include "volFieldsFwd.H"
48 #include "surfaceFieldsFwd.H"
49 #include "fvMatricesFwd.H"
50 #include "incompressible/transportModel/transportModel.H"
52 #include "runTimeSelectionTables.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 // Forward declarations
62 namespace incompressible
65 /*---------------------------------------------------------------------------*\
66 Class turbulenceModel Declaration
67 \*---------------------------------------------------------------------------*/
81 const volVectorField& U_;
82 const surfaceScalarField& phi_;
84 transportModel& transportModel_;
89 // Private Member Functions
91 //- Disallow default bitwise copy construct
92 turbulenceModel(const turbulenceModel&);
94 //- Disallow default bitwise assignment
95 void operator=(const turbulenceModel&);
100 //- Runtime type information
101 TypeName("turbulenceModel");
104 // Declare run-time New selection table
106 declareRunTimeNewSelectionTable
112 const volVectorField& U,
113 const surfaceScalarField& phi,
114 transportModel& transport,
115 const word& turbulenceModelName
117 (U, phi, transport, turbulenceModelName)
123 //- Construct from components
126 const volVectorField& U,
127 const surfaceScalarField& phi,
128 transportModel& transport,
129 const word& turbulenceModelName = typeName
135 //- Return a reference to the selected turbulence model
136 static autoPtr<turbulenceModel> New
138 const volVectorField& U,
139 const surfaceScalarField& phi,
140 transportModel& transport,
141 const word& turbulenceModelName = typeName
146 virtual ~turbulenceModel()
152 //- Access function to velocity field
153 inline const volVectorField& U() const
158 //- Access function to flux field
159 inline const surfaceScalarField& phi() const
164 //- Access function to incompressible transport model
165 inline transportModel& transport() const
167 return transportModel_;
170 //- Return the laminar viscosity
171 inline tmp<volScalarField> nu() const
173 return transportModel_.nu();
176 //- Return the turbulence viscosity
177 virtual tmp<volScalarField> nut() const = 0;
179 //- Return the effective viscosity
180 virtual tmp<volScalarField> nuEff() const = 0;
182 //- Return the turbulence kinetic energy
183 virtual tmp<volScalarField> k() const = 0;
185 //- Return the turbulence kinetic energy dissipation rate
186 virtual tmp<volScalarField> epsilon() const = 0;
188 //- Return the Reynolds stress tensor
189 virtual tmp<volSymmTensorField> R() const = 0;
191 //- Return the effective stress tensor including the laminar stress
192 virtual tmp<volSymmTensorField> devReff() const = 0;
194 //- Return the source term for the momentum equation
195 virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
197 //- Solve the turbulence equations and correct the turbulence viscosity
198 virtual void correct() = 0;
200 //- Read LESProperties or RASProperties dictionary
201 virtual bool read() = 0;
203 //- Default dummy write function
204 virtual bool writeData(Ostream&) const
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 } // End namespace incompressible
214 } // End namespace Foam
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 // ************************************************************************* //