void kOmega::correct() { RASModel::correct(); if (!turbulence_) { return; } volScalarField G("RASModel::G", nut_*2*magSqr(symm(fvc::grad(U_)))); // Update omega and G at the wall omega_.boundaryField().updateCoeffs(); // Turbulence specific dissipation rate equation tmp<fvScalarMatrix> omegaEqn ( fvm::ddt(omega_) + fvm::div(phi_, omega_) - fvm::Sp(fvc::div(phi_), omega_) - fvm::laplacian(DomegaEff(), omega_) == alpha_*G*omega_/k_ - fvm::Sp(beta_*omega_, omega_) ); omegaEqn().relax(); omegaEqn().boundaryManipulate(omega_.boundaryField()); solve(omegaEqn); bound(omega_, omega0_); // Turbulent kinetic energy equation tmp<fvScalarMatrix> kEqn ( fvm::ddt(k_) + fvm::div(phi_, k_) - fvm::Sp(fvc::div(phi_), k_) - fvm::laplacian(DkEff(), k_) == G - fvm::Sp(Cmu_*omega_, k_) ); kEqn().relax(); solve(kEqn); bound(k_, k0_); // Re-calculate viscosity nut_ = k_/(omega_ + omegaSmall_); nut_.correctBoundaryConditions(); }
void gammaSST<BasicTurbulenceModel>::correct() { if (!this->turbulence_) { return; } // Local references const alphaField& alpha = this->alpha_; const rhoField& rho = this->rho_; const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_; const volVectorField& U = this->U_; volScalarField& nut = this->nut_; volScalarField& omega_ = this->omega_; volScalarField& k_ = this->k_; eddyViscosity<RASModel<BasicTurbulenceModel> >::correct(); volScalarField divU(fvc::div(fvc::absolute(this->phi(), U))); tmp<volTensorField> tgradU = fvc::grad(U); const volScalarField S2(2*magSqr(symm(tgradU()))); const volScalarField S("S", sqrt(S2)); const volScalarField W("Omega", sqrt(2*magSqr(skew(tgradU())))); volScalarField G(this->GName(), nut*S*W); tgradU.clear(); // Update omega and G at the wall omega_.boundaryFieldRef().updateCoeffs(); const volScalarField CDkOmega ( "CD", (2*this->alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ ); const volScalarField F1("F1", this->F1(CDkOmega)); { volScalarField gamma(this->gamma(F1)); volScalarField beta(this->beta(F1)); // Turbulent frequency equation tmp<fvScalarMatrix> omegaEqn ( fvm::ddt(alpha, rho, omega_) + fvm::div(alphaRhoPhi, omega_) - fvm::laplacian(alpha*rho*this->DomegaEff(F1), omega_) == alpha*rho*gamma*S*W - fvm::Sp(alpha*rho*beta*omega_, omega_) - fvm::SuSp ( alpha*rho*(F1 - scalar(1))*CDkOmega/omega_, omega_ ) ); omegaEqn.ref().relax(); omegaEqn.ref().boundaryManipulate(omega_.boundaryFieldRef()); solve(omegaEqn); bound(omega_, this->omegaMin_); } // Turbulent kinetic energy equation const volScalarField FonLim( "FonLim", min( max(sqr(this->y_)*S/this->nu() / ( 2.2*ReThetacLim_) - 1., 0.), 3.) ); const volScalarField PkLim( "PkLim", 5*Ck_ * max(gammaInt()-0.2,0.) * (1-gammaInt()) * FonLim * max(3*CSEP_*this->nu() - this->nut_, 0.*this->nut_) * S * W ); tmp<fvScalarMatrix> kEqn ( fvm::ddt(alpha, rho, k_) + fvm::div(alphaRhoPhi, k_) - fvm::laplacian(alpha*rho*this->DkEff(F1), k_) == alpha*rho*(G*gammaInt() + PkLim) - fvm::Sp(max(gammaInt(),scalar(0.1)) * alpha*rho*this->betaStar_*omega_, k_) ); kEqn.ref().relax(); solve(kEqn); bound(k_, this->kMin_); this->correctNut(S2, this->F23()); // Intermittency equation (2) volScalarField Pgamma1 = Flength_ * S * gammaInt_ * Fonset(S); volScalarField Pgamma2 = ca2_ * W * gammaInt_ * Fturb(); tmp<fvScalarMatrix> gammaEqn ( fvm::ddt(alpha, rho, gammaInt_) + fvm::div(alphaRhoPhi, gammaInt_) - fvm::laplacian(alpha*rho*this->DgammaEff(), gammaInt_) == alpha*rho*Pgamma1 - fvm::Sp(alpha*rho*Pgamma1, gammaInt_) + alpha*rho*Pgamma2 - fvm::Sp(alpha*rho*ce2_*Pgamma2, gammaInt_) ); gammaEqn.ref().relax(); solve(gammaEqn); bound(gammaInt_,scalar(0)); if (debug && this->runTime_.outputTime()) { S.write(); W.write(); F1.write(); CDkOmega.write(); const volScalarField Pgamma("Pgamma", Pgamma1*(scalar(1)-gammaInt_)); Pgamma.write(); const volScalarField Egamma("Egamma", Pgamma2*(scalar(1)-ce2_*gammaInt_)); Egamma.write(); FonLim.write(); PkLim.write(); Fonset(S)().write(); FPG()().write(); } }