From 532f89d14bd45f9447a68a3b38301bbbf96ab332 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Thu, 25 Jun 2020 20:11:27 +0300 Subject: [PATCH 1/2] Net1.inp have 0 MinorLoss / GUI accepts values zero for MINORLOSS. Similar to the parameter Power of pumps --- src/epanet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/epanet.c b/src/epanet.c index 04d74af..5e6b974 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -3862,7 +3862,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_MINORLOSS: if (Link[index].Type != PUMP) { - if (value <= 0.0) return 211; + if (value < 0.0) return 211; Link[index].Km = 0.02517 * value / SQR(Link[index].Diam) / SQR(Link[index].Diam); } @@ -3953,7 +3953,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_PUMP_POWER: if (Link[index].Type == PUMP) { - if (value <= 0.0) return 211; + if (value < 0.0) return 211; pumpIndex = findpump(&p->network, index); net->Pump[pumpIndex].Ptype = CONST_HP; net->Pump[pumpIndex].Hcurve = 0; From e0745e9dc534a67fe94e3f9f9e632c22530e1fbe Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Thu, 25 Jun 2020 20:22:12 +0300 Subject: [PATCH 2/2] Update epanet.c --- src/epanet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epanet.c b/src/epanet.c index 5e6b974..f2e33e4 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -3953,7 +3953,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_PUMP_POWER: if (Link[index].Type == PUMP) { - if (value < 0.0) return 211; + if (value <= 0.0) return 211; pumpIndex = findpump(&p->network, index); net->Pump[pumpIndex].Ptype = CONST_HP; net->Pump[pumpIndex].Hcurve = 0;