mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Minor code clean-up
This commit is contained in:
@ -143,7 +143,7 @@ class DEShybrid
|
|||||||
//- Maximum bound for sigma (0 <= sigmaMax <= 1)
|
//- Maximum bound for sigma (0 <= sigmaMax <= 1)
|
||||||
scalar sigmaMax_;
|
scalar sigmaMax_;
|
||||||
|
|
||||||
//- constants of scheme
|
//- Scheme constants
|
||||||
scalar CH1_;
|
scalar CH1_;
|
||||||
scalar CH2_;
|
scalar CH2_;
|
||||||
scalar CH3_;
|
scalar CH3_;
|
||||||
@ -174,11 +174,11 @@ class DEShybrid
|
|||||||
const volScalarField B
|
const volScalarField B
|
||||||
(
|
(
|
||||||
CH3_*Omega*max(S, Omega)
|
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
|
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)));
|
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)
|
CH2_*max(scalar(0), CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5)
|
||||||
);
|
);
|
||||||
|
|
||||||
const volScalarField IOhybrid
|
const volScalarField factor
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"DEShybridFactor",
|
typeName + ":Factor",
|
||||||
this->mesh().time().timeName(),
|
this->mesh().time().timeName(),
|
||||||
this->mesh(),
|
this->mesh(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -200,17 +200,18 @@ class DEShybrid
|
|||||||
),
|
),
|
||||||
max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_)
|
max(sigmaMax_*tanh(pow(A, CH1_)), sigmaMin_)
|
||||||
);
|
);
|
||||||
if (this->mesh().time().outputTime())
|
|
||||||
{
|
// if (this->mesh().time().outputTime())
|
||||||
IOhybrid.write();
|
// {
|
||||||
}
|
// factor.write();
|
||||||
|
// }
|
||||||
|
|
||||||
return tmp<surfaceScalarField>
|
return tmp<surfaceScalarField>
|
||||||
(
|
(
|
||||||
new surfaceScalarField
|
new surfaceScalarField
|
||||||
(
|
(
|
||||||
vf.name() + "BlendingFactor",
|
vf.name() + "BlendingFactor",
|
||||||
fvc::interpolate(IOhybrid)
|
fvc::interpolate(factor)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@ tmp<volScalarField> SpalartAllmarasDDES<BasicTurbulenceModel>::dTilda
|
|||||||
const volTensorField& gradU
|
const volTensorField& gradU
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const volScalarField lRAS(this->y_);
|
const volScalarField& lRAS(this->y_);
|
||||||
const volScalarField lLES(this->psi(chi, fv1)*this->CDES_*this->delta());
|
const volScalarField lLES(this->psi(chi, fv1)*this->CDES_*this->delta());
|
||||||
|
|
||||||
return max
|
return max
|
||||||
|
|||||||
@ -127,7 +127,7 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::dTilda
|
|||||||
const volScalarField magGradU(mag(gradU));
|
const volScalarField magGradU(mag(gradU));
|
||||||
const volScalarField psi(this->psi(chi, fv1));
|
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 lLES(psi*this->CDES_*this->delta());
|
||||||
|
|
||||||
const volScalarField alpha(this->alpha());
|
const volScalarField alpha(this->alpha());
|
||||||
@ -142,20 +142,16 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::dTilda
|
|||||||
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
|
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
|
||||||
|
|
||||||
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
|
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
|
||||||
/*
|
// return max
|
||||||
return max
|
// (
|
||||||
(
|
// fdTilda*lRAS + (1 - fdTilda)*lLES,
|
||||||
fdTilda*lRAS
|
// dimensionedScalar("SMALL", dimLength, SMALL)
|
||||||
+ (1 - fdTilda)*lLES,
|
// );
|
||||||
dimensionedScalar("SMALL", dimLength, SMALL)
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Original formulation from Shur et al. paper (2008)
|
// Original formulation from Shur et al. paper (2008)
|
||||||
return max
|
return max
|
||||||
(
|
(
|
||||||
fdTilda*(1 + fe)*lRAS
|
fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES,
|
||||||
+ (1 - fdTilda)*lLES,
|
|
||||||
dimensionedScalar("SMALL", dimLength, SMALL)
|
dimensionedScalar("SMALL", dimLength, SMALL)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,20 +141,16 @@ tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::dTilda
|
|||||||
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
|
const volScalarField fdTilda(max(1 - fdt(magGradU), fB));
|
||||||
|
|
||||||
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
|
// Simplified formulation from Gritskevich et al. paper (2011) where fe = 0
|
||||||
/*
|
// return max
|
||||||
return max
|
// (
|
||||||
(
|
// fdTilda*lRAS + (1 - fdTilda)*lLES,
|
||||||
fdTilda*lRAS
|
// dimensionedScalar("SMALL", dimLength, SMALL)
|
||||||
+ (1 - fdTilda)*lLES,
|
// );
|
||||||
dimensionedScalar("SMALL", dimLength, SMALL)
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Original formulation from Shur et al. paper (2008)
|
// Original formulation from Shur et al. paper (2008)
|
||||||
return max
|
return max
|
||||||
(
|
(
|
||||||
fdTilda*(1 + fe)*lRAS
|
fdTilda*(1 + fe)*lRAS + (1 - fdTilda)*lLES,
|
||||||
+ (1 - fdTilda)*lLES,
|
|
||||||
dimensionedScalar("SMALL", dimLength, SMALL)
|
dimensionedScalar("SMALL", dimLength, SMALL)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user