Hydroelectric power is the energy derived from flowing water in rivers, or from man-made installations where water flows from a high-level reservoir down through a tunnel and away from the dam. Water power was used for centuries to power machinery, for example for grinding corn or in mills and factories, but was largely replaced by steam power in the Industrial Revolution. Water power is now mainly used to generate electrical energy.