Planetary Applications of Thermodynamics