kEpsilon.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::RASModels::kEpsilon
29
30Group
31 grpRASTurbulence
32
33Description
34 Standard k-epsilon turbulence model for incompressible and compressible
35 flows including rapid distortion theory (RDT) based compression term.
36
37 Reference:
38 \verbatim
39 Standard model:
40 Launder, B. E., & Spalding, D. B. (1972).
41 Lectures in mathematical models of turbulence.
42
43 Launder, B. E., & Spalding, D. B. (1974).
44 The numerical computation of turbulent flows.
45 Computer methods in applied mechanics and engineering,
46 3(2), 269-289.
47
48 For the RDT-based compression term:
49 El Tahry, S. H. (1983).
50 k-epsilon equation for compressible reciprocating engine flows.
51 Journal of Energy, 7(4), 345-353.
52 \endverbatim
53
54 The default model coefficients are
55 \verbatim
56 kEpsilonCoeffs
57 {
58 Cmu 0.09;
59 C1 1.44;
60 C2 1.92;
61 C3 -0.33;
62 sigmak 1.0;
63 sigmaEps 1.3;
64 }
65 \endverbatim
66
67SourceFiles
68 kEpsilon.C
69
70\*---------------------------------------------------------------------------*/
71
72#ifndef kEpsilon_H
73#define kEpsilon_H
74
75#include "RASModel.H"
76#include "eddyViscosity.H"
77
78// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79
80namespace Foam
81{
82namespace RASModels
83{
84
85/*---------------------------------------------------------------------------*\
86 Class kEpsilon Declaration
87\*---------------------------------------------------------------------------*/
88
89template<class BasicTurbulenceModel>
90class kEpsilon
91:
92 public eddyViscosity<RASModel<BasicTurbulenceModel>>
93{
94 // Private Member Functions
95
96 //- No copy construct
97 kEpsilon(const kEpsilon&) = delete;
98
99 //- No copy assignment
100 void operator=(const kEpsilon&) = delete;
101
102
103protected:
104
105 // Protected data
106
107 // Model coefficients
115
116 // Fields
120
121
122 // Protected Member Functions
123
124 virtual void correctNut();
125 virtual tmp<fvScalarMatrix> kSource() const;
126 virtual tmp<fvScalarMatrix> epsilonSource() const;
127
128
129public:
131 typedef typename BasicTurbulenceModel::alphaField alphaField;
132 typedef typename BasicTurbulenceModel::rhoField rhoField;
133 typedef typename BasicTurbulenceModel::transportModel transportModel;
134
135
136 //- Runtime type information
137 TypeName("kEpsilon");
138
139
140 // Constructors
141
142 //- Construct from components
144 (
145 const alphaField& alpha,
146 const rhoField& rho,
147 const volVectorField& U,
148 const surfaceScalarField& alphaRhoPhi,
149 const surfaceScalarField& phi,
150 const transportModel& transport,
151 const word& propertiesName = turbulenceModel::propertiesName,
152 const word& type = typeName
153 );
154
155
156 //- Destructor
157 virtual ~kEpsilon() = default;
158
159
160 // Member Functions
161
162 //- Re-read model coefficients if they have changed
163 virtual bool read();
164
165 //- Return the effective diffusivity for k
167 {
169 (
171 (
172 "DkEff",
173 (this->nut_/sigmak_ + this->nu())
174 )
175 );
176 }
177
178 //- Return the effective diffusivity for epsilon
180 {
182 (
184 (
185 "DepsilonEff",
186 (this->nut_/sigmaEps_ + this->nu())
187 )
188 );
189 }
190
191 //- Return the turbulence kinetic energy
192 virtual tmp<volScalarField> k() const
193 {
194 return k_;
195 }
196
197 //- Return the turbulence kinetic energy dissipation rate
198 virtual tmp<volScalarField> epsilon() const
199 {
200 return epsilon_;
201 }
202
203 //- Solve the turbulence equations and correct the turbulence viscosity
204 virtual void correct();
205};
206
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace RASModels
211} // End namespace Foam
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#ifdef NoRepository
216 #include "kEpsilon.C"
217#endif
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
surfaceScalarField & phi
Standard k-epsilon turbulence model for incompressible and compressible flows including rapid distort...
Definition: kEpsilon.H:92
volScalarField epsilon_
Definition: kEpsilon.H:118
BasicTurbulenceModel::alphaField alphaField
Definition: kEpsilon.H:130
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: kEpsilon.C:69
dimensionedScalar sigmak_
Definition: kEpsilon.H:112
BasicTurbulenceModel::rhoField rhoField
Definition: kEpsilon.H:131
volScalarField k_
Definition: kEpsilon.H:117
dimensionedScalar C1_
Definition: kEpsilon.H:109
dimensionedScalar sigmaEps_
Definition: kEpsilon.H:113
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kEpsilon.C:222
virtual ~kEpsilon()=default
Destructor.
dimensionedScalar C2_
Definition: kEpsilon.H:110
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: kEpsilon.H:178
virtual void correctNut()
Definition: kEpsilon.C:43
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEpsilon.C:54
BasicTurbulenceModel::transportModel transportModel
Definition: kEpsilon.H:132
dimensionedScalar Cmu_
Definition: kEpsilon.H:108
TypeName("kEpsilon")
Runtime type information.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilon.H:191
dimensionedScalar C3_
Definition: kEpsilon.H:111
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilon.H:197
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kEpsilon.C:203
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilon.H:165
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:58
A class for managing temporary objects.
Definition: tmp.H:65
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
volScalarField & nu
volScalarField & alpha
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73