Skip to main content

SWMM Module High-Level Dataflow Diagram

High-level dataflow for the SWMM module: components, tech stacks, and Azure storage (Table, Blob, Queue) with read/write roles.


1. Component Summary

ComponentTech stackTrigger / role
swmm-frontend-reactReact, Vite, ArcGIS JS API, MUIBrowser SPA; HTTP to API; optional Esri/Azure Maps
swmm-api-aspnetASP.NET Core, .NET 8, JWT, SwaggerREST API; reads/writes Azure Table + Blob; sends queue message; calls Feature Function HTTP
swmm-worker-functionAzure Functions (C#), .NET 8, Queue triggerQueue swmm-trigger-rivershore; runs SWMM engine in-process; reads/writes Table + Blob
swmm-feature-functionAzure Functions (Python), HTTP triggerInvoked by API (publish/delete layers); reads Table + Blob; writes ArcGIS + Table
swmm5_coreC# (.NET 8) + C++/CLI + native C++Shared libs: GqcStorage1, SwmmModels; SWMM 5 engine DLLs used only by worker

2. Azure Storage

All storage uses one Azure Storage account (connection: CloudStorageConnectionString).

Legend: R = read, W = write, R/W = read and write.

Table Storage

TableUsed byPurpose
ProjectsAPI (R/W), Worker (R/W), Feature Function (R/W)Project metadata, publishing status
ProjectScenariosAPI (R/W), Worker (R/W)Scenario metadata, run status, run results resolution
ProjectFeatureMetaDataAPI (R), Feature Function (R/W)Feature layer URLs and item IDs per project
ProjectSceneMetaDataAPI (R), Feature Function (R/W)Scene layer metadata per project
SystemOutputAPI (R), Worker (W)System-level simulation results
LinkOutputAPI (R), Worker (W)Link simulation results
NodeOutputAPI (R), Worker (W)Node simulation results
SubCatchOutputAPI (R), Worker (W)Subcatchment results
StationWorker (R)Rainfall station data for INP rain file
Sensors, SensorsXRefAPI (R)Sensor definitions and cross-reference
ProjectNodeIndexManually built; future services (R/W, to be implemented)Node index per project for fast node lookup and mapping
ProjectLinkIndexManually built; future services (R/W, to be implemented)Link index per project for fast link lookup and mapping
ProjectLegendDataManually built; future services (R/W, to be implemented)Global min/max (and related legend data) for attributes like depth/flow

Blob Storage

ContainerUsed byPurpose
swmm-inputAPI (W upload INP), Worker (R), Feature Function (R)INP files per project: {projectId}/{InputFileName}
swmm-outputAPI (R), Worker (W)Per-timestep simulation results; path includes project/scenario/run
swmm-slpkFeature Function (R)SLPK packages for scene layer publishing

Queue

QueueUsed byPurpose
swmm-trigger-rivershoreAPI (W), Worker (R)Trigger message: {projectId}_{scenarioId} to start a run

3. Dataflow Diagrams

1. Compute Results and Publish Features Workflow

What reads and writes in what (Blob, Table, Layer Services).

Compute Results and Publish Features Workflow

2. Short end-to-end flow

Create → Run → Publish → View.

Short end-to-end flow

3. End-to-end flow (detailed)

Tables = Azure Table Storage; Blob = Azure Blob Storage. For easier zoom, paste the Mermaid code into Mermaid Live Editor.


4. End-to-End Flows

  1. Project and scenario lifecycle

    • User creates/updates project and scenarios in the frontend; API writes Projects and ProjectScenarios (Table) and uploads INP to swmm-input (Blob).
    • User triggers a run: API sets scenario status (e.g. Queued) in ProjectScenarios and sends a message to swmm-trigger-rivershore (Queue). The worker consumes the message.
  2. Simulation run

    • Worker reads project/scenario from Projects and ProjectScenarios, downloads INP from swmm-input, and optionally reads Station for rainfall. It loads the swmm5_core engine in-process, runs the simulation, writes per-step results to swmm-output (Blob) and summary results to SystemOutput, LinkOutput, NodeOutput, SubCatchOutput (Table), and updates ProjectScenarios (status, duration, error).
  3. Map layer publishing

    • When publish is triggered, the API calls the Feature Function over HTTP (publish-project-layers, publish-scene-layers). The Feature Function reads Projects, ProjectFeatureMetaData, ProjectSceneMetaData, reads INP from swmm-input (and SLPK from swmm-slpk for scene layers), publishes to ArcGIS, then updates Projects (publishing status), ProjectFeatureMetaData (layer URLs), and ProjectSceneMetaData (scene metadata).
  4. Viewing results

    • Frontend requests project/scenario layers from the API; API reads ProjectFeatureMetaData and ProjectSceneMetaData and returns layer URLs. Frontend loads feature/scene layers from ArcGIS (using an Esri token from the API). For time-step results, the frontend calls the API (e.g. NodeResultsAtStep, LinkResultsAtStep); the API resolves the run from ProjectScenarios, then reads from swmm-output (Blob) and/or NodeOutput/LinkOutput (Table) and returns JSON.