Hydra — water distribution network simulation engine.
This crate is the published library for the Hydra workspace. It re-exports the complete user-facing API so that downstream users depend on a single crate with all internal dependency versions pre-pinned and known to be compatible.
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}");
}