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-2018 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 BasicTurbulenceModel>
78 class realizableKE
79 :
80  public eddyViscosity<RASModel<BasicTurbulenceModel>>
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:
124  typedef typename BasicTurbulenceModel::alphaField alphaField;
125  typedef typename BasicTurbulenceModel::rhoField rhoField;
126  typedef typename BasicTurbulenceModel::transportModel transportModel;
127 
128 
129  //- Runtime type information
130  TypeName("realizableKE");
131 
132  // Constructors
133 
134  //- Construct from components
136  (
137  const alphaField& alpha,
138  const rhoField& rho,
139  const volVectorField& U,
140  const surfaceScalarField& alphaRhoPhi,
141  const surfaceScalarField& phi,
142  const transportModel& transport,
143  const word& propertiesName = turbulenceModel::propertiesName,
144  const word& type = typeName
145  );
146 
147 
148  //- Destructor
149  virtual ~realizableKE()
150  {}
151 
152 
153  // Member Functions
154 
155  //- Re-read model coefficients if they have changed
156  virtual bool read();
157 
158  //- Return the effective diffusivity for k
159  tmp<volScalarField> DkEff() const
160  {
161  return volScalarField::New
162  (
163  "DkEff",
164  (this->nut_/sigmak_ + this->nu())
165  );
166  }
167 
168  //- Return the effective diffusivity for epsilon
170  {
171  return volScalarField::New
172  (
173  "DepsilonEff",
174  (this->nut_/sigmaEps_ + this->nu())
175  );
176  }
177 
178  //- Return the turbulence kinetic energy
179  virtual tmp<volScalarField> k() const
180  {
181  return k_;
182  }
183 
184  //- Return the turbulence kinetic energy dissipation rate
185  virtual tmp<volScalarField> epsilon() const
186  {
187  return epsilon_;
188  }
189 
190  //- Solve the turbulence equations and correct the turbulence viscosity
191  virtual void correct();
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace RASModels
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
203  #include "realizableKE.C"
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
surfaceScalarField & phi
dimensionedScalar sigmaEps_
Definition: realizableKE.H:91
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:229
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &, const dimensionSet &, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return a temporary field constructed from name, mesh, dimensionSet.
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
static const word propertiesName
Default name of the turbulence properties dictionary.
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:168
BasicTurbulenceModel::rhoField rhoField
Definition: realizableKE.H:124
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:184
dimensionedScalar sigmak_
Definition: realizableKE.H:90
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:158
BasicTurbulenceModel::alphaField alphaField
Definition: realizableKE.H:123
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:114
U
Definition: pEqn.H:72
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:248
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.
realizableKE(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
Definition: realizableKE.C:132
virtual ~realizableKE()
Destructor.
Definition: realizableKE.H:148
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
volScalarField & nu
BasicTurbulenceModel::transportModel transportModel
Definition: realizableKE.H:125
Namespace for OpenFOAM.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:178