Modelling the rheology and cooling of lava flows