A study of waterhammer including effect of hydraulic losses