Thermal energy transformation