Adding most of calculations for water network flow