Thermal energy and density