A theorem based on law of conservation of energy has been explained- Bernoulli's theorem.
Note* for open channel flow- total energy (in terms of head) = datum head +flow depth + velocity head while for pipe flow- total energy (in terms of head) = datum head + pressure head + velocity head.