Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disappear issue of fluid particles #346

Open
BinglunWang opened this issue Jan 21, 2025 · 8 comments
Open

disappear issue of fluid particles #346

BinglunWang opened this issue Jan 21, 2025 · 8 comments

Comments

@BinglunWang
Copy link

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
Copy link
Author

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.

@janbender
Copy link
Member

Can you share a minimal scene where this happens?

@BinglunWang
Copy link
Author

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

@janbender
Copy link
Member

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

@BinglunWang
Copy link
Author

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.

@janbender
Copy link
Member

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.

@BinglunWang
Copy link
Author

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?

@janbender
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants