kEpsilon.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::RASModels::kEpsilon
26 
27 Description
28  Standard k-epsilon turbulence model for incompressible and compressible
29  flows including rapid distortion theory (RDT) based compression term.
30 
31  Reference:
32  \verbatim
33  Standard model:
34  Launder, B. E., & Spalding, D. B. (1972).
35  Lectures in mathematical models of turbulence.
36 
37  Launder, B. E., & Spalding, D. B. (1974).
38  The numerical computation of turbulent flows.
39  Computer methods in applied mechanics and engineering,
40  3(2), 269-289.
41 
42  For the RDT-based compression term:
43  El Tahry, S. H. (1983).
44  k-epsilon equation for compressible reciprocating engine flows.
45  Journal of Energy, 7(4), 345-353.
46  \endverbatim
47 
48  The default model coefficients are
49  \verbatim
50  kEpsilonCoeffs
51  {
52  Cmu 0.09;
53  C1 1.44;
54  C2 1.92;
55  C3 -0.33;
56  sigmak 1.0;
57  sigmaEps 1.3;
58  }
59  \endverbatim
60 
61 SourceFiles
62  kEpsilon.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef kEpsilon_H
67 #define kEpsilon_H
68 
69 #include "RASModel.H"
70 #include "eddyViscosity.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 namespace RASModels
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class kEpsilon Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<class BasicMomentumTransportModel>
84 class kEpsilon
85 :
86  public eddyViscosity<RASModel<BasicMomentumTransportModel>>
87 {
88 protected:
89 
90  // Protected data
91 
92  // Model coefficients
93 
100 
101  // Fields
105 
106 
107  // Protected Member Functions
108 
109  virtual void correctNut();
110  virtual tmp<fvScalarMatrix> kSource() const;
111  virtual tmp<fvScalarMatrix> epsilonSource() const;
112 
113 
114 public:
116  typedef typename BasicMomentumTransportModel::alphaField alphaField;
117  typedef typename BasicMomentumTransportModel::rhoField rhoField;
118  typedef typename BasicMomentumTransportModel::transportModel transportModel;
119 
120 
121  //- Runtime type information
122  TypeName("kEpsilon");
123 
124 
125  // Constructors
126 
127  //- Construct from components
128  kEpsilon
129  (
130  const alphaField& alpha,
131  const rhoField& rho,
132  const volVectorField& U,
133  const surfaceScalarField& alphaRhoPhi,
134  const surfaceScalarField& phi,
135  const transportModel& transport,
136  const word& type = typeName
137  );
138 
139  //- Disallow default bitwise copy construction
140  kEpsilon(const kEpsilon&) = delete;
141 
142 
143  //- Destructor
144  virtual ~kEpsilon()
145  {}
146 
147 
148  // Member Functions
149 
150  //- Re-read model coefficients if they have changed
151  virtual bool read();
152 
153  //- Return the effective diffusivity for k
154  tmp<volScalarField> DkEff() const
155  {
156  return volScalarField::New
157  (
158  "DkEff",
159  (this->nut_/sigmak_ + this->nu())
160  );
161  }
162 
163  //- Return the effective diffusivity for epsilon
165  {
166  return volScalarField::New
167  (
168  "DepsilonEff",
169  (this->nut_/sigmaEps_ + this->nu())
170  );
171  }
172 
173  //- Return the turbulence kinetic energy
174  virtual tmp<volScalarField> k() const
175  {
176  return k_;
177  }
178 
179  //- Return the turbulence kinetic energy dissipation rate
180  virtual tmp<volScalarField> epsilon() const
181  {
182  return epsilon_;
183  }
184 
185  //- Solve the turbulence equations and correct the turbulence viscosity
186  virtual void correct();
187 
188 
189  // Member Operators
190 
191  //- Disallow default bitwise assignment
192  void operator=(const kEpsilon&) = delete;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace RASModels
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #ifdef NoRepository
204  #include "kEpsilon.C"
205 #endif
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: kEpsilon.C:65
volScalarField epsilon_
Definition: kEpsilon.H:103
TypeName("kEpsilon")
Runtime type information.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEpsilon.C:50
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilon.H:173
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
dimensionedScalar Cmu_
Definition: kEpsilon.H:93
dimensionedScalar sigmaEps_
Definition: kEpsilon.H:98
void operator=(const kEpsilon &)=delete
Disallow default bitwise assignment.
dimensionedScalar sigmak_
Definition: kEpsilon.H:97
kEpsilon(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &type=typeName)
Construct from components.
Definition: kEpsilon.C:83
dimensionedScalar C2_
Definition: kEpsilon.H:95
virtual ~kEpsilon()
Destructor.
Definition: kEpsilon.H:143
Standard k-epsilon turbulence model for incompressible and compressible flows including rapid distort...
Definition: kEpsilon.H:83
A class for handling words, derived from string.
Definition: word.H:59
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: kEpsilon.H:163
dimensionedScalar C1_
Definition: kEpsilon.H:94
BasicMomentumTransportModel::alphaField alphaField
Definition: kEpsilon.H:115
phi
Definition: correctPhi.H:3
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kEpsilon.C:197
U
Definition: pEqn.H:72
BasicMomentumTransportModel::rhoField rhoField
Definition: kEpsilon.H:116
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
BasicMomentumTransportModel::transportModel transportModel
Definition: kEpsilon.H:117
virtual void correctNut()
Definition: kEpsilon.C:41
dimensionedScalar C3_
Definition: kEpsilon.H:96
A class for managing temporary objects.
Definition: PtrList.H:53
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kEpsilon.C:218
volScalarField k_
Definition: kEpsilon.H:102
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilon.H:153
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilon.H:179
Namespace for OpenFOAM.