ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / src / turbulenceModels / compressible / RAS / LaunderSharmaKE / LaunderSharmaKE.H
blobe0281235bc13468dbdbd8e3237fab221442a3f40
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.
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.
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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::compressible::RASModels::LaunderSharmaKE
27 Description
28     Launder and Sharma low-Reynolds k-epsilon turbulence model for
29     compressible and combusting flows.
31     The default model coefficients correspond to the following:
32     @verbatim
33         LaunderSharmaKECoeffs
34         {
35             Cmu         0.09;
36             C1          1.44;
37             C2          1.92;
38             C3          -0.33;
39             alphah      1.0;    // only for compressible
40             alphahk     1.0;    // only for compressible
41             alphaEps    0.76923;
42         }
43     @endverbatim
45 SourceFiles
46     LaunderSharmaKE.C
47     LaunderSharmaKECorrect.C
49 \*---------------------------------------------------------------------------*/
51 #ifndef compressibleLaunderSharmaKE_H
52 #define compressibleLaunderSharmaKE_H
54 #include "RASModel.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace Foam
60 namespace compressible
62 namespace RASModels
65 /*---------------------------------------------------------------------------*\
66                         Class LaunderSharmaKE Declaration
67 \*---------------------------------------------------------------------------*/
69 class LaunderSharmaKE
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_;
86         // Fields
88             volScalarField k_;
89             volScalarField epsilon_;
90             volScalarField mut_;
91             volScalarField alphat_;
94     // Private member functions
96         tmp<volScalarField> fMu() const;
97         tmp<volScalarField> f2() const;
100 public:
102     //- Runtime type information
103     TypeName("LaunderSharmaKE");
105     // Constructors
107         //- Construct from components
108         LaunderSharmaKE
109         (
110             const volScalarField& rho,
111             const volVectorField& U,
112             const surfaceScalarField& phi,
113             const basicThermo& thermophysicalModel
114         );
117     //- Destructor
118     virtual ~LaunderSharmaKE()
119     {}
122     // Member Functions
124         //- Return the effective diffusivity for k
125         tmp<volScalarField> DkEff() const
126         {
127             return tmp<volScalarField>
128             (
129                 new volScalarField("DkEff", mut_/sigmak_ + mu())
130             );
131         }
133         //- Return the effective diffusivity for epsilon
134         tmp<volScalarField> DepsilonEff() const
135         {
136             return tmp<volScalarField>
137             (
138                 new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
139             );
140         }
142         //- Return the turbulence viscosity
143         virtual tmp<volScalarField> mut() const
144         {
145             return mut_;
146         }
148         //- Return the effective turbulent thermal diffusivity
149         virtual tmp<volScalarField> alphaEff() const
150         {
151             return tmp<volScalarField>
152             (
153                 new volScalarField("alphaEff", alphat_ + alpha())
154             );
155         }
157         //- Return the turbulence kinetic energy
158         virtual tmp<volScalarField> k() const
159         {
160             return k_;
161         }
163         //- Return the turbulence kinetic energy dissipation rate
164         virtual tmp<volScalarField> epsilon() const
165         {
166             return epsilon_;
167         }
169         //- Return the Reynolds stress tensor
170         virtual tmp<volSymmTensorField> R() const;
172         //- Return the effective stress tensor including the laminar stress
173         virtual tmp<volSymmTensorField> devRhoReff() const;
175         //- Return the source term for the momentum equation
176         virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
178         //- Solve the turbulence equations and correct the turbulence viscosity
179         virtual void correct();
181         //- Read RASProperties dictionary
182         virtual bool read();
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace RASModels
189 } // End namespace compressible
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #endif
196 // ************************************************************************* //