STYLE: use cbrt() instead of pow(..,1.0/3.0) in a few more places

This commit is contained in:
Mark Olesen
2019-01-09 12:22:07 +01:00
parent 95d7586b48
commit 07a6e9d83d
22 changed files with 29 additions and 29 deletions

View File

@ -3,5 +3,5 @@
// Friction factor is defined with standard gravity
frictionFactor.primitiveFieldRef() =
mag(2*9.81*sqr(manningField.primitiveField())/
pow(mag(h.primitiveField()) + 1e-7, 1.0/3.0));
cbrt(mag(h.primitiveField()) + 1e-7));
}

View File

@ -107,7 +107,7 @@ Foam::multiphaseMixtureThermo::multiphaseMixtureThermo
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
1e-8/cbrt(average(mesh_.V()))
)
{
rhoPhi_.setOriented();

View File

@ -1145,7 +1145,7 @@ Foam::tmp<Foam::surfaceVectorField> Foam::phaseSystem::nHatfv
const dimensionedScalar deltaN
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
1e-8/cbrt(average(mesh_.V()))
);
// Face unit interface normal

View File

@ -166,7 +166,7 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
deltaN_
(
"deltaN",
1e-8/pow(average(mixture.U().mesh().V()), 1.0/3.0)
1e-8/cbrt(average(mixture.U().mesh().V()))
),
nHatf_

View File

@ -44,9 +44,9 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
*max
(
mag(U()) - maxSlamVelocity,
dimensionedScalar("U0", dimVelocity, 0)
dimensionedScalar("U0", dimVelocity, Zero)
)
/pow(mesh.V(), 1.0/3.0),
/cbrt(mesh.V()),
U
)
)

View File

@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
"p"
);
return d0_*pow(p0_/p, 1.0/3.0);
return d0_*cbrt(p0_/p);
}

View File

@ -408,7 +408,7 @@ Foam::multiphaseSystem::multiphaseSystem
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
1e-8/cbrt(average(mesh_.V()))
)
{
calcAlphas();

View File

@ -120,7 +120,7 @@ Foam::multiphaseMixture::multiphaseMixture
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
1e-8/cbrt(average(mesh_.V()))
)
{
rhoPhi_.setOriented();

View File

@ -84,7 +84,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Tenneti::CdRe() const
volScalarField F0
(
5.81*alpha1/pow3(alpha2) + 0.48*pow(alpha1, 1.0/3.0)/pow4(alpha2)
5.81*alpha1/pow3(alpha2) + 0.48*cbrt(alpha1)/pow4(alpha2)
);
volScalarField F1

View File

@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
"p"
);
return d0_*pow(p0_/p, 1.0/3.0);
return d0_*cbrt(p0_/p);
}

View File

@ -503,7 +503,7 @@ Foam::multiphaseSystem::multiphaseSystem
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
1e-8/cbrt(average(mesh_.V()))
)
{
forAll(phases(), phasei)

View File

@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
"p"
);
return d0_*pow(p0_/p, 1.0/3.0);
return d0_*cbrt(p0_/p);
}

View File

@ -48,7 +48,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta()
if (nD == 3)
{
delta_.primitiveFieldRef() = deltaCoeff_*pow(mesh.V(), 1.0/3.0);
delta_.primitiveFieldRef() = deltaCoeff_ * cbrt(mesh.V());
}
else if (nD == 2)
{

View File

@ -94,7 +94,7 @@ eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::rtDiff() const
);
volScalarField& delta = tdelta.ref();
delta.ref() = pow(this->mesh().V(), 1.0/3.0);
delta.ref() = cbrt(this->mesh().V());
delta.correctBoundaryConditions();
// NOTE: Assume Prt = 1

View File

