A steam engine is a heat engine that performs mechanical work using steam as its working fluid. In simple terms, the steam engine uses the expansion principle of chemistry, where heat applied to water transforms the water to steam. and then pushes a piston (cylinder). This pushing force is typically transformed, by way of a connecting rod and flywheel, into rotational force for work. The term "steam engine" is generally applied only to reciprocating engines as just described, not to the steam turbine.
Steam engines are external combustion engines, where the working fluid is separated from the combustion products. Non-combustion heat sources such as solar power, nuclear power or geothermal energy may be used. The ideal thermodynamic cycle used to analyze this process is called the Rankine cycle. In the cycle, water is heated and changes into steam in a boiler operating at a high pressure. When expanded using pistons or turbines mechanical work is done. The reduced-pressure steam is then exhausted to the atmosphere, or condensed and pumped back into the boiler.
In general usage, the term steam engine can refer to either complete steam plants (including boilers etc.) such as railway steam locomotives and portable engines, or may refer to the piston or turbine machinery alone, as in the beam engine and stationary steam engine. However, a more detailed look at the steam locomotive referred to the engine as only that part where the heat in the steam was turned into motion of the piston, and hence enabled separate statements for boiler efficiency and engine efficiency. Specialized devices such as steam hammers and steam pile drivers are dependent on the steam pressure supplied from a separate boiler.