Author Topic: Pressure Checkerboarding  (Read 2175 times)

0 Members and 1 Guest are viewing this topic.

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Pressure Checkerboarding
« 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?
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.