Heating and cooling of solids