SPlisHSPlasH icon indicating copy to clipboard operation
SPlisHSPlasH copied to clipboard

disappear issue of fluid particles

Open BinglunWang opened this issue 1 year ago • 8 comments

Hi,

Just found a weired issue. In DFSPH, rigid-fluid coupling (2012 method) simulation, sometimes the fluid particle will disappear with Nan value.

This issue is more serious in a large scene multiple rigids. I attached my recording .html for your convenience.

Do you know how to fix it?

BinglunWang avatar Jan 21 '25 17:01 BinglunWang

https://drive.google.com/file/d/1sQPzb6GW77_RgXVEVqfSaSgA-ObSONX1/view?usp=drive_link attached .html. It record 32 rendered results with the searched DFSPH parameters.

BinglunWang avatar Jan 21 '25 17:01 BinglunWang

Can you share a minimal scene where this happens?

janbender avatar Jan 27 '25 06:01 janbender

Thank you for your reply!

I double test the attached scene, it will lose particles after a few time steps using dfsph + 2012 rigid-fluid coupling method. But it's stable (no particles disappear) when I integrate a rigid body control method.

Please check the scene and the state. As for state I only load the water state by position and velocity.

I also attached my running code for your convenience. To run my code, it require set in diffFR environment: https://github.com/zhehaoli1999/DiffFR

disappear particles.zip

BinglunWang avatar Jan 27 '25 14:01 BinglunWang

For me the initial configuration directly explodes since the rigid bodies are stuck in the fluid which causes high pressure forces.

janbender avatar Jan 28 '25 09:01 janbender

For me the initial configuration directly explodes since the rigid bodies are stuck in the fluid which causes high pressure forces.

Thanks! Now I can confirm it's the high pressure forces issue. So, high pressure forces -> high fluid speed / nan velocity -> nan position.

Yes. And this issue will also happen (~10% Subjective) when I use PPO to control a single rigidbody to swim. And it's (~50% Subjective) when I use multiple (9-11) rigid bodys. And it's (~90%) for the shared scenes.

BinglunWang avatar Feb 01 '25 13:02 BinglunWang

I also see another issue in your scene. You enforce a constant step size of 5 ms. In this case the body might move too close to the fluid particles or even penetrate and the CFL condition cannot prevent this.

janbender avatar Feb 03 '25 09:02 janbender

Thank you for your reply and this information!

I hope to set a fixed time step in my project (rigid-fluid coupling), may I know what time step is a good option top in your head?

BinglunWang avatar Feb 03 '25 11:02 BinglunWang

This depends on your scene. If you have small fast moving particles, you should take a small time step. If the particles are all slow, you can use a larger step size. A particle should not slip through another one. This is essentially what the CFL condition prevents.

janbender avatar Feb 03 '25 16:02 janbender