Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Bug of particle sleep
#1
Exclamación 
Dear Developers,
I have encountered a bug related to particle sleeping, which has caused significant issues in my application scenario. As demonstrated in the video, I initially set the sleep threshold value to 0.5. When particles are emitted at a low height, they correctly enter a sleep state. However, when the emission height is increased, the particles fall to the ground and exhibit slow creeping movements. At this point, I have to increase the sleep threshold to 10 to get them to sleep. The higher the velocity the particles experience during activity, the harder it is for them to sleep, which seems unreasonable.
My particles have a relatively small radius of 0.01m. However, this issue also occurs with larger particles, such as those with radii of 0.03m, 0.05m, and 0.08m. Could you please explain why this happens and how it can be resolved? The burst solver back end also shows this issue, although to a lesser extent.
I look forward to your response.
Best regards,

bug video:↓
https://www.bilibili.com/video/BV1kebHec...782833d31a
Reply
#2
(12-07-2024, 06:02 AM)GuoliZheng Wrote: Dear Developers,
I have encountered a bug related to particle sleeping, which has caused significant issues in my application scenario. As demonstrated in the video, I initially set the sleep threshold value to 0.5.

That's a extremely high sleep threshold, which will send particles to sleep almost immediately. Remember the sleep threshold is a mass-weighted kinetic energy threshold: 1/2 * velocity^2. A threshold of 0.5 will cause particles moving any slower than 1 m/s to stop.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: When particles are emitted at a low height, they correctly enter a sleep state. However, when the emission height is increased, the particles fall to the ground and exhibit slow creeping movements.

Correct. Because when emitted from a higher point, they have more time to accelerate downwards due to gravity and they will have larger kinetic energy, which allows them to keep moving. As their energy is near the sleep threshold, they will go in and out of sleep which creates this "creeping" movement.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: At this point, I have to increase the sleep threshold to 10 to get them to sleep.

Yes, this is what should happen. The larger the kinetic energy of the particles (that is, the faster they move) the larger the sleep threshold needed for them to go to sleep.

(12-07-2024, 06:02 AM)GuoliZheng Wrote: The higher the velocity the particles experience during activity, the harder it is for them to sleep, which seems unreasonable.

This is the expected outcome, why would it be otherwise? It is natural for an object to go to sleep when its velocity is low (below the sleep threshold) since that's when its energy can be considered negligible. Conversely, it should be harder for them to sleep the higher their velocity is. Sleeping works like this in all physics engines. Pseudocode for sleeping:

Code:
if (velocityMagnitude * velocityMagnitude * 0.5 < sleepThreshold)
   particle.Freeze();
else
   particle.Move();

It seems to me like you're expecting to use sleep to kind of fake or approximate high viscosity, which of course won't work. Sleeping is intended to reduce or eliminate positional drift, making particles stay in place instead of moving at very small speeds. Using a very large sleep threshold like you're doing will result in jerky/creepy movement, as particles go in and out of sleep continuously. In the worst case scenario, it will completely freeze the simulation as all particles go to sleep.

kind regards,
Reply
#3
(12-07-2024, 07:55 AM)josemendez Wrote: That's a extremely high sleep threshold, which will send particles to sleep almost immediately. Remember the sleep threshold is a mass-weighted kinetic energy threshold: 1/2 * velocity^2. A threshold of 0.5 will cause particles moving any slower than 1 m/s to stop.


Correct. Because when emitted from a higher point, they have more time to accelerate downwards due to gravity and they will have larger kinetic energy, which allows them to keep moving. As their energy is near the sleep threshold, they will go in and out of sleep which creates this "creeping" movement.


Yes, this is what should happen. The larger the kinetic energy of the particles (that is, the faster they move) the larger the sleep threshold needed for them to go to sleep.


This is the expected outcome, why would it be otherwise? It is natural for an object to go to sleep when its velocity is low (below the sleep threshold) since that's when its energy can be considered negligible. Conversely, it should be harder for them to sleep the higher their velocity is. Sleeping works like this in all physics engines. Pseudocode for sleeping:

Code:
if (velocityMagnitude * velocityMagnitude * 0.5 < sleepThreshold)
   particle.Freeze();
else
   particle.Move();

It seems to me like you're expecting to use sleep to kind of fake or approximate high viscosity, which of course won't work. Sleeping is intended to reduce or eliminate positional drift, making particles stay in place instead of moving at very small speeds. Using a very large sleep threshold like you're doing will result in jerky/creepy movement, as particles go in and out of sleep continuously. In the worst case scenario, it will completely freeze the simulation as all particles go to sleep.

kind regards,
Hello,
Do you have any suggestions for simulating small particles at the 0.01m scale? Should I adjust the fixed time step of the physics engine, or modify the iteration steps or substeps of the ObiSolver? The goal is to simulate high-viscosity materials like concrete that can adhere smoothly to a wall when thrown.
Thank you!
Reply