mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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()),
|
||||
|
||||
@ -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)
|
||||
nSubCycles = max(nSubCycles, nPairSubCycles);
|
||||
}
|
||||
|
||||
if (wallModel_->controlsTimestep())
|
||||
{
|
||||
Info<< " " << nSubCycles << " move-collide subCycles" << endl;
|
||||
label nWallSubCycles = returnReduce
|
||||
(
|
||||
wallModel_->nSubCycles(), maxOp<label>()
|
||||
);
|
||||
|
||||
nSubCycles = max(nSubCycles, nWallSubCycles);
|
||||
}
|
||||
|
||||
return nSubCycles;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
// }
|
||||
|
||||
// scalar RMin;
|
||||
// scalar rhoMax;
|
||||
// scalar 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_;
|
||||
|
||||
// return ceil(this->owner().time().deltaTValue()/minCollisionDeltaT);
|
||||
|
||||
if (!(this->owner().size()))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
scalar rMin;
|
||||
scalar rhoMax;
|
||||
scalar UMagMax;
|
||||
|
||||
findMinMaxProperties(rMin, rhoMax, UMagMax);
|
||||
|
||||
scalar pNu = this->owner().constProps().poissonsRatio();
|
||||
|
||||
scalar pE = this->owner().constProps().youngsModulus();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ class WallSpringSliderDashpot
|
||||
//- allowable timestep
|
||||
void findMinMaxProperties
|
||||
(
|
||||
scalar& RMin,
|
||||
scalar& rMin,
|
||||
scalar& rhoMax,
|
||||
scalar& vMagMax
|
||||
) const;
|
||||
|
||||
Reference in New Issue
Block a user