initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / compressible / LES / GenEddyVisc / GenEddyVisc.H
blob440ec71c5c9b40bb88176ee3f11aeba2af77a208
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::LESModels::GenEddyVisc
28 Description
29     General base class for all compressible models that can be implemented as
30     an eddy viscosity, i.e. algebraic and one-equation models.
32     Contains fields for k (SGS turbulent kinetic energy), gamma
33     (modelled viscosity) and epsilon (SGS dissipation).
35 SourceFiles
36     GenEddyVisc.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef compressibleGenEddyVisc_H
41 #define compressibleGenEddyVisc_H
43 #include "LESModel.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
49 namespace compressible
51 namespace LESModels
54 /*---------------------------------------------------------------------------*\
55                            Class GenEddyVisc Declaration
56 \*---------------------------------------------------------------------------*/
58 class GenEddyVisc
60     virtual public LESModel
62     // Private Member Functions
64         // Disallow default bitwise copy construct and assignment
65         GenEddyVisc(const GenEddyVisc&);
66         GenEddyVisc& operator=(const GenEddyVisc&);
69 protected:
71     // Model coefficients
73         dimensionedScalar ce_;
74         dimensionedScalar Prt_;
77     // Fields
79         volScalarField k_;
80         volScalarField muSgs_;
81         volScalarField alphaSgs_;
84 public:
86     // Constructors
88         //- Construct from components
89         GenEddyVisc
90         (
91             const volScalarField& rho,
92             const volVectorField& U,
93             const surfaceScalarField& phi,
94             const basicThermo& thermoPhysicalModel
95         );
98     //- Destructor
99     virtual ~GenEddyVisc()
100     {}
103     // Member Functions
105         //- Return SGS kinetic energy
106         virtual tmp<volScalarField> k() const
107         {
108             return k_;
109         }
111         //- Return sub-grid disipation rate
112         virtual tmp<volScalarField> epsilon() const
113         {
114             return ce_*k_*sqrt(k_)/delta();
115         }
117         //- Return viscosity
118         virtual tmp<volScalarField> muSgs() const
119         {
120             return muSgs_;
121         }
123         //- Return thermal diffusivity
124         virtual tmp<volScalarField> alphaSgs() const
125         {
126             return alphaSgs_;
127         }
129         //- Return thermal diffusivity
130         virtual tmp<volScalarField> alphaEff() const
131         {
132             return tmp<volScalarField>
133             (
134                 new volScalarField("alphaEff", alphaSgs_ + alpha())
135             );
136         }
138         //- Return the sub-grid stress tensor.
139         virtual tmp<volSymmTensorField> B() const;
141         //- Return the deviatoric part of the effective sub-grid
142         //  turbulence stress tensor including the laminar stress
143         virtual tmp<volSymmTensorField> devRhoBeff() const;
145         //- Returns div(rho*dev(B)).
146         // This is the additional term due to the filtering of the NSE.
147         virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const;
149         //- Correct Eddy-Viscosity and related properties
150         virtual void correct(const tmp<volTensorField>& gradU);
152         //- Read LESProperties dictionary
153         virtual bool read();
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace LESModels
160 } // End namespace compressible
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #endif
167 // ************************************************************************* //