@ -470,8 +470,8 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
const scalar cellOwnerVol = max(0.0, V[cellOwner[intFacei]]);
const scalar cellNeighbourVol = max(0.0, V[cellNeighbour[intFacei]]);
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);
scalar targetFaceSizeB = Foam::pow(cellNeighbourVol, 1.0/3.0);
scalar targetFaceSizeA = Foam::cbrt(cellOwnerVol);
scalar targetFaceSizeB = Foam::cbrt(cellNeighbourVol);
targetFaceSizes[intFacei] = 0.5*(targetFaceSizeA + targetFaceSizeB);
}
@ -505,7 +505,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
const label extFacei = patchFacei + patch.start();
const scalar cellOwnerVol = max(0.0, V[cellOwner[extFacei]]);
targetFaceSizes[extFacei] = Foam::pow(cellOwnerVol, 1.0/3.0);
targetFaceSizes[extFacei] = Foam::cbrt(cellOwnerVol);
}
}
}
@ -526,8 +526,8 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
const scalar cellOwnerVol = max(0.0, V[cellOwner[localFacei]]);
const scalar cellNeighbourVol = neiCellVolumes[bFacei++];
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);
scalar targetFaceSizeB = Foam::pow(cellNeighbourVol, 1.0/3.0);
scalar targetFaceSizeA = Foam::cbrt(cellOwnerVol);
scalar targetFaceSizeB = Foam::cbrt(cellNeighbourVol);
targetFaceSizes[localFacei]
= 0.5*(targetFaceSizeA + targetFaceSizeB);

View File

@ -370,7 +370,7 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
auto& Co = CoPtr.ref();
Co.primitiveFieldRef() =
mesh_.time().deltaT()*mag(*UNamePtr)/pow(mesh_.V(), 1.0/3.0);
mesh_.time().deltaT()*mag(*UNamePtr)/cbrt(mesh_.V());
indicator_ =
max

View File

@ -42,7 +42,7 @@ Foam::AveragingMethods::Moment<Type>::Moment
dataY_(FieldField<Field, Type>::operator[](2)),
dataZ_(FieldField<Field, Type>::operator[](3)),
transform_(mesh.nCells(), Zero),
scale_(0.5*pow(mesh.V(), 1.0/3.0))
scale_(0.5*cbrt(mesh.V()))
{
scalar a = 1.0/24.0;
scalar b = 0.5854101966249685;

View File

@ -89,7 +89,7 @@ Foam::ParticleStressModels::Lun::tau
0.6
/ max
(
1.0 - pow(alpha/alphaPacked_,1.0/3.0),
1.0 - cbrt(alpha/alphaPacked_),
max(eps_*(1.0 - alpha), SMALL)
)
);

View File

@ -179,7 +179,7 @@ void Foam::inclinedFilmNusseltHeightFvPatchScalarField::updateCoeffs()
operator==
(
pow(3*sqr(mup/rhop)/(gTan + ROOTVSMALL), 1.0/3.0)*pow(Re, 1.0/3.0)
cbrt(3*sqr(mup/rhop)/(gTan + ROOTVSMALL))*cbrt(Re)
);
fixedValueFvPatchScalarField::updateCoeffs();

View File

@ -179,7 +179,7 @@ void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::updateCoeffs()
const scalarField Re(max(G, scalar(0))/mup);
operator==(n*pow(gTan*mup/(3*rhop), 1.0/3.0)*pow(Re, 2.0/3.0));
operator==(n*cbrt(gTan*mup/(3*rhop))*pow(Re, 2.0/3.0));
fixedValueFvPatchVectorField::updateCoeffs();
}

View File

@ -236,15 +236,15 @@ inline Foam::scalar Foam::PengRobinsonGas<Specie>::Z
{
// One root is real
const scalar D05 = sqrt(D);
const scalar S = pow(Rl + D05, 1.0/3.0);
const scalar S = cbrt(Rl + D05);
scalar Tl = 0;
if (D05 > Rl)
{
Tl = -pow(mag(Rl - D05), 1.0/3.0);
Tl = -cbrt(mag(Rl - D05));
}
else
{
Tl = pow(Rl - D05, 1.0/3.0);
Tl = cbrt(Rl - D05);
}
root = S + Tl - a2/3.0;

View File

@ -165,7 +165,7 @@ Foam::interfaceProperties::interfaceProperties
deltaN_
(
"deltaN",
1e-8/pow(average(alpha1.mesh().V()), 1.0/3.0)
1e-8/cbrt(average(alpha1.mesh().V()))
),
alpha1_(alpha1),