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-2020 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  typedef typename BasicMomentumTransportModel::transportModel transportModel;
131 
132 
133  //- Runtime type information
134  TypeName("realizableKE");
135 
136  // Constructors
137 
138  //- Construct from components
140  (
141  const alphaField& alpha,
142  const rhoField& rho,
143  const volVectorField& U,
144  const surfaceScalarField& alphaRhoPhi,
145  const surfaceScalarField& phi,
146  const transportModel& transport,
147  const word& type = typeName
148  );
149 
150 
151  //- Destructor
152  virtual ~realizableKE()
153  {}
154 
155 
156  // Member Functions
157 
158  //- Re-read model coefficients if they have changed
159  virtual bool read();
160 
161  //- Return the effective diffusivity for k
162  tmp<volScalarField> DkEff() const
163  {
164  return volScalarField::New
165  (
166  "DkEff",
167  (this->nut_/sigmak_ + this->nu())
168  );
169  }
170 
171  //- Return the effective diffusivity for epsilon
173  {
174  return volScalarField::New
175  (
176  "DepsilonEff",
177  (this->nut_/sigmaEps_ + this->nu())
178  );
179  }
180 
181  //- Return the turbulence kinetic energy
182  virtual tmp<volScalarField> k() const
183  {
184  return k_;
185  }
186 
187  //- Return the turbulence kinetic energy dissipation rate
188  virtual tmp<volScalarField> epsilon() const
189  {
190  return epsilon_;
191  }
192 
193  //- Solve the turbulence equations and correct the turbulence viscosity
194  virtual void correct();
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace RASModels
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
206  #include "realizableKE.C"
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
BasicMomentumTransportModel::transportModel transportModel
Definition: realizableKE.H:129
dimensionedScalar sigmaEps_
Definition: realizableKE.H:95
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
realizableKE(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &type=typeName)
Construct from components.
Definition: realizableKE.C:132
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:49
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:98
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:227
phi
Definition: pEqn.H:104
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:41
Realizable k-epsilon turbulence model for incompressible and compressible flows.
Definition: realizableKE.H:77
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:171
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:187
dimensionedScalar sigmak_
Definition: realizableKE.H:94
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:161
BasicMomentumTransportModel::rhoField rhoField
Definition: realizableKE.H:128
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:114
BasicMomentumTransportModel::alphaField alphaField
Definition: realizableKE.H:127
U
Definition: pEqn.H:72
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:246
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:151
static word modelName(Name name, const word &model)
Return the name of the object within the given model.
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
Namespace for OpenFOAM.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:181