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 "GenSGSStress.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace compressible
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameWithName(GenSGSStress, "GenSGSStress");
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 GenSGSStress::GenSGSStress
46 const volScalarField& rho,
47 const volVectorField& U,
48 const surfaceScalarField& phi,
49 const basicThermo& thermoPhysicalModel,
50 const word& turbulenceModelName,
54 LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
58 dimensioned<scalar>::lookupOrAddToDict
68 dimensioned<scalar>::lookupOrAddToDict
117 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
119 tmp<volSymmTensorField> GenSGSStress::devRhoBeff() const
121 return tmp<volSymmTensorField>
123 new volSymmTensorField
133 rho()*B_ - mu()*dev(twoSymm(fvc::grad(U())))
139 tmp<fvVectorMatrix> GenSGSStress::divDevRhoBeff(volVectorField& U) const
143 fvc::div(rho()*B_ + 0.05*muSgs_*fvc::grad(U))
144 + fvc::laplacian(0.95*muSgs_, U, "laplacian(muEff,U)")
145 - fvm::laplacian(muEff(), U)
146 - fvc::div(mu()*dev2(T(fvc::grad(U))))
151 void GenSGSStress::correct(const tmp<volTensorField>& gradU)
153 LESModel::correct(gradU);
157 bool GenSGSStress::read()
159 if (LESModel::read())
161 ce_.readIfPresent(coeffDict());
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace LESModels
175 } // End namespace compressible
176 } // End namespace Foam
178 // ************************************************************************* //