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)
|
if (nSubCycles > 1)
|
||||||
{
|
{
|
||||||
|
Info<< " " << nSubCycles << " move-collide subCycles" << endl;
|
||||||
|
|
||||||
subCycleTime moveCollideSubCycle
|
subCycleTime moveCollideSubCycle
|
||||||
(
|
(
|
||||||
const_cast<Time&>(this->db().time()),
|
const_cast<Time&>(this->db().time()),
|
||||||
|
|||||||
@ -521,24 +521,29 @@ Foam::PairCollision<CloudType>::~PairCollision()
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::label Foam::PairCollision<CloudType>::nSubCycles() const
|
Foam::label Foam::PairCollision<CloudType>::nSubCycles() const
|
||||||
{
|
{
|
||||||
|
label nSubCycles = 1;
|
||||||
|
|
||||||
if (pairModel_->controlsTimestep())
|
if (pairModel_->controlsTimestep())
|
||||||
{
|
{
|
||||||
label nSubCycles = returnReduce
|
label nPairSubCycles = returnReduce
|
||||||
(
|
(
|
||||||
pairModel_->nSubCycles(), maxOp<label>()
|
pairModel_->nSubCycles(), maxOp<label>()
|
||||||
);
|
);
|
||||||
|
|
||||||
if(nSubCycles > 1)
|
nSubCycles = max(nSubCycles, nPairSubCycles);
|
||||||
{
|
}
|
||||||
Info<< " " << nSubCycles << " move-collide subCycles" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nSubCycles;
|
if (wallModel_->controlsTimestep())
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return 1;
|
label nWallSubCycles = returnReduce
|
||||||
|
(
|
||||||
|
wallModel_->nSubCycles(), maxOp<label>()
|
||||||
|
);
|
||||||
|
|
||||||
|
nSubCycles = max(nSubCycles, nWallSubCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nSubCycles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,12 +30,12 @@ License
|
|||||||
template <class CloudType>
|
template <class CloudType>
|
||||||
void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
||||||
(
|
(
|
||||||
scalar& RMin,
|
scalar& rMin,
|
||||||
scalar& rhoMax,
|
scalar& rhoMax,
|
||||||
scalar& UMagMax
|
scalar& UMagMax
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
RMin = VGREAT;
|
rMin = VGREAT;
|
||||||
rhoMax = -VGREAT;
|
rhoMax = -VGREAT;
|
||||||
UMagMax = -VGREAT;
|
UMagMax = -VGREAT;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
|||||||
const typename CloudType::parcelType& p = iter();
|
const typename CloudType::parcelType& p = iter();
|
||||||
|
|
||||||
// Finding minimum diameter to avoid excessive arithmetic
|
// Finding minimum diameter to avoid excessive arithmetic
|
||||||
RMin = min(p.d(), RMin);
|
rMin = min(p.d(), rMin);
|
||||||
|
|
||||||
rhoMax = max(p.rho(), rhoMax);
|
rhoMax = max(p.rho(), rhoMax);
|
||||||
|
|
||||||
@ -57,11 +57,8 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties
|
|||||||
|
|
||||||
// Transform the minimum diameter into minimum radius
|
// Transform the minimum diameter into minimum radius
|
||||||
// rMin = dMin/2
|
// 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>
|
template<class CloudType>
|
||||||
Foam::label Foam::WallSpringSliderDashpot<CloudType>::nSubCycles() const
|
Foam::label Foam::WallSpringSliderDashpot<CloudType>::nSubCycles() const
|
||||||
{
|
{
|
||||||
// if (!(this->owner().size()))
|
if (!(this->owner().size()))
|
||||||
// {
|
{
|
||||||
// return 1;
|
return 1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// scalar RMin;
|
scalar rMin;
|
||||||
// scalar rhoMax;
|
scalar rhoMax;
|
||||||
// scalar UMagMax;
|
scalar UMagMax;
|
||||||
|
|
||||||
// findMinMaxProperties(RMin, rhoMax, UMagMax);
|
findMinMaxProperties(rMin, rhoMax, UMagMax);
|
||||||
|
|
||||||
// // Note: pi^(7/5)*(5/4)^(2/5) = 5.429675
|
scalar pNu = this->owner().constProps().poissonsRatio();
|
||||||
// scalar minCollisionDeltaT =
|
|
||||||
// 5.429675
|
|
||||||
// *RMin
|
|
||||||
// *pow(rhoMax/(Estar_*sqrt(UMagMax) + VSMALL), 0.4)
|
|
||||||
// /collisionResolutionSteps_;
|
|
||||||
|
|
||||||
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class WallSpringSliderDashpot
|
|||||||
//- allowable timestep
|
//- allowable timestep
|
||||||
void findMinMaxProperties
|
void findMinMaxProperties
|
||||||
(
|
(
|
||||||
scalar& RMin,
|
scalar& rMin,
|
||||||
scalar& rhoMax,
|
scalar& rhoMax,
|
||||||
scalar& vMagMax
|
scalar& vMagMax
|
||||||
) const;
|
) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user