1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 "LienLeschzinerLowRe.H"
28 #include "wallFvPatch.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace incompressible
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 defineTypeNameAndDebug(LienLeschzinerLowRe, 0);
43 addToRunTimeSelectionTable(RASModel, LienLeschzinerLowRe, dictionary);
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 LienLeschzinerLowRe::LienLeschzinerLowRe
49 const volVectorField& U,
50 const surfaceScalarField& phi,
51 transportModel& lamTransportModel
54 RASModel(typeName, U, phi, lamTransportModel),
58 dimensioned<scalar>::lookupOrAddToDict
67 dimensioned<scalar>::lookupOrAddToDict
76 dimensioned<scalar>::lookupOrAddToDict
85 dimensioned<scalar>::lookupOrAddToDict
94 dimensioned<scalar>::lookupOrAddToDict
103 dimensioned<scalar>::lookupOrAddToDict
112 dimensioned<scalar>::lookupOrAddToDict
121 dimensioned<scalar>::lookupOrAddToDict
130 dimensioned<scalar>::lookupOrAddToDict
166 yStar_(sqrt(k_)*y_/nu() + SMALL),
170 Cmu_*(scalar(1) - exp(-Am_*yStar_))
171 /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)*sqr(k_)
172 /(epsilon_ + epsilonSmall_)
179 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
181 tmp<volSymmTensorField> LienLeschzinerLowRe::R() const
183 volTensorField gradU = fvc::grad(U_);
185 return tmp<volSymmTensorField>
187 new volSymmTensorField
197 ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU),
198 k_.boundaryField().types()
204 tmp<volSymmTensorField> LienLeschzinerLowRe::devReff() const
206 return tmp<volSymmTensorField>
208 new volSymmTensorField
218 -nuEff()*dev(twoSymm(fvc::grad(U_)))
224 tmp<fvVectorMatrix> LienLeschzinerLowRe::divDevReff(volVectorField& U) const
228 - fvm::laplacian(nuEff(), U)
229 //- (fvc::grad(U) & fvc::grad(nuEff()))
230 - fvc::div(nuEff()*fvc::grad(U)().T())
235 bool LienLeschzinerLowRe::read()
237 if (RASModel::read())
239 C1_.readIfPresent(coeffDict());
240 C2_.readIfPresent(coeffDict());
241 sigmak_.readIfPresent(coeffDict());
242 sigmaEps_.readIfPresent(coeffDict());
243 Cmu_.readIfPresent(coeffDict());
244 Am_.readIfPresent(coeffDict());
245 Aepsilon_.readIfPresent(coeffDict());
246 Amu_.readIfPresent(coeffDict());
257 void LienLeschzinerLowRe::correct()
266 if (mesh_.changing())
271 scalar Cmu75 = pow(Cmu_.value(), 0.75);
273 volTensorField gradU = fvc::grad(U_);
276 volScalarField S2 = symm(gradU) && gradU;
278 yStar_ = sqrt(k_)*y_/nu() + SMALL;
279 volScalarField Rt = sqr(k_)/(nu()*epsilon_);
282 (scalar(1) - exp(-Am_*yStar_))
283 /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL);
285 volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt));
287 volScalarField G = Cmu_*fMu*sqr(k_)/epsilon_*S2;
290 // Dissipation equation
291 tmp<fvScalarMatrix> epsEqn
294 + fvm::div(phi_, epsilon_)
295 - fvm::laplacian(DepsilonEff(), epsilon_)
299 + C2_*f2*Cmu75*pow(k_, scalar(0.5))
300 /(kappa_*y_*(scalar(1) - exp(-Aepsilon_*yStar_)))
301 *exp(-Amu_*sqr(yStar_))*epsilon_
302 - fvm::Sp(C2_*f2*epsilon_/k_, epsilon_)
307 # include "LienLeschzinerLowReSetWallDissipation.H"
308 # include "wallDissipationI.H"
311 bound(epsilon_, epsilon0_);
314 // Turbulent kinetic energy equation
316 tmp<fvScalarMatrix> kEqn
320 - fvm::laplacian(DkEff(), k_)
323 - fvm::Sp(epsilon_/k_, k_)
331 // Re-calculate viscosity
332 nut_ = Cmu_*fMu*sqr(k_)/epsilon_;
336 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
338 } // End namespace RASModels
339 } // End namespace incompressible
340 } // End namespace Foam
342 // ************************************************************************* //