This seems more like metaballs than a lava lamp simulation. The balls interact before they touch.
Metaballs are different. They are essentially a visualization of electric or gravitational fields. For the traditional formula in 2D, each pixel is colored based on the weighed sum of the inverses of the distances to the center of each "ball".
Here's a good example if you're interested. https://peeke.nl/simulating-blobs-of-fluid