motor that converts thermal energy to mechanical work