![]() |
OpenSWMM Engine
6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
|
Explicit next-timestep computation for the new engine. More...
#include <algorithm>#include <cmath>Go to the source code of this file.
Classes | |
| class | openswmm::hydraulics::TimestepController |
| Static utility class for explicit timestep computation. More... | |
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::hydraulics |
Explicit next-timestep computation for the new engine.
The TimestepController implements the explicit timestep formula:
Report scheduling runs on the legacy-parity millisecond clock: ctx.elapsed_ms mirrors legacy NewRoutingTime (accumulated as += 1000.0 * dt, routing.c:309) and ctx.next_report_ms mirrors legacy ReportTime (seeded 1000*ReportStep, advanced by 1000*ReportStep per period, swmm5.c:721/1044). A report period is due when elapsed_ms >= next_report_ms (swmm5.c:1019). Periods dated before REPORT_START are skipped by the writer but the grid still advances (output.c:481).
The original refactored design shortened dt so the clock lands exactly on report boundaries (no interpolation). Legacy instead free-steps and interpolates results to the report instant (output.c:650/682). The clamp is retained temporarily and is removed by the A2 reporting-parity work in favor of legacy-identical interpolation.
The main simulation loop uses TimestepController as follows: