+ All Categories
Home > Documents > February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission:...

February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission:...

Date post: 20-Apr-2020
Category:
Upload: others
View: 12 times
Download: 0 times
Share this document with a friend
82
Take your Stormwater Modelling to next level with PySWMM and the Open Water Analytics initiative Gonzalo Andrés Peña-Castellanos @goanpeca PyCon Colombia EAFIT, Medellín February 9 th , 2018
Transcript
Page 1: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Take your Stormwater Modelling to next level

with PySWMM and the Open Water Analytics initiative

Gonzalo Andrés Peña-Castellanos @goanpeca

PyCon ColombiaEAFIT, Medellín

February 9th, 2018

Page 2: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● About● The (Urban) Water Cycle● On Modelling… (How, What, Why, How)● On Hydrology, Hydraulics and Water Quality

Intermission: on the perils of CFD

● EPA - SWMM

Intermission: networking, lying and coding

● OWA● SWMM API● PySWMM API● Expanded PySWMM API (Under Construction)● Roadmap and future work

Content

Page 3: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

About@goanpeca

Civil Engineer

● MSc Hydroinformatics (2010)● MSc Sanitary Engineering (2012)

● PhD dropout (2015)

Page 4: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

About@goanpeca

‘Software Engineer’Civil Engineer

● Python developer since 2009● Spyder IDE Core Developer since 2014 http://spyder-ide.org

● PyBee Project Area leader since 2017 https://pybee.org

● MSc Hydroinformatics (2010)● MSc Sanitary Engineering (2012)

● PhD dropout (2015)

Page 5: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

About@goanpeca

‘Software Engineer’Civil Engineer

● Python developer since 2009● Spyder IDE Core Developer since 2014 http://spyder-ide.org

● PyBee Project Area leader since 2017 https://pybee.org

PySWMM core developer since 2017

● MSc Hydroinformatics (2010)● MSc Sanitary Engineering (2012)

● PhD dropout (2015)

Page 6: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● Different processes

● Different flows and interactions

The Water Cycle

Source: http://www.blueplanet.nsw.edu.au/SiteFiles/blueplanetnsweduau/Watercycle.gif

Page 7: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

The UrbanWater Cycle

Similar as the water cycle we were taught at school, but with humans messing things up with dams, pipes, roads, crops and varying loadings of

Source: http://constantine.typepad.com/.a/6a0120a7fc3be9970b016305b9674c970d-800wi

Page 8: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

The UrbanWater Cycle

Similar as the water cycle we were taught at school, but with humans messing things up with dams, pipes, roads, crops and varying loadings of

Source: http://constantine.typepad.com/.a/6a0120a7fc3be9970b016305b9674c970d-800wi

Page 9: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

How do we model this system?

Page 10: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Whatis a model?

Is a way to understand,

define, quantify, visualize

reality by referencing to

existing and usually commonly

accepted knowledge.

<Insert Pipe Here>

Page 11: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Is a way to understand,

define, quantify, visualize

reality by referencing to

existing and usually commonly

accepted knowledge.

Whatis a model?

Page 12: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Is a way to understand,

define, quantify, visualize

reality by referencing to

existing and usually commonly

accepted knowledge.

The Treachery of Images

(This is not a pipe)

René Magritte

Source: https://en.wikipedia.org/wiki/File:MagrittePipe.jpgWhatis a model?

Page 13: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● Evaluate influence of climate change

Why model urban water cycle?

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://news.nationalgeographic.com/content/dam/news/2017/02/12/conservative-climate-

change/

Page 14: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Why model urban water cycle?● Evaluate influence of climate change● Designing and sizing of drainage system

components

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://news.nationalgeographic.com/content/dam/news/2017/02/12/conservative-climate-

change/

Page 15: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Why model urban water cycle?● Evaluate influence of climate change● Designing and sizing of drainage system

components● Sizing detention facilities

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://news.nationalgeographic.com/content/dam/news/2017/02/12/conservative-climate-

change/

Page 16: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Why model urban water cycle?● Evaluate influence of climate change● Designing and sizing of drainage system

components● Sizing detention facilities ● Mapping flood plains of natural channel

systems

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://news.nationalgeographic.com/content/dam/news/2017/02/12/conservative-climate-

change/

Page 17: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Why model urban water cycle?● Evaluate influence of climate change● Designing and sizing of drainage system

