Heat engine is a system that convert thermal energy into mechanical energy.
It is a traditional energy conversion system. Steam engine, internal combustion engine, and gasoline engine belong to the heat engine category. The second law of thermodynamics concerns the maximum work that can be drawn or the highest efficiency from the machine. The maximum work can be obtained when the machine reversibly operates. The efficiency depends on the temeprature of the heat source and the heat sink.