pre-calculate sqrt(3.0)

merged from PUBLIC
This commit is contained in:
danielque
2017-08-28 15:42:13 +02:00
parent 9650aff318
commit 683fd04828
2 changed files with 6 additions and 3 deletions

View File

@ -66,7 +66,8 @@ IBVoidFraction::IBVoidFraction
propsDict_(dict.subDict(typeName + "Props")),
alphaMin_(readScalar(propsDict_.lookup("alphaMin"))),
alphaLimited_(0),
scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol")))
scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))),
sqrtThree_(sqrt(3.0))
{
Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model!\n\n" << endl;
maxCellsPerParticle_ = readLabel(propsDict_.lookup("maxCellsPerParticle"));
@ -128,7 +129,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction
}
scalar centreDist = mag(cellCentrePosition - minPeriodicParticlePos);
scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.);
scalar corona = 0.5 * sqrtThree_ * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.);
vector coronaPoint = cellCentrePosition;
if(centreDist > 0.0)
coronaPoint += (cellCentrePosition - minPeriodicParticlePos) * (corona / centreDist);
@ -318,7 +319,7 @@ void IBVoidFraction::buildLabelHashSet
scalar centreDist = mag(cellCentrePosition-position);
scalar fc = pointInParticle(index, position, cellCentrePosition);
scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[neighbor], 1./3.);
scalar corona = 0.5 * sqrtThree_ * pow(particleCloud_.mesh().V()[neighbor], 1./3.);
vector coronaPoint = cellCentrePosition;
if (centreDist > 0.0)
coronaPoint += (cellCentrePosition - position) * (corona / centreDist);

View File

@ -68,6 +68,8 @@ private:
const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle
const scalar sqrtThree_;
public:
//- Runtime type information