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::RASModels
28 Namespace for incompressible RAS turbulence models.
31 Foam::incompressible::RASModel
34 Abstract base class for incompressible turbulence models.
39 \*---------------------------------------------------------------------------*/
44 #include "incompressible/turbulenceModel/turbulenceModel.H"
45 #include "volFields.H"
46 #include "surfaceFields.H"
47 #include "nearWallDist.H"
50 #include "fvMatrices.H"
51 #include "incompressible/transportModel/transportModel.H"
52 #include "IOdictionary.H"
56 #include "runTimeSelectionTables.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 namespace incompressible
65 /*---------------------------------------------------------------------------*\
66 Class RASModel Declaration
67 \*---------------------------------------------------------------------------*/
71 public turbulenceModel,
79 //- Turbulence on/off flag
82 //- Flag to print the model coeffs at run-time
85 //- Model coefficients dictionary
86 dictionary coeffDict_;
89 dimensionedScalar kMin_;
91 //- Lower limit of epsilon
92 dimensionedScalar epsilonMin_;
94 //- Lower limit for omega
95 dimensionedScalar omegaMin_;
97 //- Near wall distance boundary field
101 // Protected Member Functions
103 //- Print model coefficients
104 virtual void printCoeffs();
109 // Private Member Functions
111 //- Disallow default bitwise copy construct
112 RASModel(const RASModel&);
114 //- Disallow default bitwise assignment
115 void operator=(const RASModel&);
120 //- Runtime type information
121 TypeName("RASModel");
124 // Declare run-time constructor selection table
126 declareRunTimeSelectionTable
132 const volVectorField& U,
133 const surfaceScalarField& phi,
134 transportModel& transport,
135 const word& turbulenceModelName
137 (U, phi, transport, turbulenceModelName)
143 //- Construct from components
147 const volVectorField& U,
148 const surfaceScalarField& phi,
149 transportModel& transport,
150 const word& turbulenceModelName = turbulenceModel::typeName
156 //- Return a reference to the selected RAS model
157 static autoPtr<RASModel> New
159 const volVectorField& U,
160 const surfaceScalarField& phi,
161 transportModel& transport,
162 const word& turbulenceModelName = turbulenceModel::typeName
175 //- Return the lower allowable limit for k (default: SMALL)
176 const dimensionedScalar& kMin() const
181 //- Return the lower allowable limit for epsilon (default: SMALL)
182 const dimensionedScalar& epsilonMin() const
187 //- Return the lower allowable limit for omega (default: SMALL)
188 const dimensionedScalar& omegaMin() const
193 //- Allow kMin to be changed
194 dimensionedScalar& kMin()
199 //- Allow epsilonMin to be changed
200 dimensionedScalar& epsilonMin()
205 //- Allow omegaMin to be changed
206 dimensionedScalar& omegaMin()
211 //- Return the near wall distances
212 const nearWallDist& y() const
217 //- Calculate y+ at the edge of the laminar sublayer
218 scalar yPlusLam(const scalar kappa, const scalar E) const;
220 //- Const access to the coefficients dictionary
221 const dictionary& coeffDict() const
227 //- Return the effective viscosity
228 virtual tmp<volScalarField> nuEff() const
230 return tmp<volScalarField>
232 new volScalarField("nuEff", nut() + nu())
236 //- Return yPlus for the given patch
237 virtual tmp<scalarField> yPlus
243 //- Solve the turbulence equations and correct the turbulence viscosity
244 virtual void correct();
246 //- Read RASProperties dictionary
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 } // End namespace incompressible
254 } // End namespace Foam
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 // ************************************************************************* //