Simulation of fluid flow over a height map

I’m looking for a way to approximate the volume of fluid moving along a height map. The simplest solution that I can think of is to approach it as a large number of not elongated spheres of small diameter (<0.1 m). Then I placed a visible plan representing the surface of the water at the "top" of the spheres, in the places where they stopped. As far as I know, no controlled physical engines contain a built-in liquid simulator, hence the question.

The implementation will consist of using a physical engine, such as JigLibX, which is able to simulate the movement of spheres. To determine the height of the planes, I thought about averaging the maximum height of each sphere located on the top layer of the grouping.

I do not expect performance to be great, but will it be available in real time? If not, can I use this simulation to pre-bake flow lines?

Hope this makes sense, I really need opinions / suggestions as to whether this is possible, or if there is a better way to approach this.

Thanks for any help, Venato

(If relevant, my target platform is XNA 4.0, using C #. Windows only at that point in time, so PhysX / Havok is a simulation tool, but I would prefer a managed solution)

+7
source share
3 answers

I have not seen the real-time fluid dynamics in real time, but have not yet used something like PhysX - perhaps because the required calculations are so complex! The problem with your approach, as I see it, will be related to the rest of the contact of all these areas when they are settled, which requires a lot of computing power. Many recreation points, as you know, go to work very quickly, even on the most powerful desktop computers.

If you follow this route, I would recommend simulating the fluid as an elastic but solid using spring-based physics, where the force applied to one part of the water would use the springs to propagate to the rest. This gives you the opportunity to set the spring break point and divide the body into two or more bodies when this happens (and vice versa, to return together). This can give you a reason for things like spray. It is also a more versatile approach in terms of performance, because you can choose the number of particles and springs that you use to get closer to your model.

This is a big and complicated topic, but I hope it provides at least some understanding!

+2
source

The most popular real-time fluid modeling technique is Smooth Particle Hydrodynamics .

Some useful links:

http://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics

http://http.developer.nvidia.com/GPUGems/gpugems_ch38.html

http://www.plunk.org/~trina/thesis/html/thesis_toc.html

In addition to the simulation, you will also need some specialized large-scale collision detection algorithms, such as sweeping and hashing cells.

And you are right, there are no ready-made 2d solutions for fluid dynamics.

+1
source

All Articles