⚡ Open Source · Apache 2.0

Automated 2D HEC-RAS Hydraulic Modeling - Terrain to Flood Maps

RAS Agent runs the complete HEC-RAS 2D workflow from a pour point - terrain ingestion, watershed delineation, peak flows, mesh build, headless model execution, GIS results export, and HAZUS flood loss estimation - and wraps it in an auditable, file-native study record where automation can advance a model but only a named engineer can accept it. Built at the Illinois State Water Survey to produce Base Level Engineering-quality 2D flood models at watershed scale.

1,600+ tests · CI on every push Spring Creek pilot solved on Illinois Computes HPC Apache 2.0 HEC-RAS 2D · 7.0.1 Linux engine Docker · Linux / Headless Optional SLURM / HPC Python 3.12 Named-human execution gate

Ten stages. One command.

Each stage is independently testable and produces typed result objects. Run the full pipeline or individual stages - with mock mode for testing without live data or a network connection. Validated on real geometry: the Spring Creek (Lower Sangamon, IL) pilot ran a wet HEC-RAS 2D solve (RasUnsteady 7.0.1) on Illinois Computes HPC in June 2026. Stage 02 also produces a HAND terrain-screening depth grid as a fast first-look baseline before the full solve. HEC-RAS is free software from the U.S. Army Corps of Engineers - no license required.

01
🗺️
Terrain Ingestion
Illinois ILHMP 1m LiDAR. Mosaic & reproject to EPSG:5070. Hard-fail if coverage absent - no coarse fallbacks.
02
🌊
Watershed Delineation
USGS StreamStats API — watershed boundary in seconds, no local DEM delineation. Falls back to TauDEM D8 for unsupported areas.
03
📈
Peak Flow Estimation
USGS StreamStats API for peak flows. Fallback to IL regression equations (SIR 2008-5176).
04
〰️
Hydrograph Generation
NRCS dimensionless unit hydrograph (NEH Part 630). Compute Tc via Kirpich method.
05
🏗️
Model Builder
Greenfield 2D mesh via pure-Python Voronoi seeder (Linux-native, no RASMapper GUI). Falls back to GeomMesh.generate_computation_points on Windows. Writes perimeter + computation seeds to .g## for HEC-RAS geometry preprocessing.
06
⚙️
Execution Engine
Vendored RasGeomPreprocess + RasUnsteady 7.0.1 Linux binaries via SQLite job queue. Runs locally, in Docker, or - optionally - on a SLURM cluster (reference deployment: NCSA Illinois Computes). Parallel runs, 4hr timeout, retry logic, validated solve-checking, Courant-adaptive timestep control. Real launches require a named-human execution-promotion decision; mock runs never do.
07
📦
Results Pipeline
Typed dataclasses, depth/WSE/velocity rasters, flood extent GeoPackage, COG GeoTIFFs per return period.
08
🌧️
Precipitation
AORC/MRMS rain-on-grid retrieval. Design storm selection by AEP and duration for Illinois watersheds.
09
🔬
Storm QC
GHCND gauge cross-validation of gridded precipitation. Flags depth-ratio outliers and unclassified storms.
7c
💰
HAZUS Loss Estimation
SPHERE (Niyam IT, open-source HAZUS reimplementation) — now on a DuckDB-based analysis pipeline with the 2026 NSI GeoParquet building schema. NSI building fetch via AOI-polygon query (scales to large basins). Per-structure dollar losses with first-floor-height aware depth-damage. Expected Annual Damage (EAD) via trapezoidal AEP integration.
10
📄
Report
Self-contained HTML run reports + workspace report packaging. Hydrograph plots, basin characteristics, precip QAQC, EAD summary. FEMA-memo ready.

Engineered for the H&H workflow

Built by engineers for engineers. Designed to handle the unglamorous parts of hydraulic modeling - data wrangling, format conversion, and model assembly - to amplify your expertise, not replace it.

