I was messing around trying to make some kind of foam with Blender’s particles, and it came out better than I expected so I thougth I’d post it here. :o
(Rendered with Luxrender with each particle rendered as a semi-translucent sphere.)
There are two particle systems here - one visible and one invisible. The invisible one is about 50 large (about 10% the size of the cube) particles all repelling each other with a “charge” force field. I just let them bounce around inside a cube, and added quite a lot of damping so they move slowly and find an equilibrium position. At the same time, I added thousands of tiny particles in a separate system. These don’t interact with each other (there are too many and the calculation would take forever) but they feel the force of the big particles. They too have high damping, and I gave them a lifetime so they would die at around the time the big particles had settled down and stopped moving. I selected the button to render dead particles, so you still see them but they just stop moving.
The idea of all this is to have the invisible large particles pushing the small particles away from certain positions, making hollows and indentations in the particle distribution so that it isn’t too uniform. If you look at the head of a glass of beer, sometimes you get large bubbles which push away the smaller bubbles. When the large bubbles burst, you’re left with a foam of small bubbles with indentations in where the large ones used to be. This ended up looking more like foam rubber than beer, but the idea is the same.