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 incompressible
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(oneEqEddy, 0);
41 addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
44 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
46 void oneEqEddy::updateSubGridScaleFields()
48 nuSgs_ = ck_*sqrt(k_)*delta();
49 nuSgs_.correctBoundaryConditions();
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57 const volVectorField& U,
58 const surfaceScalarField& phi,
59 transportModel& transport,
60 const word& turbulenceModelName,
64 LESModel(modelName, U, phi, transport, turbulenceModelName),
65 GenEddyVisc(U, phi, transport),
82 dimensioned<scalar>::lookupOrAddToDict
92 updateSubGridScaleFields();
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 void oneEqEddy::correct(const tmp<volTensorField>& gradU)
102 GenEddyVisc::correct(gradU);
104 tmp<volScalarField> G = 2.0*nuSgs_*magSqr(symm(gradU));
106 tmp<fvScalarMatrix> kEqn
109 + fvm::div(phi(), k_)
110 - fvm::laplacian(DkEff(), k_)
113 - fvm::Sp(ce_*sqrt(k_)/delta(), k_)
121 updateSubGridScaleFields();
125 bool oneEqEddy::read()
127 if (GenEddyVisc::read())
129 ck_.readIfPresent(coeffDict());
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 } // End namespace LESModels
143 } // End namespace incompressible
144 } // End namespace Foam
146 // ************************************************************************* //