Thursday, February 17, 2011

Unstable Particles = Not Quite Liquid

So after setting up the particle system last week, this week I attempted to start getting it to behave as a fluid.  Mostly, I have been closely following the Clavet paper, which is essentially simplified SPH with viscoelastic effects, but the fact that we are covering fluid sim in Physically Based Animation definitely helps.

Right now, however, I have hit up against some problems.  Although at least there are visible particle and they are moving, right now I am running into some weird errors, such as that the particles are flying off of the plane, so I have had to reign back on some of the effects such as viscosity, etc. until I can figure out was is going on.  I also am currently using a simple arrayList (c++ std::vector) as the particle data structure, making the spring effects intractable in real time, so I am now trying to switch everything over to using the Heckbert spatial hashing grid data structure that I added to my framework.

Anyway, here is the video of the unstable particles. If you squint your eyes, I guess it sort of looks like a liquid...



Although I had hoped to start on the implicit representation soon, my current plan for next week (in addition to preparing for the alpha review) is as follows:
  • Switch over to using a simple spatial hashing grid (or Heckbert's fast repulsion grid) instead of std::vector
  • Get some sort of reasonable looking stable fluid with at least some of the effects I mentioned last week working.
  • As the main idea is that the simulation be interactive liquid, get some sort of rough user interaction working (e.g. clicking and applies a force vector).
  • More background reading on high surface tension
Obviously the second bullet point is going to be the most time-intensive, but I'm confident that now that I have the basic framework, GUI, data structure, time-loop, and pseudo-code written out I will be able to make a lot more progress.

3 comments:

  1. So are you currently doing linear search to accumulate forces from nearby particles?

    ReplyDelete
  2. Yeah, so pretty much O(n^2) search time. It wasn't running at real time so I had to pull back most of the particle-particle interaction until I put in spatial hashing. Then if I set the grid size to be radius of interaction I'm interested in I think I'll only need to search neighboring cells.

    ReplyDelete
  3. Well, if you assume that you're viewing the simulation under a strobe light, then it sort of looks like a liquid!

    Nice icons in your gui!

    ReplyDelete