mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
global damping is activated for velocity and rVelocity in both sphere and grain solvers
This commit is contained in:
@ -324,10 +324,12 @@ bool pFlow::grainParticles::iterate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
real damping = dynPointStruct().dampingFactor(ti);
|
||||
if(!rVelIntegration_().correct(
|
||||
ti.dt(),
|
||||
rVelocity_,
|
||||
rAcceleration_))
|
||||
rAcceleration_,
|
||||
damping))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
|
||||
inline bool insertionTime(uint32 iter, real t, real dt) const
|
||||
{
|
||||
return tControl_.timeEvent(iter, t, dt);
|
||||
return tControl_.eventTime(iter, t, dt);
|
||||
}
|
||||
|
||||
uint32 numberToBeInserted(uint32 iter, real t, real dt);
|
||||
|
@ -300,10 +300,12 @@ bool pFlow::sphereParticles::iterate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
real damping = dynPointStruct().dampingFactor(ti);
|
||||
if(!rVelIntegration_().correct(
|
||||
dt(),
|
||||
ti.dt(),
|
||||
rVelocity_,
|
||||
rAcceleration_))
|
||||
rAcceleration_,
|
||||
damping))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -89,9 +89,11 @@ pFlow::dynamicPointStructure::dynamicPointStructure
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
REPORT(1)<<"Reading globalDamping dictionary ..."<<END_REPORT;
|
||||
velDamping_ = makeUnique<globalDamping>(control);
|
||||
|
||||
if(control.settingsDict().containsDictionay("globalDamping"))
|
||||
{
|
||||
REPORT(1)<<"Reading globalDamping dictionary ..."<<END_REPORT;
|
||||
velDamping_ = makeUnique<globalDamping>(control);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -111,10 +113,6 @@ bool pFlow::dynamicPointStructure::iterate()
|
||||
{
|
||||
return pointStructure::iterate();
|
||||
|
||||
/*real dt = this->dt();
|
||||
|
||||
auto& acc = time().lookupObject<realx3PointField_D>("acceleration");
|
||||
return correct(dt, acc);*/
|
||||
}
|
||||
|
||||
bool pFlow::dynamicPointStructure::afterIteration()
|
||||
@ -122,14 +120,13 @@ bool pFlow::dynamicPointStructure::afterIteration()
|
||||
//const auto ti = TimeInfo();
|
||||
|
||||
auto succs = pointStructure::afterIteration();
|
||||
//velDamping_().applyDamping(ti, velocity_);
|
||||
|
||||
return succs;
|
||||
}
|
||||
|
||||
bool pFlow::dynamicPointStructure::predict(real dt)
|
||||
{
|
||||
|
||||
|
||||
if(!integrationPos_().predict(dt, pointPosition(), velocity_ ))return false;
|
||||
if(!integrationVel_().predict(dt, velocity_, acceleration_))return false;
|
||||
|
||||
@ -141,7 +138,7 @@ bool pFlow::dynamicPointStructure::correct(real dt)
|
||||
const auto& ti = TimeInfo();
|
||||
|
||||
if(!integrationPos_().correctPStruct(dt, *this, velocity_) )return false;
|
||||
if(!integrationVel_().correct(dt, velocity_, acceleration_, velDamping_().dampingFactor(ti)))return false;
|
||||
if(!integrationVel_().correct(dt, velocity_, acceleration_, dampingFactor(ti)))return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -101,6 +101,16 @@ public:
|
||||
return acceleration_;
|
||||
}
|
||||
|
||||
inline
|
||||
real dampingFactor(const timeInfo& ti)const
|
||||
{
|
||||
if(velDamping_)
|
||||
{
|
||||
return velDamping_().dampingFactor(ti);
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/// In the time loop before iterate
|
||||
bool beforeIteration() override;
|
||||
|
||||
|
@ -23,13 +23,12 @@ Licence:
|
||||
|
||||
|
||||
pFlow::globalDamping::globalDamping(const systemControl& control)
|
||||
{}
|
||||
/*:
|
||||
:
|
||||
timeControl_(control.settingsDict().subDict("globalDamping"), control.time().dt(), "damping")
|
||||
{
|
||||
const dictionary& dict = control.settingsDict().subDict("globalDamping");
|
||||
|
||||
dampingFactor_ = dict.getValOrSetMin<real>("dampingFactor", static_cast<real>(1.0));
|
||||
dampingFactor_ = dict.getValMin<real>("dampingFactor", static_cast<real>(1.0));
|
||||
|
||||
dampingFactor_ = max( dampingFactor_ , static_cast<real>(0.01));
|
||||
|
||||
@ -41,36 +40,11 @@ pFlow::globalDamping::globalDamping(const systemControl& control)
|
||||
else
|
||||
REPORT(2)<<"Global damping "<<Yellow_Text("is not active")<<"."<<END_REPORT;
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
/*void pFlow::globalDamping::applyDamping
|
||||
(
|
||||
const timeInfo& ti,
|
||||
realx3PointField_D& velocity
|
||||
)
|
||||
{
|
||||
if(!performDamping_) return;
|
||||
if(!timeControl_.timeEvent(ti.iter(), ti.t(), ti.dt()) )return;
|
||||
|
||||
auto d_v = velocity.deviceView();
|
||||
auto activeRng = velocity.activeRange();
|
||||
auto dmpng = dampingFactor_;
|
||||
|
||||
Kokkos::parallel_for(
|
||||
"globalDamping::applyDamping",
|
||||
deviceRPolicyStatic(activeRng.start(), activeRng.end()),
|
||||
LAMBDA_HD(uint32 i){
|
||||
d_v[i] *= dmpng;
|
||||
});
|
||||
Kokkos::fence();
|
||||
//REPORT(1)<<"Applied global damping "<<END_REPORT;
|
||||
}*/
|
||||
}
|
||||
|
||||
pFlow::real pFlow::globalDamping::dampingFactor(const timeInfo& ti)const
|
||||
{
|
||||
return 1;
|
||||
/*if(!performDamping_) return 1.0;
|
||||
if(!timeControl_.timeEvent(ti.iter(), ti.t(), ti.dt()) )return 1.0;
|
||||
return dampingFactor_;*/
|
||||
if(!performDamping_) return 1.0;
|
||||
if(!timeControl_.eventTime(ti ))return 1.0;
|
||||
return dampingFactor_;
|
||||
}
|
@ -37,8 +37,7 @@ private:
|
||||
|
||||
real dampingFactor_;
|
||||
|
||||
// baseTimeControl timeControl_;
|
||||
|
||||
baseTimeControl timeControl_;
|
||||
|
||||
public:
|
||||
|
||||
@ -47,9 +46,7 @@ public:
|
||||
|
||||
~globalDamping()=default;
|
||||
|
||||
//void applyDamping( const timeInfo& ti, realx3PointField_D& velocity);
|
||||
|
||||
bool performDamping()const
|
||||
bool dampingActive()const
|
||||
{
|
||||
return performDamping_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user