ENH: Spalart-Allmaras model - added user switch for ft2 term (default = off)

This commit is contained in:
Andrew Heather
2022-05-13 15:45:54 +01:00
parent e5cf96b0f9
commit 67ba5acf18
2 changed files with 31 additions and 5 deletions

View File

@ -72,10 +72,26 @@ tmp<volScalarField> SpalartAllmarasBase<BasicEddyViscosityModel>::ft2
(
const volScalarField& chi
) const
{
if (ft2_)
{
return Ct3_*exp(-Ct4_*sqr(chi));
}
return tmp<volScalarField>::New
(
IOobject
(
"ft2",
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ
),
this->mesh_,
dimensionedScalar(dimless, Zero)
);
}
template<class BasicEddyViscosityModel>
tmp<volScalarField> SpalartAllmarasBase<BasicEddyViscosityModel>::Omega
@ -268,6 +284,15 @@ SpalartAllmarasBase<BasicEddyViscosityModel>::SpalartAllmarasBase
0.07
)
),
ft2_
(
Switch::getOrAddToDict
(
"ft2",
this->coeffDict_,
false
)
),
Ct3_
(
dimensioned<scalar>::getOrAddToDict
@ -302,7 +327,7 @@ SpalartAllmarasBase<BasicEddyViscosityModel>::SpalartAllmarasBase
y_(wallDist::New(this->mesh_).y())
{
if (mag(Ct3_.value()) > SMALL)
if (ft2_)
{
Info<< "ft2 term: active" << nl;
}
@ -333,6 +358,7 @@ bool SpalartAllmarasBase<BasicEddyViscosityModel>::read()
ck_.readIfPresent(this->coeffDict());
ft2_.readIfPresent("ft2", this->coeffDict());
Ct3_.readIfPresent(this->coeffDict());
Ct4_.readIfPresent(this->coeffDict());

View File

@ -91,7 +91,7 @@ protected:
dimensionedScalar Cs_;
dimensionedScalar ck_;
Switch ft2_;
dimensionedScalar Ct3_;
dimensionedScalar Ct4_;