initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / LES / mixedSmagorinsky / mixedSmagorinsky.C
bloba1558e78c3f141108b7bef10284b4d1028556ad5
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 \*---------------------------------------------------------------------------*/
27 #include "mixedSmagorinsky.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
34 namespace incompressible
36 namespace LESModels
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(mixedSmagorinsky, 0);
42 addToRunTimeSelectionTable(LESModel, mixedSmagorinsky, dictionary);
44 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
46 mixedSmagorinsky::mixedSmagorinsky
48     const volVectorField& U,
49     const surfaceScalarField& phi,
50     transportModel& transport
53     LESModel(typeName, U, phi, transport),
54     scaleSimilarity(U, phi, transport),
55     Smagorinsky(U, phi, transport)
57     printCoeffs();
61 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
63 tmp<volScalarField> mixedSmagorinsky::k() const
65     return
66     (
67         scaleSimilarity::k()
68       + Smagorinsky::k()
69     );
73 tmp<volScalarField> mixedSmagorinsky::epsilon() const
75     return
76     (
77         scaleSimilarity::epsilon()
78       + Smagorinsky::epsilon()
79     );
83 tmp<volSymmTensorField> mixedSmagorinsky::B() const
85     return
86     (
87         scaleSimilarity::B()
88       + Smagorinsky::B()
89     );
93 tmp<volSymmTensorField> mixedSmagorinsky::devBeff() const
95     return
96     (
97         scaleSimilarity::devBeff()
98       + Smagorinsky::devBeff()
99     );
103 tmp<fvVectorMatrix> mixedSmagorinsky::divDevBeff
105     volVectorField& U
106 ) const
108     return
109     (
110         scaleSimilarity::divDevBeff(U)
111       + Smagorinsky::divDevBeff(U)
112     );
116 void mixedSmagorinsky::correct(const tmp<volTensorField>& gradU)
118     scaleSimilarity::correct(gradU);
119     Smagorinsky::correct(gradU);
123 bool mixedSmagorinsky::read()
125     if (LESModel::read())
126     {
127         scaleSimilarity::read();
128         Smagorinsky::read();
130         return true;
131     }
132     else
133     {
134         return false;
135     }
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace LESModels
142 } // End namespace incompressible
143 } // End namespace Foam
145 // ************************************************************************* //