initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / compressible / RAS / kEpsilon / kEpsilon.H
blob865120d8c6c9c320351bcda9b80c655755d48884
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::compressible::RASModels::kEpsilon
28 Description
29     Standard k-epsilon turbulence model for compressible flows
31     The default model coefficients correspond to the following:
32     @verbatim
33         kEpsilonCoeffs
34         {
35             Cmu         0.09;
36             C1          1.44;
37             C2          1.92;
38             C3          -0.33;  // only for compressible
39             sigmak      1.0;    // only for compressible
40             sigmaEps    1.3;
41             Prt         1.0;    // only for compressible
42         }
43     @endverbatim
45 SourceFiles
46     kEpsilon.C
47     kEpsilonCorrect.C
49 \*---------------------------------------------------------------------------*/
51 #ifndef compressiblekEpsilon_H
52 #define compressiblekEpsilon_H
54 #include "RASModel.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace Foam
60 namespace compressible
62 namespace RASModels
65 /*---------------------------------------------------------------------------*\
66                            Class kEpsilon Declaration
67 \*---------------------------------------------------------------------------*/
69 class kEpsilon
71     public RASModel
73     // Private data
75         // Model coefficients
77             dimensionedScalar Cmu_;
78             dimensionedScalar C1_;
79             dimensionedScalar C2_;
80             dimensionedScalar C3_;
81             dimensionedScalar sigmak_;
82             dimensionedScalar sigmaEps_;
83             dimensionedScalar Prt_;
85         // Fields
87             volScalarField k_;
88             volScalarField epsilon_;
89             volScalarField mut_;
90             volScalarField alphat_;
93 public:
95     //- Runtime type information
96     TypeName("kEpsilon");
98     // Constructors
100         //- Construct from components
101         kEpsilon
102         (
103             const volScalarField& rho,
104             const volVectorField& U,
105             const surfaceScalarField& phi,
106             const basicThermo& thermophysicalModel
107         );
110     //- Destructor
111     virtual ~kEpsilon()
112     {}
115     // Member Functions
117         //- Return the effective diffusivity for k
118         tmp<volScalarField> DkEff() const
119         {
120             return tmp<volScalarField>
121             (
122                 new volScalarField("DkEff", mut_/sigmak_ + mu())
123             );
124         }
126         //- Return the effective diffusivity for epsilon
127         tmp<volScalarField> DepsilonEff() const
128         {
129             return tmp<volScalarField>
130             (
131                 new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
132             );
133         }
135         //- Return the turbulence viscosity
136         virtual tmp<volScalarField> mut() const
137         {
138             return mut_;
139         }
141         //- Return the effective turbulent thermal diffusivity
142         virtual tmp<volScalarField> alphaEff() const
143         {
144             return tmp<volScalarField>
145             (
146                 new volScalarField("alphaEff", alphat_ + alpha())
147             );
148         }
150         //- Return the turbulence kinetic energy
151         virtual tmp<volScalarField> k() const
152         {
153             return k_;
154         }
156         //- Return the turbulence kinetic energy dissipation rate
157         virtual tmp<volScalarField> epsilon() const
158         {
159             return epsilon_;
160         }
162         //- Return the Reynolds stress tensor
163         virtual tmp<volSymmTensorField> R() const;
165         //- Return the effective stress tensor including the laminar stress
166         virtual tmp<volSymmTensorField> devRhoReff() const;
168         //- Return the source term for the momentum equation
169         virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
171         //- Solve the turbulence equations and correct the turbulence viscosity
172         virtual void correct();
174         //- Read RASProperties dictionary
175         virtual bool read();
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace compressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #endif
189 // ************************************************************************* //