Log-Scaled Hilbert Curve β†’ SWMM5 Network Generator

Follows the traversal order of a Hilbert curve with step length = scale Γ— [ln(k+2) βˆ’ ln(k+1)] and exports the result as a real SWMM5 conduit chain β€” built to stress-test the dynamic wave solver across an extreme conduit-length ratio.

4^n cells β†’ 4^nβˆ’1 junctions + 1 outfall, 4^nβˆ’1 conduits. Order 6 = 4,095 conduits.
Multiplies the raw log-step ln(k+2)βˆ’ln(k+1).
Floor to avoid a literal zero-length conduit as k grows.
Flips which end of the single flow path carries the long vs. tiny conduits.
Triangular pulse at the head junction (peaks at 15 min) so the solver has something to route.
Used only for the on-screen Courant estimate below β€” not fed to SWMM5.
LENGTHENING_STEP (s)
INERTIAL_DAMPING
SURCHARGE_METHOD
fine (Ξ”tC β‰₯ 5 s) marginal (0.5–5 s) critical (Ξ”tC < 0.5 s min step)
Celerity-only screening index, not the SWMM routing timestep. Ξ”tC = 0.75 Γ— L / c with your assumed c. Hover any segment for its conduit ID, length, and Ξ”tC; the .rpt is the truth.
Benchmark β€” SWMM .rpt reader iRun the exported .inp files in SWMM 5.2+, then drop the .rpt reports here. Parses continuity error, timestep stats, non-convergence, instability indexes, outfall peaks, and warnings, side by side. Green = best, red = worst.
Drop .rpt reports, manifests (.json), or .inp files β€” whole folders work β€” or
Adaptive loop β€” in-browser SWMM iCloses propose β†’ run β†’ score β†’ propose without leaving the page: a genuine EPA SWMM engine (WebAssembly, build 5.2.2) runs each probe and a bisection strategy narrows the bracket. Assumes the metric responds monotonically to the knob; the two endpoint probes test that assumption before any bisecting. Every probe records its experiment ID, input and report sha256, and engine build.
Engine: not loaded
Endpoints run first; bisection only proceeds if lo fails and hi passes.
The WASM engine is EPA SWMM 5.2.2; the verification corpus pins 5.2.4. Stable configurations reproduce exactly across builds, chaotic ones can differ (order-4 len0 measured 4.81% continuity on 5.2.2 vs 3.30% on 5.2.4) β€” the engine build is recorded per probe and shown in the log for exactly this reason.
Why this stresses SWMM5 (and what it actually is)

Precision about the geometry: the app takes the traversal order of a Hilbert curve, then assigns each step a different physical length. Once the lengths vary, the drawn path is no longer a true Hilbert curve β€” in the length-proportional layout it can even cross itself (verified: 2 crossings at order 4 defaults, 58 at order 5). The SWMM topology doesn't care: crossing lines in [COORDINATES] connect nothing unless they share a node, and this network remains a clean serial chain, J0 through the outfall. The "True Hilbert grid" mode draws the classic non-crossing curve on the uniform grid instead, exploiting the fact that a SWMM conduit's Length attribute is independent of its map distance β€” every real model with schematic coordinates works the same way.

The network is one continuous serial flow path, not a branching collection system. What it gives you, in a single connected model, is a conduit-length ratio spanning two to three orders of magnitude. That geometry exercises SWMM5's VARIABLE_STEP Courant adaptation, LENGTHENING_STEP (settable in the controls; export at 0 and again at 1 s for an A/B pair), INERTIAL_DAMPING, and the very-short-conduit handling in the dynamic wave solver β€” things a normal hand-built test network rarely covers in one file. The color bands use Ξ”tC = 0.75 Γ— L / c with your assumed celerity, mirroring the VARIABLE_STEP safety factor, but they are screening estimates: the .rpt file is the truth.