Transient cavitating flow in piping systems