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-2016 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  Cmu 0.09;
52  A0 4.0;
53  C2 1.9;
54  sigmak 1.0;
55  sigmaEps 1.2;
56  }
57  \endverbatim
58 
59 SourceFiles
60  realizableKE.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef realizableKE_H
65 #define realizableKE_H
66 
67 #include "RASModel.H"
68 #include "eddyViscosity.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 namespace RASModels
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class realizableKE Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 template<class BasicTurbulenceModel>
82 class realizableKE
83 :
84  public eddyViscosity<RASModel<BasicTurbulenceModel>>
85 {
86 
87 protected:
88 
89  // Protected data
90 
91  // Model coefficients
92 
98 
99 
100  // Fields
104 
105 
106  // Protected Member Functions
107 
109  (
110  const volTensorField& gradU,
111  const volScalarField& S2,
112  const volScalarField& magS
113  );
114 
115  virtual void correctNut
116  (
117  const volTensorField& gradU,
118  const volScalarField& S2,
119  const volScalarField& magS
120  );
121 
122  virtual void correctNut();
123  virtual tmp<fvScalarMatrix> kSource() const;
124  virtual tmp<fvScalarMatrix> epsilonSource() const;
125 
126 
127 public:
129  typedef typename BasicTurbulenceModel::alphaField alphaField;
130  typedef typename BasicTurbulenceModel::rhoField rhoField;
131  typedef typename BasicTurbulenceModel::transportModel transportModel;
132 
133 
134  //- Runtime type information
135  TypeName("realizableKE");
136 
137  // Constructors
138 
139  //- Construct from components
141  (
142  const alphaField& alpha,
143  const rhoField& rho,
144  const volVectorField& U,
145  const surfaceScalarField& alphaRhoPhi,
146  const surfaceScalarField& phi,
147  const transportModel& transport,
148  const word& propertiesName = turbulenceModel::propertiesName,
149  const word& type = typeName
150  );
151 
152 
153  //- Destructor
154  virtual ~realizableKE()
155  {}
156 
157 
158  // Member Functions
159 
160  //- Re-read model coefficients if they have changed
161  virtual bool read();
162 
163  //- Return the effective diffusivity for k
164  tmp<volScalarField> DkEff() const
165  {
166  return tmp<volScalarField>
167  (
168  new volScalarField
169  (
170  "DkEff",
171  (this->nut_/sigmak_ + this->nu())
172  )
173  );
174  }
175 
176  //- Return the effective diffusivity for epsilon
178  {
179  return tmp<volScalarField>
180  (
181  new volScalarField
182  (
183  "DepsilonEff",
184  (this->nut_/sigmaEps_ + this->nu())
185  )
186  );
187  }
188 
189  //- Return the turbulence kinetic energy
190  virtual tmp<volScalarField> k() const
191  {
192  return k_;
193  }
194 
195  //- Return the turbulence kinetic energy dissipation rate
196  virtual tmp<volScalarField> epsilon() const
197  {
198  return epsilon_;
199  }
200 
201  //- Solve the turbulence equations and correct the turbulence viscosity
202  virtual void correct();
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace RASModels
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #ifdef NoRepository
214  #include "realizableKE.C"
215 #endif
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
surfaceScalarField & phi
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:114
U
Definition: pEqn.H:83
dimensionedScalar sigmaEps_
Definition: realizableKE.H:96
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:239
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:81
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
BasicTurbulenceModel::rhoField rhoField
Definition: realizableKE.H:129
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: realizableKE.H:176
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:99
dimensionedScalar sigmak_
Definition: realizableKE.H:95
BasicTurbulenceModel::alphaField alphaField
Definition: realizableKE.H:128
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:189
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:195
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:259
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:153
A class for managing temporary objects.
Definition: PtrList.H:54
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:163
volScalarField & nu
BasicTurbulenceModel::transportModel transportModel
Definition: realizableKE.H:130
Namespace for OpenFOAM.