realizableKE.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2017 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 Group
28  grpRASTurbulence
29 
30 Description
31  Realizable k-epsilon turbulence model for incompressible and compressible
32  flows.
33 
34  References:
35  \verbatim
36  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1994).
37  A new k-epsilon eddy viscosity model for high Reynolds number
38  turbulent flows: Model development and validation.
39  NASA STI/Recon Technical Report N, 95, 11442.
40 
41  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1995).
42  A New k-epsilon Eddy Viscosity Model for High Reynolds Number
43  Turbulent Flows.
44  Computers and Fluids, 24(3), 227-238.
45  \endverbatim
46 
47  The default model coefficients are
48  \verbatim
49  realizableKECoeffs
50  {
51  A0 4.0;
52  C2 1.9;
53  sigmak 1.0;
54  sigmaEps 1.2;
55  }
56  \endverbatim
57 
58 SourceFiles
59  realizableKE.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef realizableKE_H
64 #define realizableKE_H
65 
66 #include "RASModel.H"
67 #include "eddyViscosity.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace RASModels
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class realizableKE Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template<class BasicTurbulenceModel>
81 class realizableKE
82 :
83  public eddyViscosity<RASModel<BasicTurbulenceModel>>
84 {
85 
86 protected:
87 
88  // Protected data
89 
90  // Model coefficients
91 
96 
97 
98  // Fields
99 
102 
103 
104  // Protected Member Functions
105 
107  (
108  const volTensorField& gradU,
109  const volScalarField& S2,
110  const volScalarField& magS
111  );
112 
113  virtual void correctNut
114  (
115  const volTensorField& gradU,
116  const volScalarField& S2,
117  const volScalarField& magS
118  );
119 
120  virtual void correctNut();
121  virtual tmp<fvScalarMatrix> kSource() const;
122  virtual tmp<fvScalarMatrix> epsilonSource() const;
123 
124 
125 public:
127  typedef typename BasicTurbulenceModel::alphaField alphaField;
128  typedef typename BasicTurbulenceModel::rhoField rhoField;
129  typedef typename BasicTurbulenceModel::transportModel transportModel;
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 transportModel& transport,
146  const word& propertiesName = turbulenceModel::propertiesName,
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 tmp<volScalarField>
165  (
166  new volScalarField
167  (
168  "DkEff",
169  (this->nut_/sigmak_ + this->nu())
170  )
171  );
172  }
173 
174  //- Return the effective diffusivity for epsilon
176  {
177  return tmp<volScalarField>
178  (
179  new volScalarField
180  (
181  "DepsilonEff",
182  (this->nut_/sigmaEps_ + this->nu())
183  )
184  );
185  }
186 
187  //- Return the turbulence kinetic energy
188  virtual tmp<volScalarField> k() const
189  {
190  return k_;
191  }
192 
193  //- Return the turbulence kinetic energy dissipation rate
194  virtual tmp<volScalarField> epsilon() const
195  {
196  return epsilon_;
197  }
198 
199  //- Solve the turbulence equations and correct the turbulence viscosity
200  virtual void correct();
201 };
202 
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 } // End namespace RASModels
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
212  #include "realizableKE.C"
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
surfaceScalarField & phi
U
Definition: pEqn.H:83
dimensionedScalar sigmaEps_
Definition: realizableKE.H:94
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:99
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:229
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:41
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Realizable k-epsilon turbulence model for incompressible and compressible flows.
Definition: realizableKE.H:80
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:174
BasicTurbulenceModel::rhoField rhoField
Definition: realizableKE.H:127
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:193
dimensionedScalar sigmak_
Definition: realizableKE.H:93
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:161
BasicTurbulenceModel::alphaField alphaField
Definition: realizableKE.H:126
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:114
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:485
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:248
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:151
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
volScalarField & nu
BasicTurbulenceModel::transportModel transportModel
Definition: realizableKE.H:128
Namespace for OpenFOAM.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:187