A dynamical model of lava flows cooling by radiation