A thermo-visco-plastic damage model and SPH simulations of plugging failure