ENH: PairCollision. Adding function to WallSpringSliderDashpot to

control the number of subCycles.  Adding the request for timestep
control from the wall model to PairCollision.
This commit is contained in:
graham
2010-04-14 16:12:04 +01:00
parent fa851dde1e
commit d5cb528bf7
4 changed files with 41 additions and 33 deletions

View File

@ -99,6 +99,8 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud()
if (nSubCycles > 1)
{
Info<< " " << nSubCycles << " move-collide subCycles" << endl;
subCycleTime moveCollideSubCycle
(
const_cast<Time&>(this->db().time()),

View File

@ -521,24 +521,29 @@ Foam::PairCollision<CloudType>::~PairCollision()
template<class CloudType>
Foam::label Foam::PairCollision<CloudType>::nSubCycles() const
{
label nSubCycles = 1;
if (pairModel_->controlsTimestep())
{
label nSubCycles = returnReduce
label nPairSubCycles = returnReduce
(
pairModel_->nSubCycles(), maxOp<label>()
);
if(nSubCycles > 1)
{
Info<< " " << nSubCycles << " move-collide subCycles" << endl;
}
nSubCycles = max(nSubCycles, nPairSubCycles);
}
return nSubCycles;
}
else
if (wallModel_->controlsTimestep())
{
return 1;
label nWallSubCycles = returnReduce
(
wallModel_->nSubCycles(), maxOp<label>()
);
nSubCycles = max(nSubCycles, nWallSubCycles);
}
return nSubCycles;
}

View File

@ -30,12 +30,12 @@ License
template <class CloudType>
void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
(
scalar& RMin,
scalar& rMin,
scalar& rhoMax,
scalar& UMagMax
) const
{
RMin = VGREAT;
rMin = VGREAT;
rhoMax = -VGREAT;
UMagMax = -VGREAT;
@ -44,7 +44,7 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
const typename CloudType::parcelType& p = iter();
// Finding minimum diameter to avoid excessive arithmetic
RMin = min(p.d(), RMin);
rMin = min(p.d(), rMin);
rhoMax = max(p.rho(), rhoMax);
@ -57,11 +57,8 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
// Transform the minimum diameter into minimum radius
// rMin = dMin/2
// then rMin into minimum R,
// 1/RMin = 1/rMin + 1/rMin,
// RMin = rMin/2 = dMin/4
RMin /= 4.0;
rMin /= 2.0;
}
@ -109,27 +106,31 @@ bool Foam::WallSpringSliderDashpot<CloudType>::controlsTimestep() const
template<class CloudType>
Foam::label Foam::WallSpringSliderDashpot<CloudType>::nSubCycles() const
{
// if (!(this->owner().size()))
// {
// return 1;
// }
if (!(this->owner().size()))
{
return 1;
}
// scalar RMin;
// scalar rhoMax;
// scalar UMagMax;
scalar rMin;
scalar rhoMax;
scalar UMagMax;
// findMinMaxProperties(RMin, rhoMax, UMagMax);
findMinMaxProperties(rMin, rhoMax, UMagMax);
// // Note: pi^(7/5)*(5/4)^(2/5) = 5.429675
// scalar minCollisionDeltaT =
// 5.429675
// *RMin
// *pow(rhoMax/(Estar_*sqrt(UMagMax) + VSMALL), 0.4)
// /collisionResolutionSteps_;
scalar pNu = this->owner().constProps().poissonsRatio();
// return ceil(this->owner().time().deltaTValue()/minCollisionDeltaT);
scalar pE = this->owner().constProps().youngsModulus();
return 1;
scalar Estar = 1/((1 - sqr(pNu))/pE + (1 - sqr(nu_))/E_);
// Note: pi^(7/5)*(5/4)^(2/5) = 5.429675
scalar minCollisionDeltaT =
5.429675
*rMin
*pow(rhoMax/(Estar*sqrt(UMagMax) + VSMALL), 0.4)
/collisionResolutionSteps_;
return ceil(this->owner().time().deltaTValue()/minCollisionDeltaT);
}

View File

@ -76,7 +76,7 @@ class WallSpringSliderDashpot
//- allowable timestep
void findMinMaxProperties
(
scalar& RMin,
scalar& rMin,
scalar& rhoMax,
scalar& vMagMax
) const;