how is hydropower generated in large dams