On the Thermodynamics of Planetary Impact Events