realizableKE.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-2023 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::realizableKE
26 
27 Description
28  Realizable k-epsilon turbulence model for incompressible and compressible
29  flows.
30 
31  References:
32  \verbatim
33  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1994).
34  A new k-epsilon eddy viscosity model for high Reynolds number
35  turbulent flows: Model development and validation.
36  NASA STI/Recon Technical Report N, 95, 11442.
37 
38  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1995).
39  A New k-epsilon Eddy Viscosity Model for High Reynolds Number
40  Turbulent Flows.
41  Computers and Fluids, 24(3), 227-238.
42  \endverbatim
43 
44  The default model coefficients are
45  \verbatim
46  realizableKECoeffs
47  {
48  A0 4.0;
49  C2 1.9;
50  sigmak 1.0;
51  sigmaEps 1.2;
52  }
53  \endverbatim
54 
55 SourceFiles
56  realizableKE.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef realizableKE_H
61 #define realizableKE_H
62 
63 #include "RASModel.H"
64 #include "eddyViscosity.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 namespace RASModels
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class realizableKE Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 template<class BasicMomentumTransportModel>
78 class realizableKE
79 :
80  public eddyViscosity<RASModel<BasicMomentumTransportModel>>
81 {
82 
83 protected:
84 
85  // Protected data
86 
87  // Model coefficients
88 
93 
94 
95  // Fields
96 
99 
100 
101  // Protected Member Functions
102 
103  //- Bound epsilon
104  void boundEpsilon();
105 
107  (
108  const volTensorField& gradU,
109  const volScalarField& S2,
110  const volScalarField& magS
111  );
112 
113  //- Correct the eddy-viscosity nut
114  virtual void correctNut
115  (
116  const volTensorField& gradU,
117  const volScalarField& S2,
118  const volScalarField& magS
119  );
120 
121  //- Correct the eddy-viscosity nut
122  virtual void correctNut();
123 
124  //- Source term for the k equation
125  virtual tmp<fvScalarMatrix> kSource() const;
126 
127  //- Source term for the epsilon equation
128  virtual tmp<fvScalarMatrix> epsilonSource() const;
129 
130 
131 public:
132 
133  typedef typename BasicMomentumTransportModel::alphaField alphaField;
134  typedef typename BasicMomentumTransportModel::rhoField rhoField;
135 
136 
137  //- Runtime type information
138  TypeName("realizableKE");
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 viscosity& viscosity,
151  const word& type = typeName
152  );
153 
154 
155  //- Destructor
156  virtual ~realizableKE()
157  {}
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 volScalarField::New
169  (
170  "DkEff",
171  (this->nut_/sigmak_ + this->nu())
172  );
173  }
174 
175  //- Return the effective diffusivity for epsilon
177  {
178  return volScalarField::New
179  (
180  "DepsilonEff",
181  (this->nut_/sigmaEps_ + this->nu())
182  );
183  }
184 
185  //- Return the turbulence kinetic energy
186  virtual tmp<volScalarField> k() const
187  {
188  return k_;
189  }
190 
191  //- Return the turbulence kinetic energy dissipation rate
192  virtual tmp<volScalarField> epsilon() const
193  {
194  return epsilon_;
195  }
196 
197  //- Return the turbulence specific dissipation rate
198  virtual tmp<volScalarField> omega() const
199  {
200  return volScalarField::New
201  (
202  "omega",
203  epsilon_/(0.09*k_)
204  );
205  }
206 
207  //- Solve the turbulence equations and correct the turbulence viscosity
208  virtual void correct();
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace RASModels
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #ifdef NoRepository
220  #include "realizableKE.C"
221 #endif
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Realizable k-epsilon turbulence model for incompressible and compressible flows.
Definition: realizableKE.H:80
BasicMomentumTransportModel::alphaField alphaField
Definition: realizableKE.H:132
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:49
virtual tmp< fvScalarMatrix > epsilonSource() const
Source term for the epsilon equation.
Definition: realizableKE.C:123
dimensionedScalar sigmak_
Definition: realizableKE.H:90
TypeName("realizableKE")
Runtime type information.
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:165
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:185
dimensionedScalar sigmaEps_
Definition: realizableKE.H:91
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
Definition: realizableKE.H:197
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:255
void boundEpsilon()
Bound epsilon.
Definition: realizableKE.C:41
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: realizableKE.H:175
virtual void correctNut()
Correct the eddy-viscosity nut.
Definition: realizableKE.C:96
virtual ~realizableKE()
Destructor.
Definition: realizableKE.H:155
virtual tmp< fvScalarMatrix > kSource() const
Source term for the k equation.
Definition: realizableKE.C:107
realizableKE(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
Definition: realizableKE.C:141
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:191
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:236
BasicMomentumTransportModel::rhoField rhoField
Definition: realizableKE.H:133
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
BasicMomentumTransportModel::alphaField alphaField
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488