components● Sizing detention facilities ● Mapping flood plains of natural channel

systems● Designing control strategies for minimizing

combined sewer overflows.● Evaluating the impact of inflow and

infiltration on sanitary sewer overflows.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://news.nationalgeographic.com/content/dam/news/2017/02/12/conservative-climate-

change/

Page 18: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

OutputsInputs

How do we model this system?Initial conditions Boundary conditions

Page 19: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

OutputsInputs

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Page 20: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

OutputsInputs

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Interactions

Interactions

Parameters

Parameters

Parameters

State (for a given time step)

State (for a given time step)

State (for a given step)

Page 21: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Inputs

T0

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Outputs

Flow rates

Flows

Mass flowsConcentrations

Interactions

Interactions

Parameters

Parameters

Parameters

State (for a given time step)

State (for a given time step)

State (for a given step)

Page 22: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Inputs

T0T1

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Outputs

Flow rates

Flows

Mass flowsConcentrations

Interactions

Interactions

Parameters

Parameters

Parameters

State (for a given time step)

State (for a given time step)

State (for a given step)

Page 23: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Inputs

T0T1

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Outputs

Flow rates

Flows

Mass flowsConcentrations

Interactions

Interactions

Parameters

Parameters

Parameters

State (for a given time step)

State (for a given time step)

State (for a given step)

Page 24: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Inputs

T0T1.....

Tn

How do we model this system?

Hydrology

Hydraulics

Water Quality

Initial conditions Boundary conditions

Outputs

Flow rates

Flows

Mass flowsConcentrations

Interactions

Interactions

Parameters

Parameters

Parameters

State (for a given time step)

State (for a given time step)

State (for a given step)

Page 25: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydrological modelling● Rainfall● Evaporation ● Snow accumulation● Storage● Infiltration ● Percolation ● Interflow ● Overland flow

Source: https://cdn.pixabay.com/photo/2016/09/04/07/02/bucket-1643406_960_720.pnghttps://www.epa.gov/water-research/storm-water-management-model-swmm

Page 26: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydrological modelling● Rainfall● Evaporation ● Snow accumulation● Storage● Infiltration ● Percolation ● Interflow ● Overland flow

Source: https://cdn.pixabay.com/photo/2016/09/04/07/02/bucket-1643406_960_720.pnghttps://www.epa.gov/water-research/storm-water-management-model-swmm

“Buckets”

Page 27: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydrological modelling● Rainfall● Evaporation ● Snow accumulation● Storage● Infiltration ● Percolation ● Interflow ● Overland flow

Source: https://cdn.pixabay.com/photo/2016/09/04/07/02/bucket-1643406_960_720.pnghttps://www.epa.gov/water-research/storm-water-management-model-swmm

“Buckets”

Page 28: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

● Drainage networks● Natural channel flows ● Model special elements, such

as:○ Storage○ Flow dividers○ Pumps, weirs, and

orifices.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

The 1D Saint-Venant Equations(Derived from the Navier Stokes Equations)

Page 29: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

● Drainage networks● Natural channel flows ● Model special elements, such

as:○ Storage○ Flow dividers○ Pumps, weirs, and

orifices.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

Links and nodes

The 1D Saint-Venant Equations(Derived from the Navier Stokes Equations)

Page 30: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

● Drainage networks● Natural channel flows ● Model special elements, such

as:○ Storage○ Flow dividers○ Pumps, weirs, and

orifices.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

Links and nodes

The 1D Saint-Venant Equations(Derived from the Navier Stokes Equations)

Page 31: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

● Drainage networks● Natural channel flows ● Model special elements, such

as:○ Storage○ Flow dividers○ Pumps, weirs, and

orifices.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

Geometry 1

Geometry 2

Links and nodes

The 1D Saint-Venant Equations(Derived from the Navier Stokes Equations)

Page 32: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Water quality modelling

● Pollutant build up ● Pollutant wash-off ● Routing of water quality

constituents through the system.

● Changes in constituent concentration through treatment in storage units or by natural processes in pipes and channels.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

The 1-D Advection Dispersion Equation

Page 33: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Water quality modelling

● Pollutant build up ● Pollutant wash-off ● Routing of water quality

constituents through the system.

● Changes in constituent concentration through treatment in storage units or by natural processes in pipes and channels.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

