Objective:
The objective of this example is to familiarize yourself with water distribution system modeling using epanet-js. You will build a steady-state hydraulic model of a real-world system, analyze its performance under normal conditions, and assess its capacity during a fire event.
General Notes:
- This example uses epanet-js. Ensure you have access and are familiar with its basic interface.
- All modeling work will be performed within the web application.
- To add the basemap for this exercise you need a Professional, Teams, Personal or Education licence.
- Read the getting started guide or watch the video for an introduction to the interface: https://help.epanetjs.com/Getting-started-1a5e18c9f0f680399659f710a37aa452

Part 1: Building the Hydraulic Model
In this first part, you will construct the basic layout of the Wheelwright water distribution network using the provided basemap. You will define the physical characteristics of the pipes and junctions, estimate initial water demands, and simulate the system being supplied only by gravity from the storage tank to establish a baseline.
-
Project Setup:
- Go to the epanet-js app and create a new project.
- Set project units to
GPM
(US Customary) and keep the Headloss Formula as Hazen-Williams
.
-
Load Basemap:
- Load the Wheelwright basemap layer by following these instructions:
-
Select the Layers button on the top right of the epanet-js interface.
-
Press the + Add Custom button.
-
Select Mapbox as the layer type.
-
In the Style URL field, paste the following:
mapbox://styles/iteratinginc/cm97etacs002b01qphjhees73
-
In the Access Token field, paste the following:
pk.eyJ1IjoiaXRlcmF0aW5naW5jIiwiYSI6ImNtOTdmM3ZlcjA3ZTUya3BzcGpiOXdvb2cifQ.ByM6wpkdA-3ViTsoL3e6Jg
-
Click Add Layer
- Once the layer is added, you will need to zoom out, pan, and zoom the map to find the network. It's located in Kentucky, USA; look for the network data appearing as potentially small blue lines/dots in the eastern part of the state.

-
Add the Storage Tank:
- Start by adding the system's storage tank.
- Select the Reservoir tool and place it at the location indicated for the tank on the basemap. You will find the tank location at the end of Peach Street, just west of Circle Street within the main part of town.
- Select the reservoir you just placed. By default, epanet-js sets the head to 32ft above the ground elevation.
- For this initial simulation, we will consider this default head value to represent the maximum water level in the tank.
- Later, if you want to simulate different levels of the tank, you can change the Head using the following equation:
$$
[\text{Base elevation of tank}] + [\text{Current level of water in tank}] = \text{Head}
$$
-
Draw Network and Set Pipe Properties:
- Using the Junction and Pipe drawing tools, trace over the network components shown on the basemap overlay for the main section of town and the pipeline route leading towards the Water Treatment Works (WTW) location. Refer to the reference image below to see the recommended initial extent of the network to build for this exercise. Do not add the source reservoir for the WTW itself in this step.
- Ensure your pipes and junctions connect logically, including connecting the appropriate pipe to the Tank Reservoir you placed in the previous step.
- As you draw each pipe, or immediately after drawing a section: Click on the pipe(s) individually. In the pipe properties panel, manually enter the Diameter as specified on the basemap overlay for that specific pipe. We can leave the default Roughness C-Factor of 130 for each pipe.
- epanet-js automatically calculates pipe lengths and node elevations based on your drawing on the map

-
Calculate and Input Demands (Peak Hour on Average Day):
-
This steady-state simulation will represent the Peak Hour flow on an average day. You need to estimate the water demand at each junction for this condition.
- A reasonable estimate for average daily water usage for a single residential property can vary. For this exercise, we will assume 300 gallons per property per day (gal/prop/day)
- We will convert the daily usage to an average flow rate of approximately 0.0208 gpm per property.
$$
\text{Average Flow} = \frac{300 \, \frac{\text{gal}}{\text{prop} \cdot \text{day}}}{24 \, \frac{\text{hr}}{\text{day}} \times 60 \, \frac{\text{min}}{\text{hr}}}
$$
- Water usage peaks during certain times. To estimate the demand during the busiest hour (Peak Hour), we multiply the average flow by a Peaking Factor. Typical factors range from 2 to 4+. We will use a peaking factor of 3.0:
- This final value 0.625 gal/prop/min represents our estimate for the peak flow on an average day for a single property.
-
Next we will count properties and calculate the demand at each node:
- For each junction in the main town area (excluding the tank reservoir), visually estimate or count the approximate number of properties (houses, buildings) that would likely be supplied by that junction or the pipes connecting immediately to it. Assign properties to their nearest logical junction.
- Calculate the total peak Hour demand for each node by multiplying the number of properties by the peak flow of 0.625 gal/prop/min. Enter this figure into the 'Demand' property for each respective junction node.
-
Run Simulation & Initial Check (Tank Supply Only):
- With the network layout, demands, and tank defined, run the simulation to observe the system's performance under gravity supply only.
- Click the "Simulate" button to perform the steady-state simulation.
- Troubleshoot any errors reported by epanet-js (check for disconnected nodes, missing data, or other issues highlighted in the warnings/errors panel).
- Once the simulation runs successfully, review the calculated results:
- You can click on any network asset (junction, pipe, reservoir) to see its calculated properties (like pressure at nodes, flow in pipes) displayed in the properties panel on the right
- You can also visualize results across the network. Go to the Analysis tab. Use the visualization dropdown menu for nodes and select Pressure to see the junctions color-coded by their pressure values on the map.
- To find the overall minimum and maximum system pressures: Select all elements (CTRL+A or ⌘+A), then view the Summary Table in the properties panel by selecting an attribute.
Part 2: Design a pump
Here, you will add the main water source, representing the treatment plant pump, to the model. Instead of directly calculating headloss, you will iteratively adjust the source's head to achieve a target filling flow rate into the storage tank. This simulates finding an appropriate operating point for the pump. You will then simulate the system with the pump 'on' and 'off'.