1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-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 incompressible
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameWithName(GenEddyVisc, "GenEddyVisc");
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 GenEddyVisc::GenEddyVisc
46 const volVectorField& U,
47 const surfaceScalarField& phi,
48 transportModel& transport,
49 const word& turbulenceModelName,
53 LESModel(modelName, U, phi, transport, turbulenceModelName),
57 dimensioned<scalar>::lookupOrAddToDict
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 tmp<volSymmTensorField> GenEddyVisc::B() const
86 return ((2.0/3.0)*I)*k() - nuSgs_*twoSymm(fvc::grad(U()));
90 tmp<volSymmTensorField> GenEddyVisc::devBeff() const
92 return -nuEff()*dev(twoSymm(fvc::grad(U())));
96 tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const
100 - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
105 void GenEddyVisc::correct(const tmp<volTensorField>& gradU)
107 LESModel::correct(gradU);
111 bool GenEddyVisc::read()
113 if (LESModel::read())
115 ce_.readIfPresent(coeffDict());
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace LESModels
129 } // End namespace incompressible
130 } // End namespace Foam
132 // ************************************************************************* //