The 1-D Advection Dispersion Equation

X

t0

Page 34: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Water quality modelling

● Pollutant build up ● Pollutant wash-off ● Routing of water quality

constituents through the system.

● Changes in constituent concentration through treatment in storage units or by natural processes in pipes and channels.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

The 1-D Advection Dispersion Equation

X

t0

t1

Page 35: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Water quality modelling

● Pollutant build up ● Pollutant wash-off ● Routing of water quality

constituents through the system.

● Changes in constituent concentration through treatment in storage units or by natural processes in pipes and channels.

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

The 1-D Advection Dispersion Equation

X

t0

t1

t2

Page 36: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

<intermission name=”navier-stokes”>

Page 37: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

In Computational Fluid Dynamics (CFD) we have a deity:

The Navier-Stokes Equations

Source: https://www.simscale.com/docs/_images/2-Newton-Navier-Stokes.jpghttps://www.grc.nasa.gov/www/k-12/airplane/Images/nseqs.gif

Page 38: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

In Computational Fluid Dynamics (CFD) we have a deity:

The Navier-Stokes Equations

Describe viscous flows

Source: https://www.simscale.com/docs/_images/2-Newton-Navier-Stokes.jpghttps://www.grc.nasa.gov/www/k-12/airplane/Images/nseqs.gif

Page 39: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

In Computational Fluid Dynamics (CFD) we have a deity:

The Navier-Stokes Equations

The Kelvin–Helmholtz instability

Source: https://www.quantamagazine.org/mathematicians-find-wrinkle-in-famed-fluid-equations-20171221

Source: https://www.metoffice.gov.uk/

Page 40: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

In Computational Fluid Dynamics (CFD) we have a deity:

The Navier-Stokes Equations

Source: http://www.claymath.org/millennium-problems

Page 41: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

In Computational Fluid Dynamics (CFD) we have a deity:

The Navier-Stokes Equations

Source: http://www.claymath.org/millennium-problems

Do solutions exist?Are they unique?

Page 42: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

But last September / October

Source: https://arxiv.org/abs/1709.10033

Page 43: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

But last September / October

Source: https://arxiv.org/abs/1709.10033

Page 44: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

Deobfuscating the title:

Source: https://www.quantamagazine.org/mathematicians-find-wrinkle-in-famed-fluid-equations-20171221

Source: https://arxiv.org/abs/1709.10033

Page 45: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Hydraulicmodelling

Deobfuscating the title:

Output nonsenseSource: https://www.quantamagazine.org/mathematicians-find-wrinkle-in-famed-fluid-equations-20171221

Source: https://arxiv.org/abs/1709.10033

Page 46: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

</intermission>

Page 47: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

US EPA: United States Environmental Protection Agency

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://www.epa.gov/water-research/epanet

Page 48: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

US EPA: United States Environmental Protection Agency

EPANET(Water distribution) EPANET first appeared in 1993

SWMM(Sewers) First developed between 1969–1971

Source: https://www.epa.gov/water-research/storm-water-management-model-swmmhttps://www.epa.gov/water-research/epanet

Page 49: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM: StormWater Management Model

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

Page 50: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM:So where isthe API?

Source: https://www.openswmm.org/Forum

How to automate modeling?

Page 51: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

(EPA) SWMM:Is on GitHub

Source: https://www.github.com/USEPA

For some years already...

Page 52: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Go check them out!https://github.com/usepa

Plus a bunch of other tools!

Katy Huff Keynote PyCon US 2017https://www.youtube.com/watch?v=kaGS4YXwciQ

Page 53: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Limitations:

● Originally Windows only● (until 2015) no API to interact

programmatically with models● No bindings for a higher level

language● This GUI is showing its age…● Control Language not flexible

enough for fast pace iteration

SWMM: StormWater Management Model

Source: https://www.epa.gov/water-research/storm-water-management-model-swmm

Page 54: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

<intermission name=”networking-and-lying”>

Page 55: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2012

● https://pypi.python.org/pypi/SWMM5 (SWIG)

● https://pypi.python.org/pypi/SWMM5_EA

GonzaloDoing MSc. thesis “Evaluating the impact of climate change on urban scale extreme rainfall events”

Assela PATHIRANA Associate Professor of Integrated Urban Water Cycle Management

Page 56: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2012

