# How does EPANET calculate the flow

Hello,

I am currently working on an EPANET project realizing that I don’t understand how EPANET is calculating the flow in the pipes. So this is an example of what I mean.

Reporting time steps 1h unit CMH
I have a tank connected with a pipe coming from a FCV valve delivering constant 600 CMH. The outlet pipe takes a flow of about 1109 CMH except those time steps when the flow is zero.
The total takeout for the first 24 h is 23,326 from 24 to 48 it is 21,090 and from 48 till 72 it is 18,874. This totals to an amount of 63,290 CM for 72h. If I still add the amount usable in the tank it adds up to 63,494 CM. But actually it should not exceed 43,403 CM. Could someone explain me where the 20,090 CM are coming from? It would be highly appreciated!

Tanks on EPANET sometimens give weird results. In general, the flow out and in (if not using a FCV) depends on the tank level, and this level changes by the net flow on tank. It occurs continuously at real world, but discretely on any model. EPANET calculates that net flow (IN-OUT), then the new tank volume and consequent tank level, at each steps. So, the larger time step, the ‘bad’ that approximation.
That gets ugly when tank is full or empty. If the level is out of limits, an additional short time step is created, and the next flow is corrected (outlet flow zero if tank turns empty, for example). I don’t know if there is a good way for overcome this issue, I was working on the idea to create several additional steps (inside EPANET functions), but it’s not well implemented yet.