EPANET Water Distribution Networks (.inp)
@modelscript/epanet (languages/epanet) provides native parsing, hydraulic simulation, DAE lowering, and formal verification for US EPA EPANET pressurized drinking water distribution networks and municipal water infrastructure.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.inp | EPANET Input File | Industry-standard network topology, pipes, pumps, valves, and water quality decks |
Key Capabilities
1. Todini Global Gradient Method (GGM) Hydraulic Solver
- Implements the Todini Global Gradient Algorithm (
todini-ggm.ts) for quadratic/nonlinear pipe network equilibrium:- Conservation of Mass at Junctions:
- Conservation of Energy across Pipe Loops:
- Conservation of Mass at Junctions:
- Supports Hazen-Williams, Darcy-Weisbach, and Chezy-Manning head loss friction models.
2. Multi-Component Hydraulic Elements
- Pumps: Head gain curves modeled via 3-point polynomial and power-law relationships (
). - Tanks & Reservoirs: Dynamic elevated storage tanks with hydrostatic pressure differential equations:
- Control Valves: Pressure Reducing Valves (PRV), Pressure Sustaining Valves (PSV), and Flow Control Valves (FCV).
3. Direct DAE Lowering & Modelica Projection
- Compiles the entire municipal pipe and tank network into
@modelscript/runtime'sDAEBuilderSoA linear memory arena. - Projects EPANET networks into standard
Modelica.Fluidpipes, reservoirs, and centrifugal pumps for joint thermo-fluid studies.
Static Analysis & Pre-Flight Linter Rules
8 rules7 error1 warning Run with msx epanet lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M8101 | isolated-hydraulic-node | error | Hydraulic node '<nodeId>' is isolated with no connecting pipes or pumps. |
M8102 | negative-pressure-risk | warning | Junction '<nodeId>' elevation (<value>m) exceeds maximum network source head (<value>m), risking cavitation and dry-out. |
M8103 | non-monotonic-pump-curve | error | Pump head curve '<curveId>' violates decreasing monotonicity: head increases from <value> to <value> between flow <value> and <value>. |
M8104 | zero-length-pipe | error | Pipe link '<pipeId>' has non-positive physical length (<value>m). |
M8105 | zero-diameter-pipe | error | Pipe link '<pipeId>' has non-positive internal diameter (<value>mm). |
M8106 | duplicate-node-id | error | Duplicate node identifier '<nodeId>' detected in water network topology. |
M8107 | duplicate-link-id | error | Duplicate link identifier '<linkId>' detected in water network topology. |
M8108 | unreferenced-node-in-link | error | Link '<linkId>' references undefined endpoint node '<nodeId>'. |
Generated from languages/epanet/src/lints/rules.ts. All languages →
CLI Usage
bash
# Lint an EPANET municipal water network
msx epanet lint MunicipalWaterNetwork.inp
# Solve steady-state network hydraulics (Todini GGM) and print pressures
msx epanet solve MunicipalWaterNetwork.inp
# Lower network dynamics into ModelScript linear DAE arena
msx epanet to-dae MunicipalWaterNetwork.inp --out=network.dae.json
# Project into standard Modelica.Fluid components
msx epanet to-modelica MunicipalWaterNetwork.inp -o MunicipalPipes.mo