Fully Automated
One command runs the entire 10-stage pipeline from coordinates to flood maps. Human-in-the-loop pauses route scientific decisions to the engineer - never silent autonomy on regulatory choices.
python pipeline/orchestrator.py \ --lon -88.578 --lat 40.021 \ --output ./output/test
🔁
Batch Processing
Designed to run many watersheds in parallel with batch.py. Resume on failure - skip completed runs automatically. Outputs a summary CSV for each batch run.
python batch.py \ --watersheds watersheds.csv \ --workers 8 \ --resume
🔏
Auditable Study Records
Every study is a portable folder of JSON-schema'd records: data gaps, numbered work packages, SHA-256-fingerprinted artifacts, findings, reviews, and decisions - rendered to static HTML with no server or database. Agents and scripts can publish candidate or machine-checked results; only a named human can record engineering acceptance, and a decided package is immutable. Changed evidence invalidates prior reviews.
python pipeline/study_cli.py init \ --study-root studies/spring-creek-il \ --study-name "Spring Creek, Illinois" \ --created-by "G. Heistand" python pipeline/study_cli.py validate --study-root ...
🗺️
Web Dashboard + Map Viewer
FastAPI backend with React dashboard. A study workspace lists file-native studies and their engineering reports; a click on the map creates a candidate study and opens a definition-review gate rather than launching a model. MapLibre flood extent viewer with 10-yr / 50-yr / 100-yr toggles and HAND depth overlays.
docker-compose up api # With web dashboard: docker-compose \ --profile dev up
🐳
Docker Ready
Reproducible environment with GDAL, rasterio, and all geospatial dependencies pre-installed. Runs fully headless on Linux — no Windows required for simulation. HEC-RAS Linux install volume-mounted at runtime. Official Dockerfile + docker-compose.yml included.
docker build -t ras-agent . docker run --rm ras-agent \ python pipeline/orchestrator.py \ --lon -88.578 --lat 40.021
📄
HTML Run Reports
Self-contained HTML reports generated for every run - hydrograph plots, basin characteristics table, and flood extent preview. Suitable for attaching to FEMA memos or client deliverables.
☁️
Cloud Storage
Cloudflare R2 integration for results storage. Generates presigned download URLs for sharing COG GeoTIFFs, GeoPackages, and HTML reports without exposing storage credentials.
🔬
HITL / Scientific Review
Human-in-the-loop pauses at configurable stages for expert validation. Engineers review and approve before the pipeline advances - critical for regulatory submissions and peer review.
🧪
Mock Mode & CI
Run the complete pipeline without real terrain data, HEC-RAS binaries, or a live StreamStats connection. 1,600+ tests run in CI on every push with every HTTP call mocked. A separate golden-watershed job runs the mock pipeline end-to-end for seven reference Illinois HUC-10s and checks each pour point against the USGS WBD polygon it claims.
python pipeline/orchestrator.py \ --mock python -m pytest tests/ -v python -m pytest tests/golden -v # 7 reference HUCs
🔔
Webhook Notifications
HMAC-signed webhook payloads on run completion. Email notifications included. Integrate with Slack, Teams, or any CI/CD pipeline to trigger downstream workflows automatically.

What's shipping now

Active development - major capability unlocks in the last development cycle.

