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-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::RASModels::kEpsilon
29 
30 Group
31  grpRASTurbulence
32 
33 Description
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 
67 SourceFiles
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 
80 namespace Foam
81 {
82 namespace RASModels
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class kEpsilon Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 template<class BasicTurbulenceModel>
90 class 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 
103 protected:
104 
105  // Protected data
106 
107  // Model coefficients
108 
115 
116  // Fields
117 
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 
129 public:
130 
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
143  kEpsilon
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
166  tmp<volScalarField> DkEff() const
167  {
168  return tmp<volScalarField>
169  (
170  new volScalarField
171  (
172  "DkEff",
173  (this->nut_/sigmak_ + this->nu())
174  )
175  );
176  }
177 
178  //- Return the effective diffusivity for epsilon
180  {
181  return tmp<volScalarField>
182  (
183  new volScalarField
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  //- Return the (estimated) specific dissipation rate
204  virtual tmp<volScalarField> omega() const
205  {
207  (
208  IOobject
209  (
210  IOobject::groupName("omega", this->alphaRhoPhi_.group()),
211  this->runTime_.timeName(),
212  this->mesh_
213  ),
214  epsilon_/(Cmu_*k_)
215  );
216  }
217 
218  //- Solve the turbulence equations and correct the turbulence viscosity
219  virtual void correct();
220 };
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 } // End namespace RASModels
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
231  #include "kEpsilon.C"
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Foam::RASModels::kEpsilon::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kEpsilon.H:191
Foam::RASModels::kEpsilon::correct
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kEpsilon.C:222
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::RASModels::kEpsilon::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: kEpsilon.H:130
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::RASModels::kEpsilon::epsilon_
volScalarField epsilon_
Definition: kEpsilon.H:118
rho
rho
Definition: readInitialConditions.H:88
Foam::ThermalDiffusivity::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: ThermalDiffusivity.H:58
Foam::RASModels::kEpsilon::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kEpsilon.C:203
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
eddyViscosity.H
Foam::RASModels::kEpsilon::sigmaEps_
dimensionedScalar sigmaEps_
Definition: kEpsilon.H:113
Foam::RASModels::kEpsilon::~kEpsilon
virtual ~kEpsilon()=default
Destructor.
Foam::RASModels::kEpsilon::C2_
dimensionedScalar C2_
Definition: kEpsilon.H:110
Foam::RASModels::kEpsilon::Cmu_
dimensionedScalar Cmu_
Definition: kEpsilon.H:108
Foam::RASModels::kEpsilon::TypeName
TypeName("kEpsilon")
Runtime type information.
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::RASModels::kEpsilon::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: kEpsilon.H:131
Foam::RASModels::kEpsilon::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: kEpsilon.H:132
Foam::RASModels::kEpsilon::correctNut
virtual void correctNut()
Definition: kEpsilon.C:43
Foam::RASModels::kEpsilon::C1_
dimensionedScalar C1_
Definition: kEpsilon.H:109
Foam::RASModels::kEpsilon::C3_
dimensionedScalar C3_
Definition: kEpsilon.H:111
RASModel.H
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RASModels::kEpsilon::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEpsilon.H:165
Foam::RASModels::kEpsilon::sigmak_
dimensionedScalar sigmak_
Definition: kEpsilon.H:112
Foam::RASModels::kEpsilon::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: kEpsilon.H:178
Foam::RASModels::kEpsilon::k_
volScalarField k_
Definition: kEpsilon.H:117
Foam::RASModels::kEpsilon::epsilonSource
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: kEpsilon.C:69
Foam::ThermalDiffusivity::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: ThermalDiffusivity.H:60
U
U
Definition: pEqn.H:72
Foam::RASModels::kEpsilon::omega
virtual tmp< volScalarField > omega() const
Return the (estimated) specific dissipation rate.
Definition: kEpsilon.H:203
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:55
Foam::eddyViscosity< RASModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:66
Foam::RASModels::kEpsilon::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEpsilon.C:54
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::RASModels::kEpsilon
Standard k-epsilon turbulence model for incompressible and compressible flows including rapid distort...
Definition: kEpsilon.H:89
Foam::RASModels::kEpsilon::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kEpsilon.H:197