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 
104  (
105  const volTensorField& gradU,
106  const volScalarField& S2,
107  const volScalarField& magS
108  );
109 
110  virtual void correctNut
111  (
112  const volTensorField& gradU,
113  const volScalarField& S2,
114  const volScalarField& magS
115  );
116 
117  virtual void correctNut();
118  virtual tmp<fvScalarMatrix> kSource() const;
119  virtual tmp<fvScalarMatrix> epsilonSource() const;
120 
121 
122 public:
123 
124  typedef typename BasicMomentumTransportModel::alphaField alphaField;
125  typedef typename BasicMomentumTransportModel::rhoField rhoField;
126 
127 
128  //- Runtime type information
129  TypeName("realizableKE");
130 
131  // Constructors
132 
133  //- Construct from components
135  (
136  const alphaField& alpha,
137  const rhoField& rho,
138  const volVectorField& U,
139  const surfaceScalarField& alphaRhoPhi,
140  const surfaceScalarField& phi,
141  const viscosity& viscosity,
142  const word& type = typeName
143  );
144 
145 
146  //- Destructor
147  virtual ~realizableKE()
148  {}
149 
150 
151  // Member Functions
152 
153  //- Re-read model coefficients if they have changed
154  virtual bool read();
155 
156  //- Return the effective diffusivity for k
157  tmp<volScalarField> DkEff() const
158  {
159  return volScalarField::New
160  (
161  "DkEff",
162  (this->nut_/sigmak_ + this->nu())
163  );
164  }
165 
166  //- Return the effective diffusivity for epsilon
168  {
169  return volScalarField::New
170  (
171  "DepsilonEff",
172  (this->nut_/sigmaEps_ + this->nu())
173  );
174  }
175 
176  //- Return the turbulence kinetic energy
177  virtual tmp<volScalarField> k() const
178  {
179  return k_;
180  }
181 
182  //- Return the turbulence kinetic energy dissipation rate
183  virtual tmp<volScalarField> epsilon() const
184  {
185  return epsilon_;
186  }
187 
188  //- Return the turbulence specific dissipation rate
189  virtual tmp<volScalarField> omega() const
190  {
191  return volScalarField::New
192  (
193  "omega",
194  epsilon_/(0.09*k_)
195  );
196  }
197 
198  //- Solve the turbulence equations and correct the turbulence viscosity
199  virtual void correct();
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace RASModels
206 } // End namespace Foam
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #ifdef NoRepository
211  #include "realizableKE.C"
212 #endif
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
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:123
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:42
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:115
dimensionedScalar sigmak_
Definition: realizableKE.H:90
TypeName("realizableKE")
Runtime type information.
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:156
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:176
dimensionedScalar sigmaEps_
Definition: realizableKE.H:91
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
Definition: realizableKE.H:188
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:247
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: realizableKE.H:166
virtual ~realizableKE()
Destructor.
Definition: realizableKE.H:146
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:99
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:133
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:182
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:228
BasicMomentumTransportModel::rhoField rhoField
Definition: realizableKE.H:124
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