With dynamic electricity pricing, the operation of water distribution systems (WDS) is expected to become more variable. The pumps moving water from reservoirs to tanks and consumers can serve as energy storage alternatives if properly operated. Nevertheless, the optimal scheduling of WDS is challenged by the hydraulic law for which the pressure along a pipe drops proportionally to its squared water flow. The optimal water flow (OWF) task is formulated here as a mixed-integer non-convex problem incorporating flow and pressure constraints, critical for the operation of fixed-speed pumps, tanks, reservoirs, and pipes. The hydraulic constraints of the OWF problem are subsequently relaxed to second-order cone constraints, and a penalty term is appended to its objective to promote solutions feasible for the water network. The modified problem can be solved as a mixed-integer second-order cone program, which is analytically shown to yield WDS-feasible minimizers under certain sufficient conditions. By weighting the penalty in the objective of the relaxed problem, its minimizers can attain arbitrarily small optimality gaps, thus providing OWF solutions. Numerical tests using real-world demands and prices on benchmark systems demonstrate the relaxation to be exact for several cases, including setups where the sufficient conditions are not met.Index Terms-Water flow equations, convex relaxation, secondorder cone constraints, optimal water flow.