tpt-water
RustRust workspace for water distribution network modeling, simulation, optimization, and control — pressure management, flow modeling, pump scheduling, and leakage estimation.
Languages
tpt-water
A Rust Cargo workspace for water distribution system modeling, simulation, optimization, and control.
tpt-water focuses on the practical questions operators and engineers ask:
- Can the network meet demand while maintaining pressure?
- When should pumps run, and how can pump energy be minimized?
- How should tank levels be managed?
- Where are pressure violations likely to occur?
- How much leakage is implied by flow and pressure data?
- How can demand be forecast, and how can telemetry replay test control strategies?
The workspace is split into focused, reusable library crates plus a single CLI
binary (tpt-water). The CLI is only one consumer of the underlying crates; the
crates are designed to be depended on directly.
Core principles
- Mass balance first — every simulation conserves inflow, outflow, storage change, demand, and leakage.
- Pressure is a constraint, not just an output — minimum service pressure, maximum pipe pressure, tank levels, and pump/valve limits are tracked explicitly.
- Simulation before actuation — real control is optional, explicit, rate-limited, and dry-run capable.
- Reusable crates — library-first design.
- Solver-agnostic — the optimization layer is trait-based and supports multiple backends.
Crates
| Crate | Responsibility |
|---|---|
tpt-water-core | Core domain types: quantities, units, time, IDs, errors. |
tpt-water-assets | Water asset registry, topology, and connectivity. |
tpt-water-models | Hydraulic and behavioral models (pipe head loss, pump curves, demand, leakage). |
tpt-water-storage | Tank and reservoir state and behavior. |
tpt-water-forecast | Forecasting abstractions and simple built-in forecasters. |
tpt-water-solve | Pump scheduling, tank optimization, pressure management. |
tpt-water-control | Control policies and setpoint generation with safety limiters. |
tpt-water-telemetry | Telemetry ingestion, normalization, and replay. |
tpt-water-sim | Simulation orchestration and reporting. |
tpt-water-cli | Command-line interface (tpt-water). |
See docs/spec.txt for the full design document.
Status
This workspace is under active development (Milestones 0–2 implemented; later
milestones tracked in todo.md).
License
Dual-licensed under MIT and Apache-2.0. Copyright TPT Solutions.