ENH: Minor code clean-up

This commit is contained in:
andy 2015-12-22 22:04:02 +00:00
parent 72be4b372d
commit cfe2d32c77
4 changed files with 26 additions and 33 deletions

View File

@ -143,7 +143,7 @@ class DEShybrid
//- Maximum bound for sigma (0 <= sigmaMax <= 1)
scalar sigmaMax_;
//- constants of scheme
//- Scheme constants
scalar CH1_;
scalar CH2_;
scalar CH3_;
@ -174,11 +174,11 @@ class DEShybrid
const volScalarField B
(
CH3_*Omega*max(S, Omega)
/max(0.5*(sqr(S)+sqr(Omega)), sqr(1.0e-3/tau0_))
/max(0.5*(sqr(S) + sqr(Omega)), sqr(1.0e-3/tau0_))
);
const volScalarField K
(
max(Foam::sqrt(0.5*(sqr(S)+sqr(Omega))), 0.1/tau0_)
max(Foam::sqrt(0.5*(sqr(S) + sqr(Omega))), 0.1/tau0_)
);
const volScalarField lTurb(Foam::sqrt(nuEff/(pow(0.09, 1.5)*K)));
@ -188,11 +188,11 @@ class DEShybrid
CH2_*max(scalar(0), CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5)
);
const volScalarField IOhybrid
const volScalarField factor
(
IOobject
(
"DEShybridFactor",
typeName + ":Factor",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
@ -200,17 +200,18 @@ class DEShybrid
),
max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_)
);
if (this->mesh().time().outputTime())
{
IOhybrid.write();
}
// if (this->mesh().time().outputTime())
// {
// factor.write();
// }
return tmp<surfaceScalarField>
(
new surfaceScalarField
(
vf.name() + "BlendingFactor",
fvc::interpolate(IOhybrid)
fvc::interpolate(factor)
)
);
}

View File

@ -82,7 +82,7 @@ tmp<volScalarField> SpalartAllmarasDDES<BasicTurbulenceModel>::dTilda
const volTensorField& gradU
) const
{
const volScalarField lRAS(this->y_);
const volScalarField& lRAS(this->y_);
const volScalarField lLES(this->psi(chi, fv1)*this->CDES_*this->delta());
return max

View File

@ -93,7 +93,7 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::rd
magGradU,
dimensionedScalar("SMALL", magGradU.dimensions(), SMALL)
)
*sqr(this->kappa_*this->y_)
*sqr(this->kappa_*this->y_)
),
scalar(10)
)
@ -127,7 +127,7 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::dTilda
const volScalarField magGradU(mag(gradU));
const volScalarField psi(this->psi(chi, fv1));
const volScalarField lRAS(this->y_);
const volScalarField& lRAS(this->y_);
const volScalarField lLES(psi*this->CDES_*this->delta());
const volScalarField alpha(this->alpha());
@ -142,20 +142,16 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::dTilda
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
/*
return max
(
fdTilda*lRAS
+ (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL)
);
*/
// return max
// (
// fdTilda*lRAS + (1 - fdTilda)*lLES,
// dimensionedScalar("SMALL", dimLength, SMALL)
// );
// Original formulation from Shur et al. paper (2008)
return max
(
fdTilda*(1 + fe)*lRAS
+ (1 - fdTilda)*lLES,
fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL)
);
}

View File

@ -141,20 +141,16 @@ tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::dTilda
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
/*
return max
(
fdTilda*lRAS
+ (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL)
);
*/
// return max
// (
// fdTilda*lRAS + (1 - fdTilda)*lLES,
// dimensionedScalar("SMALL", dimLength, SMALL)
// );
// Original formulation from Shur et al. paper (2008)
return max
(
fdTilda*(1 + fe)*lRAS
+ (1 - fdTilda)*lLES,
fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES,
dimensionedScalar("SMALL", dimLength, SMALL)
);
}