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 "kOmegaSSTSAS.H"
27 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace incompressible
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(kOmegaSSTSAS, 0);
42 addToRunTimeSelectionTable(LESModel, kOmegaSSTSAS, dictionary);
44 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
46 void kOmegaSSTSAS::updateSubGridScaleFields(const volScalarField& S2)
48 nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
49 nuSgs_.correctBoundaryConditions();
53 tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const
55 tmp<volScalarField> CDkOmegaPlus = max
58 dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10)
61 tmp<volScalarField> arg1 = min
67 (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_),
68 scalar(500)*nu()/(sqr(y_)*omega_)
70 (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_))
75 return tanh(pow4(arg1));
79 tmp<volScalarField> kOmegaSSTSAS::F2() const
81 tmp<volScalarField> arg2 = min
85 (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_),
86 scalar(500)*nu()/(sqr(y_)*omega_)
91 return tanh(sqr(arg2));
95 tmp<volScalarField> kOmegaSSTSAS::Lvk2
97 const volScalarField& S2
104 mag(fvc::laplacian(U()))
108 dimensionSet(0, -1 , -1, 0, 0, 0, 0),
117 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
119 kOmegaSSTSAS::kOmegaSSTSAS
121 const volVectorField& U,
122 const surfaceScalarField& phi,
123 transportModel& transport,
124 const word& turbulenceModelName,
125 const word& modelName
128 LESModel(modelName, U, phi, transport, turbulenceModelName),
132 dimensioned<scalar>::lookupOrAddToDict
141 dimensioned<scalar>::lookupOrAddToDict
150 dimensioned<scalar>::lookupOrAddToDict
159 dimensioned<scalar>::lookupOrAddToDict
168 dimensioned<scalar>::lookupOrAddToDict
177 dimensioned<scalar>::lookupOrAddToDict
186 dimensioned<scalar>::lookupOrAddToDict
195 dimensioned<scalar>::lookupOrAddToDict
204 dimensioned<scalar>::lookupOrAddToDict
213 dimensioned<scalar>::lookupOrAddToDict
222 dimensioned<scalar>::lookupOrAddToDict
231 dimensioned<scalar>::lookupOrAddToDict
240 dimensioned<scalar>::lookupOrAddToDict
249 dimensioned<scalar>::lookupOrAddToDict
258 dimensioned<scalar>::lookupOrAddToDict
266 omegaMin_("omegaMin", dimless/dimTime, SMALL),
270 dimensioned<scalar>::lookupOrAddToDict
279 dimensioned<scalar>::lookupOrAddToDict
326 omegaMin_.readIfPresent(*this);
329 bound(omega_, omegaMin_);
331 updateSubGridScaleFields(2.0*magSqr(symm(fvc::grad(U))));
337 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
339 void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
341 LESModel::correct(gradU);
343 if (mesh_.changing())
348 volScalarField S2(2.0*magSqr(symm(gradU())));
351 volVectorField gradK(fvc::grad(k_));
352 volVectorField gradOmega(fvc::grad(omega_));
353 volScalarField L(sqrt(k_)/(pow025(Cmu_)*omega_));
354 volScalarField CDkOmega((2.0*alphaOmega2_)*(gradK & gradOmega)/omega_);
355 volScalarField F1(this->F1(CDkOmega));
356 volScalarField G(nuSgs_*0.5*S2);
358 // Turbulent kinetic energy equation
363 + fvm::div(phi(), k_)
364 - fvm::Sp(fvc::div(phi()), k_)
365 - fvm::laplacian(DkEff(F1), k_)
367 min(G, c1_*betaStar_*k_*omega_)
368 - fvm::Sp(betaStar_*omega_, k_)
376 tmp<volScalarField> grad_omega_k = max
378 magSqr(gradOmega)/sqr(omega_),
379 magSqr(gradK)/sqr(k_)
382 // Turbulent frequency equation
384 fvScalarMatrix omegaEqn
387 + fvm::div(phi(), omega_)
388 - fvm::Sp(fvc::div(phi()), omega_)
389 - fvm::laplacian(DomegaEff(F1), omega_)
392 - fvm::Sp(beta(F1)*omega_, omega_)
393 - fvm::SuSp // cross diffusion term
395 (F1 - scalar(1))*CDkOmega/omega_,
401 dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
402 zetaTilda2_*kappa_*S2*sqr(L/Lvk2(S2))
403 - 2.0/alphaPhi_*k_*grad_omega_k
410 bound(omega_, omegaMin_);
412 updateSubGridScaleFields(S2);
416 tmp<volScalarField> kOmegaSSTSAS::epsilon() const
418 return 2.0*nuEff()*magSqr(symm(fvc::grad(U())));
422 tmp<volSymmTensorField> kOmegaSSTSAS::B() const
424 return ((2.0/3.0)*I)*k() - nuSgs()*twoSymm(fvc::grad(U()));
428 tmp<volSymmTensorField> kOmegaSSTSAS::devBeff() const
430 return -nuEff()*dev(twoSymm(fvc::grad(U())));
434 tmp<fvVectorMatrix> kOmegaSSTSAS::divDevBeff(volVectorField& U) const
438 - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
443 bool kOmegaSSTSAS::read()
445 if (LESModel::read())
447 alphaK1_.readIfPresent(coeffDict());
448 alphaK2_.readIfPresent(coeffDict());
449 alphaOmega1_.readIfPresent(coeffDict());
450 alphaOmega2_.readIfPresent(coeffDict());
451 gamma1_.readIfPresent(coeffDict());
452 gamma2_.readIfPresent(coeffDict());
453 beta1_.readIfPresent(coeffDict());
454 beta2_.readIfPresent(coeffDict());
455 betaStar_.readIfPresent(coeffDict());
456 a1_.readIfPresent(coeffDict());
457 c1_.readIfPresent(coeffDict());
458 Cs_.readIfPresent(coeffDict());
459 alphaPhi_.readIfPresent(coeffDict());
460 zetaTilda2_.readIfPresent(coeffDict());
461 FSAS_.readIfPresent(coeffDict());
463 omegaMin_.readIfPresent(*this);
474 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
476 } // End namespace LESModels
477 } // End namespace incompressible
478 } // End namespace Foam
480 // ************************************************************************* //