Like an internal combustion engine or steam engine, a Stirling engine repeats a set of fundamental actions called its cycle to transform heat energy into mechanical energy (work). Let's look at a simplified Stirling engine of the displacer kind. It's pretty perplexing and difficult to understand before you discover that the gas within is alternating between expanding and contracting and going from the hot side of the cylinder to the cool side and back again. The function of the dark blue work piston is to compress the gas so that the cycle can repeat after using the energy from the gas's expansion to power the machine the engine is powering. The green displacer piston must move the gas from the cylinder's hot side (on the left) to its cold side (on the right) and back again. Together, the two pistons ensure that heat energy is continuously transferred from the source to the sink and transformed into practical mechanical work.

In detail

  1. Cooling and compression: Most of the gas is located near the more fantastic end of the cylinder on the right, as indicated by the blue squares. Both pistons move inward (toward the centre) as they cool and compress, releasing part of their heat that is then taken away by the heat sink.
  2. Transfer and regeneration: The cooled gas travels around the displacer piston, which is moving to the right, to the hotter area of the cylinder, which is on the left. As the gas returns through the regenerator (heat exchanger) to absorb some of the previously deposited heat, its volume stays constant.
  3. Heating and expansion: The cylinder's hot end now has most of the gas on the left (shown by the red squares). The fire (or other heat source) raises its pressure, causing it to expand and absorb energy. The working piston is pushed to the right by the expanding gas, which powers the flywheel and whatever else the engine is driving. The engine transforms thermal energy into mechanical energy during this phase of the cycle and thus produces work.
  4. Transfer and cooling: The hot gas travels around the displacer piston, which moves to the left and into the more relaxed area of the cylinder on the right. The gas gives up some energy as it travels through the regenerator (heat exchanger), but its volume stays constant. Now that the cycle is finished, it can begin again.

Even though the engine completes a cycle and returns to its starting point, the process is not symmetrical since energy is continuously taken from the source and placed at the sink. This occurs due to the hot gas exerting some force on the working piston during expansion, whereas the piston exerts less force when compressing the cooled gas and bringing it back to the starting point.

In theory

You may be thinking, "This is all complicated! When a rudimentary steam engine can function with just one piston, why tinker with two? Why are there so many distinct stages? Why not simplify the entire situation? It would help if you adequately comprehended engine theory to respond to those inquiries. According to the gas laws,  the fundamental principles of classical physics specify the relationship between a gas's pressure, volume, and temperature, and an efficient engine propels a gas through a cycle of processes. The most well-known idealized cycle,  the Carnot cycle, consists of repeating a cycle of adiabatic (heat-conserved) and isothermal (constant temperature) expansion, followed by isothermal and adiabatic compression.

A distinct cycle is used by a Stirling engine, which should ideally include:

  1. Isothermal (constant temperature) compression: Above is our stage (1), where the gas releases heat to the sink while its volume drops and pressure rises.
  2. Isovolumetric (constant volume) heating: As the gas returns via the regenerator and recovers some of its prior heat, the volume of the gas stays constant in step (2) above.
  3. Isothermal (constant temperature) expansion: As the gas absorbs energy from the source, its volume rises, and its pressure falls, but its temperature stays steady, as shown in stage (3) above.
  4. Isovolumetric (constant volume) cooling: As the gas passes through the regenerator and cools, its volume stays constant in step (4) above.

A more complicated, less ideal version of this cycle powers a real Stirling engine, but that is outside the purview of this article. The fact that the four phases aren't strictly distinct but merge into one is sufficient. If you're interested, Wikipedia's article on the Stirling cycle has much more information about this.