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-2022 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  // Private Member Functions
83 
84  using IOobject::modelName;
85 
86 
87 protected:
88 
89  // Protected data
90 
91  // Model coefficients
92 
97 
98 
99  // Fields
103 
104 
105  // Protected Member Functions
106 
108  (
109  const volTensorField& gradU,
110  const volScalarField& S2,
111  const volScalarField& magS
112  );
113 
114  virtual void correctNut
115  (
116  const volTensorField& gradU,
117  const volScalarField& S2,
118  const volScalarField& magS
119  );
120 
121  virtual void correctNut();
122  virtual tmp<fvScalarMatrix> kSource() const;
123  virtual tmp<fvScalarMatrix> epsilonSource() const;
124 
125 
126 public:
128  typedef typename BasicMomentumTransportModel::alphaField alphaField;
129  typedef typename BasicMomentumTransportModel::rhoField rhoField;
130 
131 
132  //- Runtime type information
133  TypeName("realizableKE");
134 
135  // Constructors
136 
137  //- Construct from components
139  (
140  const alphaField& alpha,
141  const rhoField& rho,
142  const volVectorField& U,
143  const surfaceScalarField& alphaRhoPhi,
144  const surfaceScalarField& phi,
145  const viscosity& viscosity,
146  const word& type = typeName
147  );
148 
149 
150  //- Destructor
151  virtual ~realizableKE()
152  {}
153 
154 
155  // Member Functions
156 
157  //- Re-read model coefficients if they have changed
158  virtual bool read();
159 
160  //- Return the effective diffusivity for k
161  tmp<volScalarField> DkEff() const
162  {
163  return volScalarField::New
164  (
165  "DkEff",
166  (this->nut_/sigmak_ + this->nu())
167  );
168  }
169 
170  //- Return the effective diffusivity for epsilon
172  {
173  return volScalarField::New
174  (
175  "DepsilonEff",
176  (this->nut_/sigmaEps_ + this->nu())
177  );
178  }
179 
180  //- Return the turbulence kinetic energy
181  virtual tmp<volScalarField> k() const
182  {
183  return k_;
184  }
185 
186  //- Return the turbulence kinetic energy dissipation rate
187  virtual tmp<volScalarField> epsilon() const
188  {
189  return epsilon_;
190  }
191 
192  //- Return the turbulence specific dissipation rate
193  virtual tmp<volScalarField> omega() const
194  {
195  return volScalarField::New
196  (
197  "omega",
198  epsilon_/(0.09*k_),
199  epsilon_.boundaryField().types()
200  );
201  }
202 
203  //- Solve the turbulence equations and correct the turbulence viscosity
204  virtual void correct();
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace RASModels
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #ifdef NoRepository
216  #include "realizableKE.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
U
Definition: pEqn.H:72
const Boundary & boundaryField() const
Return const-reference to the boundary field.
dimensionedScalar sigmaEps_
Definition: realizableKE.H:95
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
wordList types() const
Return a list of the patch field types.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:99
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:228
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:42
Realizable k-epsilon turbulence model for incompressible and compressible flows.
Definition: realizableKE.H:77
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
Definition: realizableKE.H:192
A class for handling words, derived from string.
Definition: word.H:59
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: realizableKE.H:170
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:186
phi
Definition: correctPhi.H:3
dimensionedScalar sigmak_
Definition: realizableKE.H:94
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:160
BasicMomentumTransportModel::rhoField rhoField
Definition: realizableKE.H:128
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:115
BasicMomentumTransportModel::alphaField alphaField
Definition: realizableKE.H:127
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:247
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
TypeName("realizableKE")
Runtime type information.
virtual ~realizableKE()
Destructor.
Definition: realizableKE.H:150
static word modelName(Name name, const word &model)
Return the name of the object within the given model.
A class for managing temporary objects.
Definition: PtrList.H:53
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 > nu() const
Return the laminar viscosity.
Definition: RASModel.H:208
Namespace for OpenFOAM.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:180