This is my first draft of a particle based fluid simulation implemented using CUDA.
It displays 2 non-mixing liquids with different densities, lets say oil (yellow) and water (blue). From time to time I apply some push-force somewhere in the scene to cause some action. You can see pressure waves running through the fluid, waves and breakers appearing at the surface as well as drops and filaments forming and other surface tension effects.
The simulation consists of 65536 particles and each of it interacts only with its local neighborhood. By exchanging appropriate forces all of them together will form the fluid. All the phenomena written above are not programmed explicitly, but emerge from local particle/particle interactions. The simulation runs at 60 fps on a GeForce285GTX.
The video plays back at half tempo because it is set up to 30fps where the original rendering was 60fps.
My plan is to add (particle based) rigid bodies as well and to perform finite element analysis on them so they can break apart if external forces exceed the bonding forces.
« Additizer: Realtime additive synthesizer Some older projects added »
You post informative posts Just bookmarked !!!
its not in 3 dimensions, is it?
what’s the collision request, rangebased?
how did you solve the differential equation of Movement, euler-chauchy?
best regards, nice simulation.
hi,
thanks for your comment.
this is purely 2d, as this was planned for some 2d physics-based game of some sort (but so far i havn’t continued). also i couldn’t effort enough particles to fill a 3d space while running at 60fps.
the collision request is range-based. if 2 particles come close enough they interact proportional to their proximity.
integration of motion is done with a modified euler-method (i dont remember the exact name of it). the only difference to normal euler is that position is updated with the old velocity. then i relax the particle positions and afterwards compute the new velocity from the old and new position.
hope this helps 🙂