Calculation of work in pumping fluids