Skip to content

Pr 308 restructured#317

Open
maartenvanormondt wants to merge 5 commits into
mainfrom
pr-308-restructured
Open

Pr 308 restructured#317
maartenvanormondt wants to merge 5 commits into
mainfrom
pr-308-restructured

Conversation

@maartenvanormondt

Copy link
Copy Markdown
Contributor

This pull request introduces support for handling buildings within the SFINCS model. The changes add new input options for specifying building files and integrate logic to set up and update building-related structures and parameters during the simulation lifecycle.

Building support integration:

  • Added new module sfincs_buildings.f90 to the project and build system, and included it in the source list (sfincs_lib.vfproj, Makefile.am). [1] [2]
  • Extended the sfincs_data module to include new variables for building support: has_buildings, bldfile, and bprfile.
  • Updated input reading logic in sfincs_input.f90 to read new parameters bldfile and bprfile, and set has_buildings accordingly.

Simulation lifecycle integration:

  • Modified sfincs_lib.f90 to use the new sfincs_buildings module and call setup_buildings() during initialization if buildings are present. [1] [2]
  • Updated the simulation update loop to call update_buildings() each timestep to handle rainfall accumulation and redistribution for buildings.

Introduce a new sfincs_buildings module to model building drainage: collects rainfall on building footprints, creates thin dams along edges, optionally stores detention volume, and distributes runoff to perimeter or gutter outlet cells. Added building data and input options (bldfile, bprfile) to sfincs_data and sfincs_input, updated build scripts (Makefile.am and vfproj) to include the new source, and integrated setup and per-timestep update calls (setup_buildings, update_buildings) into sfincs_lib. The module provides routines for reading building and property files, identifying interior/perimeter/gutter cells, creating thin dams via quadtree intersections, accumulating rainfall, and redistributing water each timestep.
Replace direct write(*) calls in source/src/sfincs_buildings.f90 with calls to write_log by adding "use sfincs_log" and routing informational, warning and error messages through the logging API. Dynamic messages are formatted into a local log string (logstr) before being passed to write_log. This centralizes output handling for the buildings module and preserves existing message content/severity while decoupling from direct stdout writes.
@maartenvanormondt

Copy link
Copy Markdown
Contributor Author

I tested compilation (no issues with Visual Studio and ifx) and running of IMDC's test model (results seemed physically realistic and identical to animation they provided). These updates should not break anything in any of the tests. I tried to keep the IMDCs building code as separate as possible. I suggest we start doing this with some other features as well.

@Leynse Leynse mentioned this pull request Apr 14, 2026
Leynse added 3 commits April 15, 2026 11:42
- Both zs and dh are already real*8; the intermediate cast was discarding 7 digits.
- Added documentation
- To discuss, is meters or m3 more useful?
@Leynse Leynse added this to the 2026.02 release milestone May 6, 2026
@Leynse

Leynse commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Please send example model for testbed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants