Cavitation in horizontal pipelines due to water hammer