diff --git a/src/epanet.c b/src/epanet.c index 3b6a0d7..c763d9b 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -2380,6 +2380,7 @@ int DLLEXPORT EN_getnodevalue(EN_Project p, int index, int property, double *val // while DemandFlow contains delivered consumer demand if (hyd->FullDemand[index] <= 0.0) return 0; v = (hyd->FullDemand[index] - hyd->DemandFlow[index]) * Ucf[FLOW]; + if (v < 0.0) v = 0.0; break; case EN_NODE_INCONTROL: diff --git a/src/hydsolver.c b/src/hydsolver.c index 5d76bc6..a702361 100644 --- a/src/hydsolver.c +++ b/src/hydsolver.c @@ -702,7 +702,7 @@ int pdaconverged(Project *pr) { Hydraul *hyd = &pr->hydraul; - const double QTOL = 0.0001; // 0.0001 cfs ~= 0.005 gpm ~= 0.2 lpm) + const double QTOL = 0.0001; // 0.0001 cfs ~= 0.05 gpm ~= 0.2 lpm) int i, converged = 1; double totalDemand = 0.0, totalReduction = 0.0;