A steam engine uses a coal fire (although there are some exceptions) as its source of energy to boil water and make steam.
The hot gases from the burning coal in the firebox are passed through the boiler in ‘fire tubes’ (144 in the case of the ‘Barclay’ Locomotive above), before leaving the engine via the smoke-box and chimney.
As the water in boils, the hot “wet” steam rises, and is collected from the steam dome on top of the boiler through the regulator valve, which the driver uses to control the locomotives speed.
From the regulator, steam is piped to the cylinders, and is admitted alternatively via the valve-chests (located on the side of the Cylinder housing), pushing the piston in the Cylinder back and forth.
The piston is connected to the driving wheels via the ‘connecting rod’ and ‘crank’ (or ‘valve gear’ as it is commonly called), and the to-and-fro motion of the piston turns the driving wheels. Each time the cylinder piston moves back and forth, the driving wheel completes a full rotation.
The ‘crank’ linkage on each side of the loco is offset by 90 degress to prevent it from jamming if the loco stop with them in the horizontal position.
After leaving the cylinder, the spent steam escapes from the engine via the blast-pipe and up into the chimney in the smokebox. The action of steam in the blast-pipe creates a lower pressue in the smoke-box, and helps to draw the hot gases from the fire through the boiler tubes and in-turn generate more steam.