OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

Constant horsepower pumps giving incorrect results #668

Closed lbutler closed 2 years ago

lbutler commented 2 years ago

In the attached example network a pump with constant power is seeing excessive pressure in the latest dev build.

In v2.2 the pressure at node 'PUMP_DOWN' is 4.22, while in dev it is 148,022.84m.

I had a quick check and the error first appears in this commit by @LRossman which modified head loss and gradient calculations for constant horsepower pumps. - https://github.com/OpenWaterAnalytics/EPANET/commit/409a6004556d4796e9b34

You can see the issue in this replit which compares epanet v2.2 and dev: https://replit.com/@lbutler1/epanet-v22-vs-devconstant-hp-pump#main.c

Constant power pump issue.inp.zip

allenmlowe commented 2 years ago

Your attached example network works as intended. Your pump with a constant power of 50 KW will give a zero flow in it because there is no demand after the pump and since pump is constant it will try to compute the needed head for 0 flow which is infinite or a big number instead of the 4.22 as computed in the old v 2.2.

The only question now is should it remain open when flow is zero?

lbutler commented 2 years ago

My mistake, I over looked the zero flow. I'll leave this open for a bit to see if there are any other comments on if the pump should remain open when flow is zero

jamesuber commented 2 years ago

I think it should be open. The physical situation is where a pump without a controller is actually trying to push water through a closed valve or dead end with zero demand, which is a bad idea but would cause the pump impeller to spin and use power and be frustrated, until someone added a control loop of some kind. It may be tricky to use epanet to mimic such a control loop in this instance but that’s a separate question.

Jim Uber, Ph.D. Director, Drinking Water Network Optimization

Xylem - Digital Solutions

@.**@.>

M: 513.368.6303


From: Luke Butler @.> Sent: Monday, March 28, 2022 5:38:32 AM To: OpenWaterAnalytics/EPANET @.> Cc: Subscribed @.***> Subject: Re: [OpenWaterAnalytics/EPANET] Constant horsepower pumps giving incorrect results (Issue #668)

My mistake, I over looked the zero flow. I'll leave this open for a bit to see if there are any other comments on if the pump should remain open when flow is zero

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/OpenWaterAnalytics/EPANET/issues/668*issuecomment-1080598943__;Iw!!OKzgfr8!LUfxNA_ni8OHWqGRUwq2j-5UOekQDwIG1fJYb9Y9hT9TV5KHRfLGk-tJxaV57gUc0Ik$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AASMACNXYDUP5EFA72RMCILVCGR4RANCNFSM5RZ2FK5A__;!!OKzgfr8!LUfxNA_ni8OHWqGRUwq2j-5UOekQDwIG1fJYb9Y9hT9TV5KHRfLGk-tJxaV5QsbVZtg$. You are receiving this because you are subscribed to this thread.Message ID: @.***>

LRossman commented 2 years ago

I've tested changing the way that the asymptotic tails of a constant horsepower pump curve are handled. For @lbutler 's example the resulting heads (same as pressure for this example) look more reasonable as shown below:

image

The pump remains open but has no flow through it due to the closed pipe. Note that the PRV at the end of the line is ACTIVE even though it seems there is no flow through it. As EPANET's solver doesn't allow flow to be exactly zero, there is actually some small amount (< 10e-6 LPS) flowing through it which triggers the PRV's setting.

If no one objects I will commit the change and submit a PR.

lbutler commented 2 years ago

Thanks for your work @LRossman, as you've seen there are some strange setups in this network and its not realistic. It was created as part of a CI/CD process and thats where we notice the difference between v2.2 and dev.

I look forward to seeing the commit and trying it out

lbutler commented 2 years ago

Closing after merge of #669 - thank you everyone!