● https://pypi.python.org/pypi/SWMM5 (SWIG)

● https://pypi.python.org/pypi/SWMM5_EA

GonzaloDoing MSc. thesis “Evaluating the impact of climate change on urban scale extreme rainfall events”

Assela PATHIRANA Associate Professor of Integrated Urban Water Cycle Management

Downscaling

Urban Modelling

Python

Global climate models

Page 57: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2012

Assela PATHIRANA Associate Professor of Integrated Urban Water Cycle Management

GonzaloDoing MSc. thesis “Evaluating the impact of climate change on urban scale extreme rainfall events: Coupling of multiple global circulation models with a stochastic rainfall generator”

He is not gonna make it...

Page 58: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

I like the pyswmm name, let’s register

that on PyPI

Back in 2012

https://pypi.python.org/pypi/PySWMM

Page 59: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2016: networking...

Page 60: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2016: networking… and lying

It’s my preciousssss

Page 61: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Back in 2017: networking… and codinghttps://pypi.python.org/pypi/PySWMM

Page 62: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

</intermission>

Page 63: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Sam Hatchet

Open Water Analytics (2015)

Bryant McDonnell

Source: https://github.com/OpenWaterAnalytics/

Page 64: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Sam Hatchet

Open Water Analytics (2015)

Bryant McDonnell

Source: https://github.com/OpenWaterAnalytics/

2018/02/06

Page 65: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Open Water Analytics (2015)

Source: https://github.com/OpenWaterAnalytics/

Why should we care about Open Source?● Let’s move our

community away from a single developer’s vision

● Else, Research Projects Grow and Die

● Combine Industry with Academia and Open Source developers

Page 66: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● Exposing the Data Model

● Observe Simulated Results During Run

SWMM API:

Page 67: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM API: General Framework

Input APISWMM

Computational engine

Output API

ToolKit API

*.out Binary File*.inp

Geometry & data

Python Bindings

Page 68: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● Run Simulation● Link Settings● Control Rules in Python● Set Node Inflows

PySWMM API:

Page 69: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM API: Run a simulation

Page 70: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM API: Adjust Link Settings

Page 71: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Control based on varying conditions

SWMM API: Adjust Link Settings

Query information for every time step

Page 72: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

SWMM API: Build Custom Control Rules

Page 73: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● No API (yet) to construct a network programmatically

● Needs to generate an input file “manually” or using the GUI.

Expanded PySWMM API:

Source: https://www.sciencedirect.com/science/article/pii/S1877705815025941

Page 74: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

● No API (yet) to construct a network programmatically

● Needs to generate an input file “manually” or using the GUI.

Expanded PySWMM API:

Source: https://www.sciencedirect.com/science/article/pii/S1877705815025941

Page 75: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Example input file *.inp

Page 76: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

APIProofofConcept

Page 77: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Why should you care about the API?

● Gives you a window to your model● Optimization packages● New Inflow algorithms● Control Rules in Python● Get more out of your model● Watch simulated results while running

● Something we haven’t thought of yet

Page 78: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Roadmap and future work - Devs

Create a common core for EpaNet and SWMM

C -> C++

Page 79: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Roadmap and future work - Devs

1. Unit tests2. Create Conda Packages3. Continuous Integration4. Official cross platform

supporta. Linuxb. Mac

Page 80: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Roadmap and future work - Academia

Create a pythonic interface to allow so that new models can be created in Python and plugged to the numerical engine.

SWMMComputational

engine

ToolKit API

Python Bindings

Custom Infiltration model

Custom Quality Model

Custom Optimization

Rules

Page 81: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

We are NOT hiring (yet!)But if you…❏ Like C?❏ Like C.I.?❏ Like C++?❏ Like SWIG?❏ Like Python?❏ Like Bindings?❏ Like Hydrology?❏ Like Hydraulics?❏ Like Unit Testing?❏ Like Modelling?❏ Like Open Source?❏ Like Water Quality?

… let’s talk!

Page 82: February 9th Modelling to next level PyCon Colombia EAFIT ... · EPA - SWMM Intermission: networking, lying and coding OWA SWMM API PySWMM API Expanded PySWMM API (Under Construction)

Questions &(hopefully) Answers

@goanpeca

[email protected]

Source: http://www.revistalaocaloca.com/2017/04/el-poporo-quimbaya


Recommended