FreeFOAM The Cross-Platform CFD Toolkit
kEpsilon.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) 1991-2010 OpenCFD Ltd.
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::compressible::RASModels::kEpsilon
26 
27 Description
28  Standard k-epsilon turbulence model for compressible flows
29 
30  The default model coefficients correspond to the following:
31  @verbatim
32  kEpsilonCoeffs
33  {
34  Cmu 0.09;
35  C1 1.44;
36  C2 1.92;
37  C3 -0.33; // only for compressible
38  sigmak 1.0; // only for compressible
39  sigmaEps 1.3;
40  Prt 1.0; // only for compressible
41  }
42  @endverbatim
43 
44 SourceFiles
45  kEpsilon.C
46  kEpsilonCorrect.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef compressiblekEpsilon_H
51 #define compressiblekEpsilon_H
52 
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace compressible
60 {
61 namespace RASModels
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class kEpsilon Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class kEpsilon
69 :
70  public RASModel
71 {
72  // Private data
73 
74  // Model coefficients
75 
76  dimensionedScalar Cmu_;
80  dimensionedScalar sigmak_;
81  dimensionedScalar sigmaEps_;
82  dimensionedScalar Prt_;
83 
84  // Fields
85 
86  volScalarField k_;
87  volScalarField epsilon_;
88  volScalarField mut_;
89  volScalarField alphat_;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("kEpsilon");
96 
97  // Constructors
98 
99  //- Construct from components
100  kEpsilon
101  (
102  const volScalarField& rho,
103  const volVectorField& U,
104  const surfaceScalarField& phi,
105  const basicThermo& thermophysicalModel
106  );
107 
108 
109  //- Destructor
110  virtual ~kEpsilon()
111  {}
112 
113 
114  // Member Functions
115 
116  //- Return the effective diffusivity for k
118  {
119  return tmp<volScalarField>
120  (
121  new volScalarField("DkEff", mut_/sigmak_ + mu())
122  );
123  }
124 
125  //- Return the effective diffusivity for epsilon
127  {
128  return tmp<volScalarField>
129  (
130  new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
131  );
132  }
133 
134  //- Return the turbulence viscosity
135  virtual tmp<volScalarField> mut() const
136  {
137  return mut_;
138  }
139 
140  //- Return the effective turbulent thermal diffusivity
142  {
143  return tmp<volScalarField>
144  (
145  new volScalarField("alphaEff", alphat_ + alpha())
146  );
147  }
148 
149  //- Return the turbulence kinetic energy
150  virtual tmp<volScalarField> k() const
151  {
152  return k_;
153  }
154 
155  //- Return the turbulence kinetic energy dissipation rate
156  virtual tmp<volScalarField> epsilon() const
157  {
158  return epsilon_;
159  }
160 
161  //- Return the Reynolds stress tensor
162  virtual tmp<volSymmTensorField> R() const;
163 
164  //- Return the effective stress tensor including the laminar stress
165  virtual tmp<volSymmTensorField> devRhoReff() const;
166 
167  //- Return the source term for the momentum equation
168  virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
169 
170  //- Solve the turbulence equations and correct the turbulence viscosity
171  virtual void correct();
172 
173  //- Read RASProperties dictionary
174  virtual bool read();
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace RASModels
181 } // End namespace compressible
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************ vim: set sw=4 sts=4 et: ************************ //