1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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
62 LESModel(typeName, U, phi, transport),
63 GenEddyVisc(U, phi, transport),
80 dimensionedScalar::lookupOrAddToDict
88 updateSubGridScaleFields();
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96 void oneEqEddy::correct(const tmp<volTensorField>& gradU)
98 GenEddyVisc::correct(gradU);
100 volScalarField G = 2.0*nuSgs_*magSqr(symm(gradU));
105 + fvm::div(phi(), k_)
106 - fvm::laplacian(DkEff(), k_)
109 - fvm::Sp(ce_*sqrt(k_)/delta(), k_)
117 updateSubGridScaleFields();
121 bool oneEqEddy::read()
123 if (GenEddyVisc::read())
125 ck_.readIfPresent(coeffDict());
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 } // End namespace LESModels
139 } // End namespace incompressible
140 } // End namespace Foam
142 // ************************************************************************* //