OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
272 stars 201 forks source link

Add EN_openX function #758

Closed LRossman closed 8 months ago

LRossman commented 9 months ago

EN_openX()allows an EPANET input file to be opened even if it has errors. This required re-arranging code, mainly in input3.c, so that default values are assigned to an object before its input line is parsed. Also a new function, validateproject(), placed in the new code module validate.c, is used to check for valid tank levels and pump curve coefficients that were formerly made in input2.c.

lbutler commented 6 months ago

@LRossman a very minor comment from me - I noticed that as part of this update you removed the undocumented ability to set the demand multiplier from within the [DEMAND] section.

The code that has been removed from input3.c is below:

https://github.com/OpenWaterAnalytics/EPANET/blob/7b640122cdd3de25abcca2cadcafc1cd206d2106/src/input3.c#L801-L807

The only reason I know this exists is because we expectability ran into it affecting junction demands with ids start with the id mult*.

Interestingly this multiplier work with the GUI, but only with the keyword MULTIPLY, not MULT in the toolkit.

I was originally going to suggest maybe we depreciate it because it was causing issues with junctions but you've already done it here.

So my suggestion is that we include a note in the README that this undocumented feature was removed and that the multiplier be set inside the options.