fluid dynamics?

BlitzMax Forums/BlitzMax Programming/fluid dynamics?

Nate the Great(Posted 2009) [#1]
hey.

Is there anyone here that is experienced in the field of fluid dynamics? I am trying to write a fluid engine and I decided to throw together a quick test to test my ideas before I change the actual engine.

So here it is so far. (it isnt optimized at all so dont expect the fastest engine)



Here's how it works:

the vars rad1,rad2,rad3 are 3 radiuses
from the distance 0 to rad1, the particles repel eachother
from the distance rad2 to rad3 the particles attract eachother

so thats the basics but some problems that arose:

The particles form grids that just look bad.
The particles aren't bouncy enough and dont look fluid

Has anyone made a fluid engine yet? or does anyone have solutions to the two problems I have.

I am asking more for concepts than code :)


Controls for the code above
rightclick to switch gravity axis
leftclick to add particles


Warpy(Posted 2009) [#2]
The Navier Stokes equations govern how fluids flow. They're nonlinear, so they can't be solved exactly, but if you google around you might find an explanation of how to model them in code.


Nate the Great(Posted 2009) [#3]
I am looking more for a particle based simulation. But ill look into Navier Stokes


Arowx(Posted 2009) [#4]
This is a great video of the kind of effect you are probably after, haven't followed the links but found it when I did a search on Verlet Integration, I've heard it mentioned regarding particles/physics and thought you might be interested in looking into it further...

http://www.youtube.com/watch?v=0bL80G1HX9w


Nate the Great(Posted 2009) [#5]
oo thanks merx!

I saw that once a long time ago but I never have been able to find it! I had just given up.

hmm so now it tops out at 1000 particles with a few enhancements :)