1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "spectEddyVisc.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace incompressible
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(spectEddyVisc, 0);
42 addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary);
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 spectEddyVisc::spectEddyVisc
49 const volVectorField& U,
50 const surfaceScalarField& phi,
51 transportModel& transport
54 LESModel(typeName, U, phi, transport),
55 GenEddyVisc(U, phi, transport),
60 dimensioned<scalar>::lookupOrAddToDict
69 dimensioned<scalar>::lookupOrAddToDict
78 dimensioned<scalar>::lookupOrAddToDict
87 dimensioned<scalar>::lookupOrAddToDict
96 dimensioned<scalar>::lookupOrAddToDict
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 tmp<volScalarField> spectEddyVisc::k() const
112 volScalarField Eps = 2*nuEff()*magSqr(symm(fvc::grad(U())));
115 cK1_*pow(delta(), 2.0/3.0)*pow(Eps, 2.0/3.0)
116 *exp(-cK2_*pow(delta(), -4.0/3.0)*nu()/pow(Eps, 1.0/3.0))
117 - cK3_*pow(Eps*nu(), 1.0/2.0)
118 *erfc(cK4_*pow(delta(), -2.0/3.0)*pow(Eps, -1.0/6.0));
122 void spectEddyVisc::correct(const tmp<volTensorField>& gradU)
124 GenEddyVisc::correct(gradU);
126 volScalarField Re = sqr(delta())*mag(symm(gradU))/nu();
128 for (label i=0; i<5; i++)
134 - exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0))
138 nuSgs_.correctBoundaryConditions();
142 bool spectEddyVisc::read()
144 if (GenEddyVisc::read())
146 cB_.readIfPresent(coeffDict());
147 cK1_.readIfPresent(coeffDict());
148 cK2_.readIfPresent(coeffDict());
149 cK3_.readIfPresent(coeffDict());
150 cK4_.readIfPresent(coeffDict());
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 } // End namespace LESModels
164 } // End namespace incompressible
165 } // End namespace Foam
167 // ************************************************************************* //