diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new deleted file mode 100644 index b28e14bce9..0000000000 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new +++ /dev/null @@ -1,419 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "kOmegaSST.H" -#include "addToRunTimeSelectionTable.H" - -#include "backwardsCompatibilityWallFunctions.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(kOmegaSST, 0); -addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); - -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -tmp kOmegaSST::F1(const volScalarField& CDkOmega) const -{ - volScalarField CDkOmegaPlus = max - ( - CDkOmega, - dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) - ); - - volScalarField arg1 = min - ( - min - ( - max - ( - (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_), - scalar(500)*nu()/(sqr(y_)*omega_) - ), - (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_)) - ), - scalar(10) - ); - - return tanh(pow4(arg1)); -} - -tmp kOmegaSST::F2() const -{ - volScalarField arg2 = min - ( - max - ( - (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_), - scalar(500)*nu()/(sqr(y_)*omega_) - ), - scalar(100) - ); - - return tanh(sqr(arg2)); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -kOmegaSST::kOmegaSST -( - const volVectorField& U, - const surfaceScalarField& phi, - transportModel& lamTransportModel -) -: - RASModel(typeName, U, phi, lamTransportModel), - - alphaK1_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaK1", - coeffDict_, - 0.85034 - ) - ), - alphaK2_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaK2", - coeffDict_, - 1.0 - ) - ), - alphaOmega1_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaOmega1", - coeffDict_, - 0.5 - ) - ), - alphaOmega2_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaOmega2", - coeffDict_, - 0.85616 - ) - ), - gamma1_ - ( - dimensioned::lookupOrAddToDict - ( - "gamma1", - coeffDict_, - 0.5532 - ) - ), - gamma2_ - ( - dimensioned::lookupOrAddToDict - ( - "gamma2", - coeffDict_, - 0.4403 - ) - ), - beta1_ - ( - dimensioned::lookupOrAddToDict - ( - "beta1", - coeffDict_, - 0.075 - ) - ), - beta2_ - ( - dimensioned::lookupOrAddToDict - ( - "beta2", - coeffDict_, - 0.0828 - ) - ), - betaStar_ - ( - dimensioned::lookupOrAddToDict - ( - "betaStar", - coeffDict_, - 0.09 - ) - ), - a1_ - ( - dimensioned::lookupOrAddToDict - ( - "a1", - coeffDict_, - 0.31 - ) - ), - c1_ - ( - dimensioned::lookupOrAddToDict - ( - "c1", - coeffDict_, - 10.0 - ) - ), - - y_(mesh_), - - k_ - ( - IOobject - ( - "k", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateK("k", mesh_) - ), - omega_ - ( - IOobject - ( - "omega", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateOmega("omega", mesh_) - ), - nut_ - ( - IOobject - ( - "nut", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateNut("nut", mesh_) - ) -{ - nut_ = - a1_*k_ - /max - ( - a1_*(omega_ + omegaSmall_), - F2()*mag(symm(fvc::grad(U_))) - ); - nut_.correctBoundaryConditions(); - - printCoeffs(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp kOmegaSST::R() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - "R", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), - k_.boundaryField().types() - ) - ); -} - - -tmp kOmegaSST::devReff() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - "devRhoReff", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - -nuEff()*dev(twoSymm(fvc::grad(U_))) - ) - ); -} - - -tmp kOmegaSST::divDevReff(volVectorField& U) const -{ - return - ( - - fvm::laplacian(nuEff(), U) - - fvc::div(nuEff()*dev(fvc::grad(U)().T())) - ); -} - - -bool kOmegaSST::read() -{ - if (RASModel::read()) - { - alphaK1_.readIfPresent(coeffDict()); - alphaK2_.readIfPresent(coeffDict()); - alphaOmega1_.readIfPresent(coeffDict()); - alphaOmega2_.readIfPresent(coeffDict()); - gamma1_.readIfPresent(coeffDict()); - gamma2_.readIfPresent(coeffDict()); - beta1_.readIfPresent(coeffDict()); - beta2_.readIfPresent(coeffDict()); - betaStar_.readIfPresent(coeffDict()); - a1_.readIfPresent(coeffDict()); - c1_.readIfPresent(coeffDict()); - - return true; - } - else - { - return false; - } -} - - -void kOmegaSST::correct() -{ - RASModel::correct(); - - if (!turbulence_) - { - return; - } - - if (mesh_.changing()) - { - y_.correct(); - } - - volScalarField S2 = magSqr(symm(fvc::grad(U_))); - volScalarField G("RASModel.G", nut_*2*S2); - - // Update omega and G at the wall - omega_.boundaryField().updateCoeffs(); - - volScalarField F1 = this->F1 - ( - (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ - ); - - // Epsilon diffusion correction - surfaceScalarField CDkPhiOmega - ( - "CDkPhiOmega", - (2*alphaOmega2_) - *fvc::interpolate(F1 - scalar(1)) - /fvc::interpolate(omega_) - *fvc::snGrad(k_)*mesh_.magSf() - ); - - forAll (CDkPhiOmega.boundaryField(), patchi) - { - if (!CDkPhiOmega.boundaryField()[patchi].coupled()) - { - CDkPhiOmega.boundaryField()[patchi] = 0.0; - } - } - - // Turbulent frequency equation - tmp omegaEqn - ( - fvm::ddt(omega_) - + fvm::div(phi_, omega_) - - fvm::laplacian(DomegaEff(F1), omega_) - + fvm::div(CDkPhiOmega, omega_) - == - gamma(F1)*2*S2 - - fvm::Sp(beta(F1)*omega_, omega_) - ); - - omegaEqn().relax(); - - omegaEqn().boundaryManipulate(omega_.boundaryField()); - - solve(omegaEqn); - bound(omega_, omega0_); - - // Turbulent kinetic energy equation - tmp kEqn - ( - fvm::ddt(k_) - + fvm::div(phi_, k_) - - fvm::laplacian(DkEff(F1), k_) - == - min(G, c1_*betaStar_*k_*omega_) - - fvm::Sp(betaStar_*omega_, k_) - ); - - kEqn().relax(); - solve(kEqn); - bound(k_, k0_); - - - // Re-calculate viscosity - nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); - nut_.correctBoundaryConditions(); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// ************************************************************************* //