🔏
File-Native Study Contract + Execution Gate
Studies, data gaps, work packages, fingerprinted artifacts, reviews, and decisions are now first-class, schema-validated records with a dependency-light CLI shared by humans, scripts, Claude Code, and Codex. Real HEC-RAS and HPC launches fail closed unless bound to an accepted, named-human execution-promotion decision - with pre-launch and provider-result receipts written into the study.
🏅
Golden-Watershed Acceptance Suite
Seven reference Illinois HUC-10s now gate main: Spring Creek (Lower Sangamon), Money Creek, Hickory Creek, the Upper and Lower Cache River, Little Crooked Creek, and the North Fork Vermilion in Ford County. Five are validated against active USGS gauges; two against ISWS regulatory 2D models (one an effective FEMA FIS). Tier 1 runs in mock mode on every PR; Tier 2 will run full-resolution on HPC.
📚
Spring Creek H&H Evidence Package
Static engineering report for the pilot watershed: terrain context, drainage-boundary overlays, FIRM panel and NFHL layers, observed-event hydrographs and annual peaks from USGS 05577500, and a comparison-only USGS PeakFQ / Bulletin 17C reference. Nothing is adopted without a recorded human decision.
🧮
Systematic Calibration Sweeps
systematic_calibration.py composes ras-commander calibration helpers into reviewable Manning's n / SCS Curve Number parameter grid sweeps, scored by hydrograph correlation, NRMSE, and a composite goodness-of-fit ranking.
🛡️
SLURM / HPC Robustness Hardening
Courant-adaptive plan solver controls, a SIGTERM trap with partial-stats postprocessing on cluster preemption, and a stale-run watchdog that catches missed TIMEOUT/CANCELLED states — plus a campaign status DB for statewide batch failure tracking.
🌧️
Rain-on-Grid Pipeline (Stages 8–10)
Extended to a full 10-stage pipeline with AORC/MRMS precipitation retrieval, GHCND gauge cross-validation, and workspace-packaged HTML run reports. Design storm AEP selection and depth-ratio QC flags are first-class outputs.
🏔️
Pilot Channel Terrain-Mod Proposals
pilot_channel.py generates conservative LiDAR terrain-mod proposal packages from TauDEM centerlines - STA/ELEV profiles, cut/fill summaries, reviewer flags, and HTML report. Proposal-only: never edits production terrain. Human engineering signoff required before application.
TauDEM QAQC + Signoff Bundle
Real TauDEM delineation writes a reviewer QAQC bundle by default - qaqc_report.html, diagnostics, SVG maps, and a signoff.json. Production promotion is blocked until human approval is recorded.
💰
HAZUS Flood Loss Estimation (Stage 7c)
SPHERE integration (Niyam IT open-source HAZUS reimplementation) computes per-structure building and content losses for every return period depth raster, now on a DuckDB-based analysis pipeline with the 2026 NSI GeoParquet building schema. Aggregates to Expected Annual Damage (EAD) via trapezoidal AEP integration — the output metric for CNMS portfolio prioritization and risk-informed floodplain management.
🐧
Native Linux Execution (Stage 6)
Stage 6 now uses vendored RasGeomPreprocess + RasUnsteady 7.0.1 Linux binaries directly — handles dos2unix conversion, LD_LIBRARY_PATH, validated solve-checking, retry logic, and SLURM job submission to Illinois Computes. Official Dockerfile and docker-compose.yml ship with the repo.
🚀
One-Command Cloud-to-HPC
A single click (or run-hpc.sh) now drives the whole flow: container Stages 1–5 produce the plan HDF, then hpc_submit rsyncs to Taiga, submits to SLURM over a no-Duo SSH socket, waits, fetches results, and verifies them. Validated end-to-end on real hardware — RasUnsteady 7.0.1 solved on an Illinois Computes node, results fetched and confirmed. The Atlas API auto-routes in-process on a toolchain host or delegates to the container otherwise.
🧪
1,600+ Tests, Two CI Gates
The full suite runs in CI on every push, covering all ten pipeline stages, the study contract and execution gate, HAND screening, systematic calibration sweeps, TauDEM QAQC, mesh QA, pilot-channel proposals, NWIS and PeakFQ evidence adapters, SLURM submission, results parsing, cloud-native export, and API endpoints - all in mock mode. A second golden-smoke job runs the mock pipeline end-to-end for the seven golden watersheds.

Built by the H&H community

Primary Developer
CHAMP Section
Illinois State Water Survey
Prairie Research Institute, UIUC
In Collaboration With
CLB Engineering Corporation
Hydraulic modeling expertise
and workflow validation
Community
RAS Commander
Open source HEC-RAS automation
tooling community
Maintainer
Glenn Heistand, PE, CFM
CHAMP Section, ISWS
github.com/gheistand

What's next

RAS Agent is the regulatory-grade HEC-RAS engine in a family of open tools. Sibling projects handle fast statewide screening and probabilistic risk; FloodStack is the layer that will chain them.

In Production
TRITON Agent
Fast statewide 2D flood screening with TRITON (Oak Ridge National Laboratory's GPU/CPU hydraulics engine): batch preparation, SLURM submission, run tracking, and depth-grid delivery for Illinois HUC-10 watersheds. Extracted from RAS Agent in September 2026 so each tool can evolve independently; cross-engine comparison lives in FloodStack.
Apache 2.0  ·  ISWS CHAMP
Early
Risk Agent
Takes multi-frequency depth grids and produces Expected Annual Damage (EAD) per structure, AEP-vs-depth hazard curves, probability-of-exceedance maps, and reach-level, CNMS-compatible prioritization rankings aligned with FEMA's FFRD methodology. Public repo; schema alignment with FEMA's rqm-data-model is the next step.
Apache 2.0  ·  github.com/gheistand/risk-agent
Phase 0
FloodStack
Open-source orchestration layer chaining TRITON Agent (fast screening) → RAS Agent (regulatory hydraulics) → SPHERE (HAZUS-based consequence modeling) → Risk Agent into a single defined pipeline contract, including the cross-engine depth comparison that no single tool owns.
Apache 2.0  ·  github.com/gheistand/floodstack