Skip to content
Beta.inp@modelscript/epanet 8 diagnostic rules
Parser WASM GLR
Diagnostics 8 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica
Live ExampleMunicipalBoostedWaterNet.inp

EPANET Pressurized Municipal Water Network & Booster Station

Looped water distribution network with an elevated source reservoir, three demand junctions, storage tank, and Hazen-Williams trunk mains.

Playground
Source (26 lines)
1[TITLE]
2Municipal Looped Water Distribution Network
3 
4[JUNCTIONS]
5;ID      Elev    Demand
6J_North  118.0   22.0
7J_South  114.0   28.0
8J_East   108.0   35.0
9 
10[RESERVOIRS]
11;ID      Head
12R_Source 172.0
13 
14[TANKS]
15;ID      Elevation InitLevel MinLevel MaxLevel Diameter
16T_Tower  138.0     4.5       1.0      8.0      16.0
17 
18[PIPES]
19;ID      Node1     Node2     Length  Diameter Roughness
20P_Main1  R_Source  J_North   850.0   350.0    120.0
21P_Main2  R_Source  J_South   920.0   300.0    120.0
22P_Loop1  J_North   J_East    640.0   250.0    115.0
23P_Loop2  J_South   J_East    580.0   250.0    115.0
24P_Tank   J_North   T_Tower   320.0   250.0    120.0
25 
26[END]
EPANET Pressurized Water Network Schematic
P_Main1 (350mm) P_Main2 (300mm) P_Tank P_Loop1 P_Loop2 «reservoir» R_Source Reservoir «fixed grade» Head = 172.0 m «junction» Junction J_North «hydraulics» Elev = 118.0 m Head = 162.0 m «junction» Junction J_South «hydraulics» Elev = 114.0 m Head = 166.9 m «tank» T_Tower Storage «level» Elev = 138.0 m (+4.5 m) «junction» Junction J_East «hydraulics» Demand = 35.0 L/s Head = 162.8 m
Drag to pan · Click % to reset

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 ​

ExtensionFormatDescription
.inpEPANET Input FileIndustry-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:∑k∈in(i)Qk−∑k∈out(i)Qk=Di
    • Conservation of Energy across Pipe Loops:hi−hj=hL,ij=rQij|Qij|α−1
  • 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 (hp=h0−aQb).
  • Tanks & Reservoirs: Dynamic elevated storage tanks with hydrostatic pressure differential equations:Atankdhdt=∑Qin−∑Qout
  • 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's DAEBuilder SoA linear memory arena.
  • Projects EPANET networks into standard Modelica.Fluid pipes, reservoirs, and centrifugal pumps for joint thermo-fluid studies.

Static Analysis & Pre-Flight Linter Rules ​

8 rules7 error1 warning Run with msx epanet lint

CodeRuleSeverityMessage
M8101isolated-hydraulic-nodeerrorHydraulic node '<nodeId>' is isolated with no connecting pipes or pumps.
M8102negative-pressure-riskwarningJunction '<nodeId>' elevation (<value>m) exceeds maximum network source head (<value>m), risking cavitation and dry-out.
M8103non-monotonic-pump-curveerrorPump head curve '<curveId>' violates decreasing monotonicity: head increases from <value> to <value> between flow <value> and <value>.
M8104zero-length-pipeerrorPipe link '<pipeId>' has non-positive physical length (<value>m).
M8105zero-diameter-pipeerrorPipe link '<pipeId>' has non-positive internal diameter (<value>mm).
M8106duplicate-node-iderrorDuplicate node identifier '<nodeId>' detected in water network topology.
M8107duplicate-link-iderrorDuplicate link identifier '<linkId>' detected in water network topology.
M8108unreferenced-node-in-linkerrorLink '<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

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy