Continuous and discrete operation of water distribution networks