Wednesday, April 18, 2012

And so it came to pass! (aka Finally!)

Wow. This feels like it's been a long time coming.

First of all, credit goes to Christine for not only being the one to realize we were setting up our A-Matrix wrong, but for essentially rewriting the linear algebra code from our smoke sims on a fundamental level to make things work (even if we ultimately don't use it). Also thanks to Joe, for confirming the theory I'd had (and dismissed) that we should be able to use the linear algebra code from the smoke sims if we just set all the values in rows of non-liquid cells to 0. With that in mind, I was able to go back into the code and pull this together:
http://www.youtube.com/watch?v=lX5Jyq8SNcI
 

You'll probably notice (of course) that not long after it hits the ground, the water... er... explodes, for lack of a better word. We're still working on that - after a certain point our PCG solver stops converging, resulting in insane, impossible pressures getting applied to the velocities and making the sim go crazy. We'll hopefully work out that bug soon.

Still, the main code clearly behaves as it's supposed to (up to a point), so the hardest part is (hopefully) behind us!

Here's a list of things we still need to do:
  • Fix our "does not converge" error so that the liquid stops behaving erratically.
  • Figure out the reason why resetting the simulation leads to more does not converge errors, and a difference in fluid behavior all around (less accurate on each "reset").
  • Allow for dynamic cell sizes. After a quick test, I've discovered that somewhere in our code we stopped being able to handle it if the cell size is not 1.
  • Level sets. We received feedback from our alpha (generally positive despite lack of working fluid simulation - thanks, Joe!) that said we really need level sets for our final project. So as soon as the bugs are ironed out of this one, that's likely the first thing we'll be tackling.
I'll update soon with more videos with cool stuff like larger cell sizes and different ways of initializing water (rectangular prisms, larger spheres, and a continuous water flow we call the "faucet") once we iron out a few of these errors.

Thanks for everything!

No comments:

Post a Comment