1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 \*---------------------------------------------------------------------------*/
26 #include "GenEddyVisc.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace compressible
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 GenEddyVisc::GenEddyVisc
41 const volScalarField& rho,
42 const volVectorField& U,
43 const surfaceScalarField& phi,
44 const basicThermo& thermoPhysicalModel
49 word("GenEddyVisc"), rho, U, phi, thermoPhysicalModel
54 dimensioned<scalar>::lookupOrAddToDict
64 dimensioned<scalar>::lookupOrAddToDict
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
115 tmp<volSymmTensorField> GenEddyVisc::B() const
117 return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U())));
121 tmp<volSymmTensorField> GenEddyVisc::devRhoBeff() const
123 return -muEff()*dev(twoSymm(fvc::grad(U())));
127 tmp<fvVectorMatrix> GenEddyVisc::divDevRhoBeff(volVectorField& U) const
131 - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
136 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
138 LESModel::correct(gradU);
142 bool GenEddyVisc::read()
144 if (LESModel::read())
146 ce_.readIfPresent(coeffDict());
147 Prt_.readIfPresent(coeffDict());
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace LESModels
161 } // End namespace compressible
162 } // End namespace Foam
164 // ************************************************************************* //