Calculating pressure loss along the pipes