Gas simulation, 2D.


Instead of having more than 10000 particles I made the point sizes of all particles larger, which ended up looking better than just a larger number of smaller particles. The main forces in action here are viscosity (makes movement of gas slower, especially in larger clumps of particles), buoyancy (whether or not the particle floats based on the gas's rest density), pressure (forces clumps of particles to spread out).
Images below:

Simulation just using one gas:

Gas uniformly spread:


Gas condensed in center:


Gas starts to spread from pressure:


Gas spreads out:




Simulating using two gases. Red starts on top and is heavier and less buoyant. Blue starts on bottom and is lighter and more buoyant.

Two gases in their starting states.


Red gas pushes blue gas down because it's heavier, the gases start to mix.


Two gases mix further, more buoyant lighter blue gas starts to escape to the top.


Blue gases float to top and separate leaving red gas below, some blue gas remains within red gas. Gas way at the bottom becomes compressed more from weight of red gas.