mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH. Making equivalent size collisions switchable.
This commit is contained in:
@ -46,7 +46,11 @@ void Foam::PairSpringSliderDashpot<CloudType>::findMinMaxProperties
|
|||||||
// Finding minimum diameter to avoid excessive arithmetic
|
// Finding minimum diameter to avoid excessive arithmetic
|
||||||
|
|
||||||
scalar dEff = p.d();
|
scalar dEff = p.d();
|
||||||
// scalar dEff = p.d()*cbrt(p.nParticle()*volumeFactor_);
|
|
||||||
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
dEff *= cbrt(p.nParticle()*volumeFactor_);
|
||||||
|
}
|
||||||
|
|
||||||
RMin = min(dEff, RMin);
|
RMin = min(dEff, RMin);
|
||||||
|
|
||||||
@ -95,8 +99,14 @@ Foam::PairSpringSliderDashpot<CloudType>::PairSpringSliderDashpot
|
|||||||
this->coeffDict().lookup("collisionResolutionSteps")
|
this->coeffDict().lookup("collisionResolutionSteps")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
volumeFactor_(this->dict().lookupOrDefault("volumeFactor", 1.0))
|
volumeFactor_(1.0),
|
||||||
|
useEquivalentSize_(Switch(this->dict().lookup("useEquivalentSize")))
|
||||||
{
|
{
|
||||||
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
volumeFactor_ = readScalar(this->dict().lookup("volumeFactor"));
|
||||||
|
}
|
||||||
|
|
||||||
scalar nu = this->owner().constProps().poissonsRatio();
|
scalar nu = this->owner().constProps().poissonsRatio();
|
||||||
|
|
||||||
scalar E = this->owner().constProps().youngsModulus();
|
scalar E = this->owner().constProps().youngsModulus();
|
||||||
@ -159,12 +169,20 @@ void Foam::PairSpringSliderDashpot<CloudType>::evaluatePair
|
|||||||
{
|
{
|
||||||
vector r_AB = (pA.position() - pB.position());
|
vector r_AB = (pA.position() - pB.position());
|
||||||
|
|
||||||
//scalar dAEff = pA.d()*cbrt(pA.nParticle()*volumeFactor_);
|
|
||||||
scalar dAEff = pA.d();
|
scalar dAEff = pA.d();
|
||||||
|
|
||||||
// scalar dBEff = pB.d()*cbrt(pB.nParticle()*volumeFactor_);
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
dAEff *= cbrt(pA.nParticle()*volumeFactor_);
|
||||||
|
}
|
||||||
|
|
||||||
scalar dBEff = pB.d();
|
scalar dBEff = pB.d();
|
||||||
|
|
||||||
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
dBEff *= cbrt(pB.nParticle()*volumeFactor_);
|
||||||
|
}
|
||||||
|
|
||||||
scalar normalOverlapMag = 0.5*(dAEff + dBEff) - mag(r_AB);
|
scalar normalOverlapMag = 0.5*(dAEff + dBEff) - mag(r_AB);
|
||||||
|
|
||||||
if (normalOverlapMag > 0)
|
if (normalOverlapMag > 0)
|
||||||
|
|||||||
@ -92,6 +92,10 @@ class PairSpringSliderDashpot
|
|||||||
// factor
|
// factor
|
||||||
scalar volumeFactor_;
|
scalar volumeFactor_;
|
||||||
|
|
||||||
|
//- Switch to control use of equivalent size particles. Used
|
||||||
|
// because cbrt calculation is very expensive.
|
||||||
|
bool useEquivalentSize_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,11 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
|||||||
// Finding minimum diameter to avoid excessive arithmetic
|
// Finding minimum diameter to avoid excessive arithmetic
|
||||||
|
|
||||||
scalar dEff = p.d();
|
scalar dEff = p.d();
|
||||||
// scalar dEff = p.d()*cbrt(p.nParticle()*volumeFactor_);
|
|
||||||
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
dEff *= cbrt(p.nParticle()*volumeFactor_);
|
||||||
|
}
|
||||||
|
|
||||||
rMin = min(dEff, rMin);
|
rMin = min(dEff, rMin);
|
||||||
|
|
||||||
@ -65,6 +69,7 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
|||||||
rMin /= 2.0;
|
rMin /= 2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class CloudType>
|
template <class CloudType>
|
||||||
void Foam::WallSpringSliderDashpot<CloudType>::evaluateWall
|
void Foam::WallSpringSliderDashpot<CloudType>::evaluateWall
|
||||||
(
|
(
|
||||||
@ -163,8 +168,14 @@ Foam::WallSpringSliderDashpot<CloudType>::WallSpringSliderDashpot
|
|||||||
this->coeffDict().lookup("collisionResolutionSteps")
|
this->coeffDict().lookup("collisionResolutionSteps")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
volumeFactor_(this->dict().lookupOrDefault("volumeFactor", 1.0))
|
volumeFactor_(1.0),
|
||||||
{}
|
useEquivalentSize_(Switch(this->dict().lookup("useEquivalentSize")))
|
||||||
|
{
|
||||||
|
if (useEquivalentSize_)
|
||||||
|
{
|
||||||
|
volumeFactor_ = readScalar(this->dict().lookup("volumeFactor"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
@ -182,10 +193,17 @@ Foam::scalar Foam::WallSpringSliderDashpot<CloudType>::pREff
|
|||||||
const typename CloudType::parcelType& p
|
const typename CloudType::parcelType& p
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// return p.d()/2*cbrt(p.nParticle()*volumeFactor_);
|
if (useEquivalentSize_)
|
||||||
return p.d()/2;
|
{
|
||||||
|
return p.d()/2*cbrt(p.nParticle()*volumeFactor_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return p.d()/2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
bool Foam::WallSpringSliderDashpot<CloudType>::controlsTimestep() const
|
bool Foam::WallSpringSliderDashpot<CloudType>::controlsTimestep() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -87,6 +87,10 @@ class WallSpringSliderDashpot
|
|||||||
// factor
|
// factor
|
||||||
scalar volumeFactor_;
|
scalar volumeFactor_;
|
||||||
|
|
||||||
|
//- Switch to control use of equivalent size particles. Used
|
||||||
|
// because the calculation can be very expensive.
|
||||||
|
bool useEquivalentSize_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user