1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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::compressible::turbulenceModels
28 Namespace for compressible turbulence turbulence models.
32 Foam::compressible::turbulenceModel
35 Abstract base class for compressible turbulence models
36 (RAS, LES and laminar).
42 \*---------------------------------------------------------------------------*/
44 #ifndef compressibleturbulenceModel_H
45 #define compressibleturbulenceModel_H
47 #include "primitiveFieldsFwd.H"
48 #include "volFieldsFwd.H"
49 #include "surfaceFieldsFwd.H"
50 #include "fvMatricesFwd.H"
51 #include "basicThermo.H"
53 #include "runTimeSelectionTables.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 // Forward declarations
63 namespace compressible
66 /*---------------------------------------------------------------------------*\
67 Class turbulenceModel Declaration
68 \*---------------------------------------------------------------------------*/
82 const volScalarField& rho_;
83 const volVectorField& U_;
84 const surfaceScalarField& phi_;
86 const basicThermo& thermophysicalModel_;
91 // Private Member Functions
93 //- Disallow default bitwise copy construct
94 turbulenceModel(const turbulenceModel&);
96 //- Disallow default bitwise assignment
97 void operator=(const turbulenceModel&);
102 //- Runtime type information
103 TypeName("turbulenceModel");
106 // Declare run-time constructor selection table
108 declareRunTimeNewSelectionTable
114 const volScalarField& rho,
115 const volVectorField& U,
116 const surfaceScalarField& phi,
117 const basicThermo& thermoPhysicalModel,
118 const word& turbulenceModelName
120 (rho, U, phi, thermoPhysicalModel, turbulenceModelName)
126 //- Construct from components
129 const volScalarField& rho,
130 const volVectorField& U,
131 const surfaceScalarField& phi,
132 const basicThermo& thermoPhysicalModel,
133 const word& turbulenceModelName = typeName
139 //- Return a reference to the selected turbulence model
140 static autoPtr<turbulenceModel> New
142 const volScalarField& rho,
143 const volVectorField& U,
144 const surfaceScalarField& phi,
145 const basicThermo& thermoPhysicalModel,
146 const word& turbulenceModelName = typeName
151 virtual ~turbulenceModel()
157 //- Access function to density field
158 const volScalarField& rho() const
163 //- Access function to velocity field
164 const volVectorField& U() const
169 //- Access function to flux field
170 const surfaceScalarField& phi() const
175 //- Access function to thermophysical model
176 const basicThermo& thermo() const
178 return thermophysicalModel_;
181 //- Return the laminar viscosity
182 const volScalarField& mu() const
184 return thermophysicalModel_.mu();
187 //- Return the laminar thermal conductivity
188 const volScalarField& alpha() const
190 return thermophysicalModel_.alpha();
193 //- Return the turbulence viscosity
194 virtual tmp<volScalarField> mut() const = 0;
196 //- Return the effective viscosity
197 virtual tmp<volScalarField> muEff() const = 0;
199 //- Return the turbulence thermal diffusivity
200 virtual tmp<volScalarField> alphat() const = 0;
202 //- Return the effective turbulence thermal diffusivity
203 virtual tmp<volScalarField> alphaEff() const = 0;
205 //- Return the effective turbulence thermal diffusivity for a patch
206 virtual tmp<scalarField> alphaEff(const label patchI) const = 0;
208 //- Return the turbulence kinetic energy
209 virtual tmp<volScalarField> k() const = 0;
211 //- Return the turbulence kinetic energy dissipation rate
212 virtual tmp<volScalarField> epsilon() const = 0;
214 //- Return the laminar+turbulence kinetic energy dissipation rate
215 // Used as the viscous contribution to the energy equations
216 virtual tmp<volScalarField> rhoEpsilonEff() const;
218 //- Return the Reynolds stress tensor
219 virtual tmp<volSymmTensorField> R() const = 0;
221 //- Return the effective stress tensor including the laminar stress
222 virtual tmp<volSymmTensorField> devRhoReff() const = 0;
224 //- Return the source term for the momentum equation
225 virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0;
227 //- Solve the turbulence equations and correct the turbulence viscosity
228 virtual void correct() = 0;
230 //- Read LESProperties or RASProperties dictionary
231 virtual bool read() = 0;
233 //- Default dummy write function
234 virtual bool writeData(Ostream&) const
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 } // End namespace compressible
245 } // End namespace Foam
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 // ************************************************************************* //