To main content

SWIM

Software for static modeling and prediction of surface water and urban flooding based on analysis of topography/terrain.

Contact person

Picture of SWIM applied to an urban area from Oslo.
Example of the application of static modelling with SWIM applied to a city area in Oslo.

Floods resulting from extreme weather, both nationally and internationally, cause significant damage to infrastructure, with large expected insurance payouts. The storm Hans in 2023 served as a reminder that Norway is not immune to the forces of nature. Future challenges with more extreme weather underscore the importance of flood protection and associated predictive simulators for flooding and stormwater, both from intense rainfall and floods.

What is SWIM?

SWIM consists of a collection of algorithms for identifying watershed boundaries and providing a better understanding of how water accumulates and moves through the landscape. This is valuable for various purposes, such as water resource management, flood modeling, and environmental planning.

Our algorithms originate from work on CO2 storage and are based on an assumption of infinitesimal flow. These so-called spill-point analyses were later modified to model flooding in urban areas in collaboration with the startup company Spacemaker (see popular science article in Norwegian); whose main product today is known as Autodesk Forma. Similar approaches are also found in other commercial products. However, our algorithms have some unique functionality, such as simplified infiltration models (both permeable and impermeable surfaces) and the calculation of time series illustrating how water accumulates over time.

Spill-point analyses are highly computationally efficient compared to tools based on numerical simulation. This makes it easy to work interactively and test out various scenarios and measures. 

The software was released as an open-source package on GitHub in December 2024 along with extensive documentation and an accompanying paper. The software is actively in use and being further developed as part of the SUrbArea project.

What about dynamic modelling?

A comprehensive analysis ideally requires a combination of static and dynamic tools that interact. In collaboration with the National Center for Computational Hydroscience and Engineering, Mississippi, we have previously developed a GPU simulator for dynamic modeling of floods and surface water based on shallow-water equations, see, for example, [2,3,4]. Currently, we are in the process of modernizing and re-implementing this simulator. We are also investigating quasi-steady-state models for more rapid evaluation.

Functionality:

  • Static surface models
    • Calculation of catchment areas, waterways, and hierarchical networks of temporary streams.
    • Accumulation areas for water, topological network of ponds, and how they connect and merge together.
    • Permanent water volumes such as rivers, lakes, and seas.
  • Time series
    • Terrain response to precipitation events over time.
    • Routing of water as ponds overflow.
  • Terrain characteristics and infrastructure.
    • Takes into account buildings, obstacles, drainage, and measures.
    • Simplified infiltration model that supports both permeable and impermeable surfaces.

The software is written in the Julia programming language and is designed to rapidly process large terrain sections.

Example

swim-rivers.png
System of lakes and rivers identified in the watershed analysis.

 

swim-catchment-areas.png
Estimated flow intensity over terrain given a specific precipitation scenario.

Download source code

The software is available on GitHub.  Detailed online documentation is also published online.

 

References

  1. O.A. Andersen. Topography-based surface water modeling in Julia, with support for infiltration and temporal developments. Journal of Open Source Software, 10(109), 2025,  7785, https://doi.org/10.21105/joss.07785
  2. AR Brodtkorb, ML Sætra, M Altinakar. Efficient shallow water simulations on GPUs: Implementation, visualization, verification, and validation. Computers & Fluids, 55, 1-12,  2012. DOI: 10.1016/j.compfluid.2011.10.012 
  3. ML Sætra, AR Brodtkorb, KA Lie.  Efficient GPU-implementation of adaptive mesh refinement for the shallow-water equations. Journal of Scientific Computing, 63, 23–48, 2015. DOI: 10.1007/s10915-014-9883-4
  4. ML Sætra. Shallow water simulation on graphics hardware. PhD thesis. University of Oslo, June 2014