A piston is a moving disk enclosed in a cylinder which is made gas-tight by piston rings. The disk moves inside the cylinder as a liquid or gas inside the cylinder expands and contracts. A piston aids in the transformation of heat energy into mechanical work and vice versa. Because of this, pistons are a key component of heat engines. Pistons work by transferring the force output of an expanding gas in the cylinder to a crankshaft, which provides rotational momentum to a flywheel. Such a system is known as a reciprocating engine.
A piston must follow a cyclical process in order for it to continuously convert heat energy to work, and there are many ways to complete this cycle. For example:
This cycle can be visualized in Figure 2 below.
These steps can be done differently and the processes can become very complex, however this is a simple example of how a piston can be made to perform useful work through the input of heat. It is known that this heat cannot be transformed fully into work, otherwise the entropy of the system would decrease which is forbidden by the Second law of thermodynamics.