1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 "oneEqEddy.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace compressible
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(oneEqEddy, 0);
41 addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
43 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45 void oneEqEddy::updateSubGridScaleFields()
47 muSgs_ = ck_*rho()*sqrt(k_)*delta();
48 muSgs_.correctBoundaryConditions();
50 alphaSgs_ = muSgs_/Prt_;
51 alphaSgs_.correctBoundaryConditions();
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
59 const volScalarField& rho,
60 const volVectorField& U,
61 const surfaceScalarField& phi,
62 const basicThermo& thermoPhysicalModel,
63 const word& turbulenceModelName,
67 LESModel(modelName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
68 GenEddyVisc(rho, U, phi, thermoPhysicalModel),
85 dimensioned<scalar>::lookupOrAddToDict
93 updateSubGridScaleFields();
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 void oneEqEddy::correct(const tmp<volTensorField>& tgradU)
103 const volTensorField& gradU = tgradU();
105 GenEddyVisc::correct(gradU);
107 volScalarField divU(fvc::div(phi()/fvc::interpolate(rho())));
108 volScalarField G(2*muSgs_*(gradU && dev(symm(gradU))));
110 tmp<fvScalarMatrix> kEqn
113 + fvm::div(phi(), k_)
114 - fvm::laplacian(DkEff(), k_)
117 - fvm::SuSp(2.0/3.0*rho()*divU, k_)
118 - fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_)
126 updateSubGridScaleFields();
130 bool oneEqEddy::read()
132 if (GenEddyVisc::read())
134 ck_.readIfPresent(coeffDict());
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 } // End namespace LESModels
148 } // End namespace compressible
149 } // End namespace Foam
151 // ************************************************************************* //