Closed joelnc closed 10 months ago
@joelnc, @LRossman, @michaeltryby and @cbuahin , I just completed a few tests to confirm the problematic behavior. I was able to save the HSF and recreate the problem (using pyswmm-v1.5.1 (wrapping USEPA-SWMM-v5.2.4), Python-3.12, macos-13) with model 2_HSF_Example_JanFeb.inp
. I wrote a quick plotter that plots on the ROUTING step (rather than report step as @joelnc plotted it). First test was to determine if there was some bad model instability. There was nothing to report (I plotted results from that link):
I wrote a separate pyswmm script to run (3_HSF_Example_Mar.inp
) which used the "Saved" HSF from 2_HSF_Example_JanFeb.inp
. I was experiencing a seg fault.
Next, in 2_HSF_Example_JanFeb.inp
I removed [POLLUTANTS]
, [BUILDUP]
and [WASHOFF]
sections from the model and re-ran it to generate a new HSF. Then I removed the same sections from 3_HSF_Example_Mar.inp
and re-ran it. It produced:
My conclusion is that if there are polluants in the model and you are turning them "off" (IGNORE_QUALITY YES
) in your model options, the HSF is created with a bunch of garbage results. This is only my hypothesis. When I turned WQ back on and then saved the HSF from 2_HSF_Example_JanFeb.inp
, running model 3_HSF_Example_Mar.inp
produced ERROR 335: error in reading from hot start interface file. It still seems related to #136 as @joelnc has identified.
I have put the Python scripts and requirements file here:
My running of @joelnc 's files using the current develop
branch indicates that the bug fix for issue #136 resolves the hotstart problem - even with Water Quality Processing turned off.
I ran a few models in SWMM 5.2.4 and cannot replicate these problems - maybe if you add a text file, you can better see what is happening in PySWMM
My conclusion is that if there are pollutants in the model and you are turning them "off" (IGNORE_QUALITY YES) in your model options, the HSF is created with a bunch of garbage results. This is only my hypothesis. When I turned WQ back on and then saved the HSF from 2_HSF_Example_JanFeb.inp, running model 3_HSF_Example_Mar.inp produced ERROR 335: error in reading from hot start interface file. It still seems related to https://github.com/USEPA/Stormwater-Management-Model/issues/136 as @joelnc has identified.
Thanks all for taking a look and diving in. It has taken me a bit of time to run through various test iterations under different builds, but it now seems that via the bug_fixes
branch, hydrographs match / line up as expected on some test hot start applications, even with WQ simulation of three pollutants turned on. And pollutants also appear to track as expect across runs thus far.
I'll have to take a few steps back on my workflow now that Mod. Horton and hot starts are both working, and will report any other issues / edge cases encountered as I get back up to speed. Thanks again for the fixes and direction on all of this.
I initiated this on the U. of Guelph list back in Oct., but am still running into problems not directly related to the known multiple pollutant issue / https://github.com/USEPA/Stormwater-Management-Model/issues/136.
In the attached zip (hsf_testing_inps.zip), I have 3 self contained models,
1_HSF_Example_FullRun.inp
, running Jan-Mar2_HSF_Example_JanFeb.inp
, running Jan and Feb only, writing a HSF, and3_HSF_Example_Mar.inp
, running March only, using the HSF from2_HSF..
Link of interest for the full 3 months:
If I use
Options --> Interface Files
and spec the HSF I get a 146 KB .hsf that produce a junk data simulation for March:If instead, I go into
File --> Export
and create the HSF that way for the March only run, I get a 10 KB .hsf that produces a realistic looking hydrograph, but the event peaks at only half the flow rate that I get for the same March event when I run the 3 months in a single model without a .hsf.Then in a separate larger model with external rainfall/climate files (not posted), the 1.9 MB .hsf via
Options --> Interfacing Files
creates error:ERROR 335: error in reading from hot start interface file.
, won't run at all.A .hsf via
File --> Export
will run, but node and link values don't seem to carry through. E.g., here is the first part of Jan with the .hsf then exported after running it:But then picking up one minute later on the next day, using that .hsf, node depth and flow start again from 0:
In other iterations, I've hit the same (either
ERROR 335
; weird/extreme values; lack of depth/flow carry through), all on version 5.2.4.Any insights appreciated.