create_network
Build a hydraulic model from scratch by supplying junctions, reservoirs, tanks, and pipes; validates the network and creates a session for simulation and editing.
Instructions
Build a new hydraulic model from scratch — no file needed. Supply junctions, reservoirs (e.g. a river intake) and optional tanks with elevations, plus pipes with lengths and diameters; optional x/y coordinates per node are written into a [COORDINATES] section so the model has real geometry. The spec is validated (unique ids, real pipe endpoints, realistic bounds) and the generated INP is re-opened through the EPANET engine: it must parse with exactly the requested node/link counts. Solvability is reported (solves: true/false) but not enforced, so a skeleton network can be created and filled in later. Creates a normal session: run_simulation, set_* edits, optimize_network and save_network all work on it immediately. This is the first step of the GIS workflow; for an auto-layout from real streets use generate_network_from_bbox (Phase 4) instead — see mcp_gis_roadmap.md.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipes | Yes | Pipes: id, two existing node ids, length, diameter (mm for SI, inches for US), optional roughness/minor-loss/status. | |
| tanks | No | Optional tanks: id, bottom elevation, water levels above it, diameter, optional min volume and x/y. | |
| title | No | Model title; defaults to 'Generated network'. | |
| units | No | Flow units for the model; defaults to LPS. US units (GPM/CFS/MGD/IMGD/AFD) use feet/inches and psi; SI units use metres/mm. | |
| headloss | No | Headloss formula; defaults to H-W (Hazen-Williams). Affects the default pipe roughness: the default pipe material is HDPE, so 130 (H-W/C-M) or 0.25 mm (D-W). | |
| junctions | Yes | Junctions: id, ground elevation (m or ft — optional when sampled from IFSAR via x/y), optional base demand (flow units) and projected x/y coordinates. | |
| reservoirs | Yes | Reservoirs (e.g. a river intake): id, fixed head (m or ft), optional x/y coordinates. | |
| elevationSource | No | Ground-elevation source. Defaults to the bundled IFSAR 10 m DEM: any junction without an explicit elevation is sampled from it using the junction's x/y coordinates, so no elevation guessing is the default. Set type ifsar-10m with coordinates wgs84 (default) or { utmZone }. |