INT: refactored kOmegaSST sigma extensions to restore previous v2206 behaviour

This commit is contained in:
Andrew Heather
2022-12-07 14:06:42 +00:00
parent 7441e18475
commit 8f63fd5230
6 changed files with 35 additions and 25 deletions

View File

@ -136,7 +136,6 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correctNut()
template<class BasicEddyViscosityModel>
Foam::tmp<Foam::volScalarField> kOmegaSSTBase<BasicEddyViscosityModel>::S2
(
const volScalarField& F1,
const volTensorField& gradU
) const
{
@ -169,8 +168,7 @@ template<class BasicEddyViscosityModel>
tmp<volScalarField::Internal> kOmegaSSTBase<BasicEddyViscosityModel>::GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
const volScalarField& /* S2 not used */
) const
{
return tmp<volScalarField::Internal>::New
@ -521,6 +519,14 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
fvc::div(fvc::absolute(this->phi(), U))
);
tmp<volTensorField> tgradU = fvc::grad(U);
const volScalarField S2(this->S2(tgradU()));
volScalarField::Internal GbyNu0(this->GbyNu0(tgradU(), S2));
volScalarField::Internal G(this->GName(), nut*GbyNu0);
// Update omega and G at the wall
omega_.boundaryFieldRef().updateCoeffs();
const volScalarField CDkOmega
(
(2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
@ -529,14 +535,6 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
const volScalarField F1(this->F1(CDkOmega));
const volScalarField F23(this->F23());
tmp<volTensorField> tgradU = fvc::grad(U);
const volScalarField S2(this->S2(F1, tgradU()));
volScalarField::Internal GbyNu0(this->GbyNu0(tgradU(), F1, S2));
volScalarField::Internal G(this->GName(), nut*GbyNu0);
// Update omega and G at the wall
omega_.boundaryFieldRef().updateCoeffs();
{
const volScalarField::Internal gamma(this->gamma(F1));
const volScalarField::Internal beta(this->beta(F1));

View File

@ -263,7 +263,6 @@ protected:
//- Return square of strain rate
virtual tmp<volScalarField> S2
(
const volScalarField& F1,
const volTensorField& gradU
) const;
@ -284,7 +283,6 @@ protected:
virtual tmp<volScalarField::Internal> GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const;

View File

@ -53,16 +53,26 @@ tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::fd
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::S2
(
const volScalarField& F1,
const volTensorField& gradU
) const
{
tmp<volScalarField> tS2 =
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::S2(F1, gradU);
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::S2(gradU);
if (this->useSigma_)
{
volScalarField& S2 = tS2.ref();
const volScalarField& k = this->k_;
const volScalarField& omega = this->omega_;
const volScalarField CDkOmega
(
(2*this->alphaOmega2_)*(fvc::grad(k) & fvc::grad(omega))/omega
);
const volScalarField F1(this->F1(CDkOmega));
const volScalarField CDES(this->CDES(F1));
const volScalarField Ssigma(this->Ssigma(gradU));
@ -98,7 +108,6 @@ template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDDES<BasicTurbulenceModel>::GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const
{
@ -108,7 +117,7 @@ tmp<volScalarField::Internal> kOmegaSSTDDES<BasicTurbulenceModel>::GbyNu0
}
return
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::GbyNu0(gradU, F1, S2);
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::GbyNu0(gradU, S2);
}

View File

@ -97,7 +97,6 @@ protected:
//- Return square of strain rate
virtual tmp<volScalarField> S2
(
const volScalarField& F1,
const volTensorField& gradU
) const;
@ -112,7 +111,6 @@ protected:
virtual tmp<volScalarField::Internal> GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const;

View File

@ -77,16 +77,26 @@ tmp<volScalarField> kOmegaSSTDES<BasicTurbulenceModel>::r
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTDES<BasicTurbulenceModel>::S2
(
const volScalarField& F1,
const volTensorField& gradU
) const
{
tmp<volScalarField> tS2 =
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::S2(F1, gradU);
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::S2(gradU);
if (this->useSigma_)
{
volScalarField& S2 = tS2.ref();
const volScalarField& k = this->k_;
const volScalarField& omega = this->omega_;
const volScalarField CDkOmega
(
(2*this->alphaOmega2_)*(fvc::grad(k) & fvc::grad(omega))/omega
);
const volScalarField F1(this->F1(CDkOmega));
const volScalarField CDES(this->CDES(F1));
const volScalarField dTilda(this->dTilda(mag(gradU), CDES));
const volScalarField lengthScaleRAS(this->lengthScaleRAS());
@ -128,7 +138,6 @@ template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDES<BasicTurbulenceModel>::GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const
{
@ -138,7 +147,7 @@ tmp<volScalarField::Internal> kOmegaSSTDES<BasicTurbulenceModel>::GbyNu0
}
return
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::GbyNu0(gradU, F1, S2);
kOmegaSSTBase<DESModel<BasicTurbulenceModel>>::GbyNu0(gradU, S2);
}

View File

@ -118,7 +118,6 @@ protected:
//- Return square of strain rate
virtual tmp<volScalarField> S2
(
const volScalarField& F1,
const volTensorField& gradU
) const;
@ -140,7 +139,6 @@ protected:
virtual tmp<volScalarField::Internal> GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const;