how do reciprocating heat engines work?

2 answers

There are various thermodynamic cycles in internal combustion and "steam" external combustion engines. I suggest you review Otto cycle (four-stroke automobile), Stirling cycle, Clerk cycle (two stroke), Diesel cycle and Rankine cycle (steam), using Google.
Note that the theoretically optimum Carnot cycle is not used in practice. It is simply too hard to implement in a high-rpm mechanical device. As I recall, the Stirling cycle comes closest, but you don't see it used often. The Stirling cycle is an external combustion method.

http://en.wikipedia.org/wiki/Stirling_engine