New tech turns industrial energy waste into drinking water and heat