Conditions for crust and tube formation in lava flows with power-law rheology