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

View File

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