Thermal evolution and differentiation of a short-period comet