In thermodynamics , a heat engine is a system that performs the conversion of heat or thermal energy to mechanical energy which can then be used to do mechanical work .
A heat engine is a device that converts heat into mechanical motion that can be used to do work .