All Forums

Hello,

I'm working on the coupling of  SWMM with a homemade 2D superficial flow model. The later is written in Python.

For this purpose, I'm currently writing a Python wrapper for SWMM using ctypes. So far I managed to control a simulation from Python using swmm_step() and get results at each time-step using node_getResults(). 

But for my purpose I will need to exchange nodes data at runtime. Simply put, at each time-step I need to read values from given nodes, and then update them before the next time-step.

From what I've read in this forum about Matlab-SWMM interface, a proposed solution would be to run a full SWMM simulation between two "exchange time", read output files, update input files and run a new simulation. However I'm afraid this solution would introduce a severe overhead with file reading and writing.

So I'd like to know from people who have good knowledge of SWMM source code, if there is a safe way to change some node data during a simulation.

Thanks for your help.

You need to be a member of SWMM 5 or SWMM or EPASWMM - (not formally associated with EPA) to add comments!

Join SWMM 5 or SWMM or EPASWMM - (not formally associated with EPA)

Email me when people reply –

Replies

  • I am looking to try the same thing with a FREE and OPEN SOURCE model called ANUGA. It is developed by researchers at the Australian National University  and Geoscience Australia https://en.wikipedia.org/wiki/ANUGA_Hydro#ANUGA https://anuga.anu.edu.au/ https://github.com/GeoscienceAustralia/anuga_core

    Yes any tips would be much appreciated....

  • Hello everybody!, I have encountered the same issue in the last year, and because of this I have developed an open source solution to replicate the SWMM algorithm in Matlab, Python, and LabVIEW easily. I have called it MatSWMM an it is available at: https://github.com/water-systems/MatSWMM

    MatSWMM can be useful to model Real-time control for urban drainage systems, extract simulation results and edit systematically a system that has been created with the SWMM platform. I hope this can be useful to fullfil the requirements of the unpleasant batch simulation problems. 

    Please check it out, and feel free to contact me (ga.riano949@uniandes.edu.co) if any doubt or suggestion appears. 

This reply was deleted.