• Advertisement
Sign in to follow this  

Opengl + Fluid Dynamics in 2D

This topic is 1784 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

 

I'm trying to find an example or tutorial of how to add Fluid simulation.

Do you know if it is possible to simulate Fluids using Box2D or any other 2D physics engine?

 

Any tutorial to have a look at?

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement

Take a look at Jos Stam's Real-time Fluid Dynamics for Games: http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf

It's a very good introduction that let's you create your own single-phase, grid based fluid simulation.

 

I implemented it in C# with two modifications that made the algorithm more efficient: Instead of clearing the projection buffer I advect it along with the other fields, and were able to reduce the iterations for mass conservation from 20 to 5 for the same fidelity. Also, vorticity confinement adds to the fidelity while allowing you to reduce the number of relaxation iterations.

Alas, I never made a fancy OpenGL renderer for it, just GDI+.
 

Afaik, Box2D doesn't do this, but the Chipmunk engine might be able to emulate fluids using heaps of rigid bodies.

Edited by makeshift_hospital_bed

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement