Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / turbulenceModels / incompressible / LES / locDynOneEqEddy / locDynOneEqEddy.H
blob177b326ac8723c9c86401f0a62b8d8f6042607de
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::incompressible::LESModels::locDynOneEqEddy
27 Description
28     Localised Dynamic One Equation Eddy Viscosity Model for incompressible
29     flows
31     Eddy viscosity SGS model using a modeled balance equation to simulate
32     the behaviour of k, hence
33     @verbatim
34         d/dt(k) + div(U*k) - div(nuSgs*grad(k))
35         =
36         -B*L - ce*rho*k^3/2/delta
37     and
38         B = 2/3*k*I - 2*nuSgs*dev(D)
39         Beff = 2/3*k*I - 2*nuEff*dev(D)
40     where
41         nuSgs = cD*delta^2*||D||
42         nuEff = nuSgs + nu
43     @endverbatim
45     A dynamic procedure is here applied to evaluate ck and ce
46     @verbatim
47         ck=<L.M>/<M.M>
48     and
49         ce=<e*m>/<m*m>
50     where
51        K = 0.5*(F(U.U) - F(U).F(U))
52        L = (F(U*U) - F(U)*F(U) - 0.33*K*I)
53        M = delta*(F(sqrt(k)*D) - 2*sqrt(K + filter(k))*F(D))
54        m = pow(K + F(k), 3.0/2.0)/(2*delta) - F(pow(k, 3.0/2.0))/delta
55        e = 2*delta*ck*(F(sqrt(k)*(D && D)) - 2*sqrt(K + F(k))*(F(D) && F(D)))/
56     @endverbatim
58 SourceFiles
59     locDynOneEqEddy.C
61 \*---------------------------------------------------------------------------*/
63 #ifndef locDynOneEqEddy_H
64 #define locDynOneEqEddy_H
66 #include "GenEddyVisc.H"
67 #include "simpleFilter.H"
68 #include "LESfilter.H"
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 namespace Foam
74 namespace incompressible
76 namespace LESModels
79 /*---------------------------------------------------------------------------*\
80                            Class locDynOneEqEddy Declaration
81 \*---------------------------------------------------------------------------*/
83 class locDynOneEqEddy
85     public GenEddyVisc
87     // Private data
89         volScalarField k_;
91         simpleFilter simpleFilter_;
92         autoPtr<LESfilter> filterPtr_;
93         LESfilter& filter_;
96     // Private Member Functions
98         //- Update sub-grid scale fields
99         void updateSubGridScaleFields
100         (
101             const volSymmTensorField& D,
102             const volScalarField& KK
103         );
105         //- Calculate ck, ce by filtering the velocity field U.
106         volScalarField ck
107         (
108             const volSymmTensorField&,
109             const volScalarField&
110         ) const;
112         volScalarField ce
113         (
114             const volSymmTensorField&,
115             const volScalarField&
116         ) const;
118         // Disallow default bitwise copy construct and assignment
119         locDynOneEqEddy(const locDynOneEqEddy&);
120         locDynOneEqEddy& operator=(const locDynOneEqEddy&);
123 public:
125     //- Runtime type information
126     TypeName("locDynOneEqEddy");
128     // Constructors
130         //- Construct from components
131         locDynOneEqEddy
132         (
133             const volVectorField& U,
134             const surfaceScalarField& phi,
135             transportModel& transport
136         );
139     //- Destructor
140     virtual ~locDynOneEqEddy()
141     {}
144     // Member Functions
146         //- Return SGS kinetic energy
147         virtual tmp<volScalarField> k() const
148         {
149             return k_;
150         }
152         //- Return the effective diffusivity for k
153         tmp<volScalarField> DkEff() const
154         {
155             return tmp<volScalarField>
156             (
157                 new volScalarField("DkEff", nuSgs_ + nu())
158             );
159         }
161         //- Correct Eddy-Viscosity and related properties
162         virtual void correct(const tmp<volTensorField>& gradU);
164         //- Read LESProperties dictionary
165         virtual bool read();
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace LESModels
172 } // End namespace incompressible
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //