tpt-water

Rust

Rust workspace for water distribution network modeling, simulation, optimization, and control — pressure management, flow modeling, pump scheduling, and leakage estimation.

0 stars0 forks0 watchers

Languages

Rust99.8%Dockerfile0.2%
README

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

  1. Mass balance first — every simulation conserves inflow, outflow, storage change, demand, and leakage.
  2. Pressure is a constraint, not just an output — minimum service pressure, maximum pipe pressure, tank levels, and pump/valve limits are tracked explicitly.
  3. Simulation before actuation — real control is optional, explicit, rate-limited, and dry-run capable.
  4. Reusable crates — library-first design.
  5. Solver-agnostic — the optimization layer is trait-based and supports multiple backends.

Crates

CrateResponsibility
tpt-water-coreCore domain types: quantities, units, time, IDs, errors.
tpt-water-assetsWater asset registry, topology, and connectivity.
tpt-water-modelsHydraulic and behavioral models (pipe head loss, pump curves, demand, leakage).
tpt-water-storageTank and reservoir state and behavior.
tpt-water-forecastForecasting abstractions and simple built-in forecasters.
tpt-water-solvePump scheduling, tank optimization, pressure management.
tpt-water-controlControl policies and setpoint generation with safety limiters.
tpt-water-telemetryTelemetry ingestion, normalization, and replay.
tpt-water-simSimulation orchestration and reporting.
tpt-water-cliCommand-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.