Fluid mechanics shortcut

I’m making a system that simulates the bloodstream, and it goes a little like this.

Rather than messing with fluid mechanics, I figured I’d try a simplified approach, based on displacement maps. By drawing color loops whose hue represents the local flow of particles in a fluid system, particles can just look at the color of the pixel underneath them and figure out where to move next. (You can check this example out to get a look behind the scenes, though this one has ten thousand particles and isn’t properly calibrated to work perfectly.)

It’s a nice shortcut; there’s no physics involved in moving the particles around, it’s just painting the image, some indexing and some simple number crunching. To improve realism, each particle is evaluated using hitTestPoint(), and any particle that “escapes” the bloodstream is put back in at a random spot. (In this case, nobody knows the difference.) That first circulation system has got 2000 particles in it.

Now, the downside. This bloodstream simulation is supposed to also simulate the injection of a substance. (If you click part of the bloodstream, you’ll see the injection; the particles are yellow.) The point is to show the injected substance dissipating in the bloodstream, and that means if the injected particles dance off course, they can’t be randomly relocated; it’s just not convincing.

Does anyone have any ideas regarding this? Remember, this system isn’t simulated with physics. I’d like to know what you think.