Explaining the Liquid Demo?

I want to build a fluid physics simulation similar to the LiquidTest in the test bed. I've looked at the code, and I understand a little. But, I'm really more lost than reaching full enlightenment yet. Could someone explain the high level approach of how the simulation is put together?

Some of the questions I had were:

What is the purpose of the location hashes? If I had to guess it would be to grid out the locations of the liquid particles for testing which particles are in which cells. I suppose this is to apply forces to neighboring particles.

What is the applyLiquidConstraints() doing? Or maybe how is it modeling the liquid? Maybe that's a better question.

What is the purpose of the rad instance variable? It looks like that is used to figure out if particles near by have any influence on the current particle or not. What is the scale invariant comment about? Or what dangers await for me if I tried to copy this algorithm? 🙂

What does setting the groupIndex do? Does this help with clustering? (I don't think it does, but I'm not sure what its purpose is if not).

Code:
fd.filter.groupIndex = -10;


And if I wanted to improve the rendering of the liquid so that it appeared more like a liquid. In the current rendering you can see the individual particles of the fluid. What ideas are there to perform clustering and render that cluster as a whole droplet let's say? I'm thinking of creating a bounded box and you grow the boxes' bounds based on the rad distance between particles. However, you want to keep track of the particles on the edges so you could draw a shape connecting all of them. If this were successful it would seem like it could replace the hashing scheme, but it might be computationally expensive to compute.
having a negative group index means that 2 objects with the same negative group index won't collide.
rad might mean radius.
Sorry can't answer any of the other questions, I don't know the answers.
to simulate droplets you might want to use blob joints
This is a rather old test, but it uses SPH water simulation, and basically applies a cohesion (attractive) force to nearby particles that are a little far away, and a repulsive force to particles that are too close.

Original thread: https://box2d.org/forum/viewtopic.php?t=8056