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-2019 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 BasicTurbulenceModel>
84 class kEpsilon
85 :
86  public eddyViscosity<RASModel<BasicTurbulenceModel>>
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 BasicTurbulenceModel::alphaField alphaField;
117  typedef typename BasicTurbulenceModel::rhoField rhoField;
118  typedef typename BasicTurbulenceModel::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& propertiesName = turbulenceModel::propertiesName,
137  const word& type = typeName
138  );
139 
140  //- Disallow default bitwise copy construction
141  kEpsilon(const kEpsilon&) = delete;
142 
143 
144  //- Destructor
145  virtual ~kEpsilon()
146  {}
147 
148 
149  // Member Functions
150 
151  //- Re-read model coefficients if they have changed
152  virtual bool read();
153 
154  //- Return the effective diffusivity for k
155  tmp<volScalarField> DkEff() const
156  {
157  return volScalarField::New
158  (
159  "DkEff",
160  (this->nut_/sigmak_ + this->nu())
161  );
162  }
163 
164  //- Return the effective diffusivity for epsilon
166  {
167  return volScalarField::New
168  (
169  "DepsilonEff",
170  (this->nut_/sigmaEps_ + this->nu())
171  );
172  }
173 
174  //- Return the turbulence kinetic energy
175  virtual tmp<volScalarField> k() const
176  {
177  return k_;
178  }
179 
180  //- Return the turbulence kinetic energy dissipation rate
181  virtual tmp<volScalarField> epsilon() const
182  {
183  return epsilon_;
184  }
185 
186  //- Solve the turbulence equations and correct the turbulence viscosity
187  virtual void correct();
188 
189 
190  // Member Operators
191 
192  //- Disallow default bitwise assignment
193  void operator=(const kEpsilon&) = delete;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace RASModels
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #ifdef NoRepository
205  #include "kEpsilon.C"
206 #endif
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: kEpsilon.C:66
volScalarField epsilon_
Definition: kEpsilon.H:103
surfaceScalarField & phi
TypeName("kEpsilon")
Runtime type information.
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEpsilon.C:51
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilon.H:174
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
dimensionedScalar Cmu_
Definition: kEpsilon.H:93
dimensionedScalar sigmaEps_
Definition: kEpsilon.H:98
BasicTurbulenceModel::alphaField alphaField
Definition: kEpsilon.H:115
void operator=(const kEpsilon &)=delete
Disallow default bitwise assignment.
kEpsilon(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
Definition: kEpsilon.C:84
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &, const dimensionSet &, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return a temporary field constructed from name, mesh, dimensionSet.
dimensionedScalar sigmak_
Definition: kEpsilon.H:97
dimensionedScalar C2_
Definition: kEpsilon.H:95
virtual ~kEpsilon()
Destructor.
Definition: kEpsilon.H:144
Standard k-epsilon turbulence model for incompressible and compressible flows including rapid distort...
Definition: kEpsilon.H:83
static const word propertiesName
Default name of the turbulence properties dictionary.
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:164
dimensionedScalar C1_
Definition: kEpsilon.H:94
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kEpsilon.C:200
U
Definition: pEqn.H:72
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual void correctNut()
Definition: kEpsilon.C:40
dimensionedScalar C3_
Definition: kEpsilon.H:96
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
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:221
BasicTurbulenceModel::rhoField rhoField
Definition: kEpsilon.H:116
BasicTurbulenceModel::transportModel transportModel
Definition: kEpsilon.H:117
volScalarField k_
Definition: kEpsilon.H:102
volScalarField & nu
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilon.H:154
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilon.H:180
Namespace for OpenFOAM.