hydra-sdk 1.0.2

Water distribution network simulator — EPANET-compatible extended-period simulation
Documentation

hydra-sdk

Crates.io License: AGPL v3 Cargo CI

Water distribution network simulator — EPANET-compatible extended-period simulation.

hydra-sdk is the user-facing library crate for Hydra. It re-exports the complete public API of hydra-engine-wds as a single stable dependency, with all internal crate versions pre-pinned.

→ Full documentation

Install

[dependencies]
hydra-sdk = "1"

Quick start

use hydra_sdk::{io, Simulation, NodeQuantity, LinkQuantity};

let bytes = std::fs::read("network.inp").unwrap();
let network = io::parse(&bytes).unwrap();

let mut sim = Simulation::create();
sim.load(network).unwrap();
sim.run().unwrap();

for t in sim.snapshot_times() {
    let head = sim.get_node_result("J1", NodeQuantity::Head, t).unwrap();
    let flow = sim.get_link_result("P1", LinkQuantity::Flow, t).unwrap();
    println!("t={t:.0}s  head={head:.3}  flow={flow:.6}");
}

What Hydra models

  • Extended-period steady-state hydraulics (Global Gradient Algorithm)
  • Pressure-driven and demand-driven demand models
  • Conservative and reactive constituent transport (water quality, age, source tracing)
  • EPANET 2.3 .inp format input; binary .out and plain-text .rpt output

Hydra does not model pressure transients, water-hammer, or multi-phase flow.

License

AGPL v3 — see COMMERCIAL_LICENSE.md for commercial licensing options.