1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-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::RASModels
28 Namespace for compressible RAS turbulence models.
32 Foam::compressible::RASModel
35 Abstract base class for turbulence models for compressible and combusting
42 \*---------------------------------------------------------------------------*/
44 #ifndef compressibleRASModel_H
45 #define compressibleRASModel_H
47 #include "compressible/turbulenceModel/turbulenceModel.H"
48 #include "volFields.H"
49 #include "surfaceFields.H"
50 #include "nearWallDist.H"
53 #include "fvMatrices.H"
54 #include "basicThermo.H"
55 #include "IOdictionary.H"
59 #include "runTimeSelectionTables.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 namespace compressible
68 /*---------------------------------------------------------------------------*\
69 Class RASModel Declaration
70 \*---------------------------------------------------------------------------*/
74 public turbulenceModel,
82 //- Turbulence on/off flag
85 //- Flag to print the model coeffs at run-time
88 //- Model coefficients dictionary
89 dictionary coeffDict_;
91 //- Value of y+ at the edge of the laminar sublayer
95 dimensionedScalar k0_;
97 //- Lower limit of epsilon
98 dimensionedScalar epsilon0_;
100 //- Small epsilon value used to avoid divide by zero
101 dimensionedScalar epsilonSmall_;
103 //- Lower limit for omega
104 dimensionedScalar omega0_;
106 //- Small omega value used to avoid divide by zero
107 dimensionedScalar omegaSmall_;
109 //- Near wall distance boundary field
113 // Protected member functions
115 //- Print model coefficients
116 virtual void printCoeffs();
121 // Private Member Functions
123 //- Disallow default bitwise copy construct
124 RASModel(const RASModel&);
126 //- Disallow default bitwise assignment
127 void operator=(const RASModel&);
132 //- Runtime type information
133 TypeName("RASModel");
136 // Declare run-time constructor selection table
138 declareRunTimeSelectionTable
144 const volScalarField& rho,
145 const volVectorField& U,
146 const surfaceScalarField& phi,
147 const basicThermo& thermoPhysicalModel
149 (rho, U, phi, thermoPhysicalModel)
155 //- Construct from components
159 const volScalarField& rho,
160 const volVectorField& U,
161 const surfaceScalarField& phi,
162 const basicThermo& thermoPhysicalModel
168 //- Return a reference to the selected turbulence model
169 static autoPtr<RASModel> New
171 const volScalarField& rho,
172 const volVectorField& U,
173 const surfaceScalarField& phi,
174 const basicThermo& thermoPhysicalModel
187 //- Return the value of k0 which k is not allowed to be less than
188 const dimensionedScalar& k0() const
193 //- Return the value of epsilon0 which epsilon is not allowed to be
195 const dimensionedScalar& epsilon0() const
200 //- Return the value of epsilonSmall which is added to epsilon when
202 const dimensionedScalar& epsilonSmall() const
204 return epsilonSmall_;
207 //- Return the value of omega0 which epsilon is not allowed to be
209 const dimensionedScalar& omega0() const
214 //- Return the value of omegaSmall which is added to epsilon when
216 const dimensionedScalar& omegaSmall() const
221 //- Allow k0 to be changed
222 dimensionedScalar& k0()
227 //- Allow epsilon0 to be changed
228 dimensionedScalar& epsilon0()
233 //- Allow epsilonSmall to be changed
234 dimensionedScalar& epsilonSmall()
236 return epsilonSmall_;
239 //- Allow omega0 to be changed
240 dimensionedScalar& omega0()
245 //- Allow omegaSmall to be changed
246 dimensionedScalar& omegaSmall()
251 //- Return the near wall distances
252 const nearWallDist& y() const
257 //- Calculate y+ at the edge of the laminar sublayer
258 scalar yPlusLam(const scalar kappa, const scalar E) const;
260 //- Const access to the coefficients dictionary
261 const dictionary& coeffDict() const
267 //- Return the turbulence viscosity
268 virtual tmp<volScalarField> mut() const = 0;
270 //- Return the effective viscosity
271 virtual tmp<volScalarField> muEff() const
273 return tmp<volScalarField>
275 new volScalarField("muEff", mut() + mu())
279 //- Return the effective turbulent thermal diffusivity
280 virtual tmp<volScalarField> alphaEff() const = 0;
282 //- Return the turbulence kinetic energy
283 virtual tmp<volScalarField> k() const = 0;
285 //- Return the turbulence kinetic energy dissipation rate
286 virtual tmp<volScalarField> epsilon() const = 0;
288 //- Return the Reynolds stress tensor
289 virtual tmp<volSymmTensorField> R() const = 0;
291 //- Return the effective stress tensor including the laminar stress
292 virtual tmp<volSymmTensorField> devRhoReff() const = 0;
294 //- Return the source term for the momentum equation
295 virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0;
297 //- Return yPlus for the given patch
298 virtual tmp<scalarField> yPlus
304 //- Solve the turbulence equations and correct the turbulence viscosity
305 virtual void correct() = 0;
307 //- Read RASProperties dictionary
308 virtual bool read() = 0;
312 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
314 } // End namespace compressible
315 } // End namespace Foam
317 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
321 // ************************************************************************* //