Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: harold on November 23, 2012, 06:13:26 am

Title: Pressure Checkerboarding
Post by: harold on November 23, 2012, 06:13:26 am
I wrote a simple fluid simulator with a co-located grid for pressure (it seemed the easiest way to do it), and the thing I'm simulating can't use artificial velocity dampening (I'm simulating objects that move through air, it would be weird and improper if the air speed dropped towards one end of the screen). So I got pressure checkerboarding.

I "solved" that by sampling at 1.2 pixel offsets in all four directions (instead of the usual 1.0) in the jacobi iteration. That works because it samples into the pressure squares (of the checkerboard) and immediately smears them out, so they average out with their neighbours for the most part.

But what did I actually do in terms of physics? Does this violate any laws?

Also, slightly off-topic, there are some really bad effects caused by the fact that pixels are square - everything that isn't an axis-aligned line looks like a "stair" and it messes with the pressure. Is there some way I can easily simulate a smooth surface?