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

Explosion when rigid body immersed in fluid at initialization time #56

Closed
SunlayGGX opened this issue Feb 14, 2020 · 5 comments
Closed

Comments

@SunlayGGX
Copy link

SunlayGGX commented Feb 14, 2020

Hello,

I'm currently trying to simulate some fluids interaction with rigidbodies, and the subject was a fan immersed into gases.
But when I put any rigidbody inside the fluid (even a simple sphere) and start the simulation, it just explodes (After troubleshooting a little, I found out that fluids particles are spawned inside and just at the skin of the rigidbody (they are spawned uniformly regardless of rigid bodies due to the initialization order) and then are ejected at the first frame, making the simulation highly unstable).

I took some print screens of a ball immerged into a fluid :

This is time 0 :
image

This is time t = 0.00600 (the next frame)
image

And other questions about what SplishSplash could do :

  • SplishSplash is made for fluids, but actually I never saw anyone using it for simulating gases like air interactions with solids (even though gases are fluids too). Is SplishSplash able to handle those kind of interaction or is it especially made for liquids ?

  • What are the physical units of constants you use to initialize Splishplash parameters ? Is it the one that we find in the tutorial SplishSplash is linked to ? (https://interactivecomputergraphics.github.io/SPH-Tutorial/)

  • Then, if it is the case, then why is the viscosity coefficient 10 time higher than water (I suppose, from its density, that it is water you wanted to simulate, isn't it) ?

Thanks

@janbender
Copy link
Member

First, the explosion comes from the fact that you start with an unphysical state. The fluid particles are already inside the boundary when you start. This causes a high pressure force which leads to the explosion. You have to get rid of the fluid particles in the boundary.

I think SPlisHSPlasH can also be used for gases since they are also fluids. However, we never tried that.

The viscosity is higher for numerical reasons. You can also take the parameter for water but then you probably should also consider to use XSPH to smooth the velocity field. See the works of Monaghan for more details.

@SunlayGGX
Copy link
Author

SunlayGGX commented Feb 17, 2020

Hello,
thanks for your response. I'll go read Monaghan's works like you suggested.

For the explosion, is there a way to prevent spawning fluid particles inside the said boundary ?

Because currently, whenever we specify a Fluid in the scene using "FluidBlocks", it just spawns fluids inside a "box" whenever there are rigidbodies to put in later (the fluid particles data is spawned before rigidbodies. Therefore, fluid blocks doesn't know about rigidbodies position/orientation nor volume to compute the space to skip spawning particles. Leading to this unphysical state).
I tried making many fluid blocks to encapsulate my rigidbody, but the result was disastrous because if rigidbody volume isn't approximated finely, it created area where density is non uniform (mainly at juncture between blocks or between blocks and rigid bodies) leading to other unphysical state. Besides, this patch is not scalable because when you need to test your rigid body in another location, you need to change all fluid blocks...

So what would be the best solution to handle this issue ?
-> To invert the order of initialization (rigidbodies before fluid data to allow fluid blocks to skip spawning where a rigidbody is)
-> Or to remove fluid particles that collide with a rigid body after the rigidbody is spawned (but FluidModel does not expose a method to remove particle at runtime).
-> Or an easy external way

@janbender
Copy link
Member

Hi,

there is no perfect solution for this yet. However, you can use the command line tool to sample a volume by particles. You then need one OBJ file which contains a mesh with your boundary.

Alternatively you could start the simulation with the fluid block above your boundary and let it fall down, wait until it settles and then export the partio file of this final state. Then start a second simulation by loading the final state in the scene file.

Hope that helps.

@SunlayGGX
Copy link
Author

Ok, I'll try this then.
Thanks.

@SunlayGGX
Copy link
Author

Thanks, it is working fine for me.

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