Water Hammer in the Fire Water Network¶
In this tutorial you will put the fire water network of Fire Water Network in the Plant through its transients. A fire pump that loses its power, a deluge valve that shuts, and a fire that starts while the main pump is still waiting for its start delay all move the water in a few seconds. The pressure waves that follow can burst a pipe or pull the pressure down to the vapour pressure. The Water Hammer tab solves these cases by the method of characteristics on the same network, with the pumps in four quadrants, the check valves and the vapour cavities. It then checks every pipe against its allowable pressure.
What you will learn
- How the tool turns the network into a transient model: wave speeds from the pipe walls, one time step for the whole network, the outlets as orifices
- Which standard cases the tool generates, and how to write your own as a list of actions
- How to read the envelope of every pipe, the checks, the events and the pressure histories
- Why the risk in this network is a pressure below the atmosphere, and how a standby pump changes it
Prerequisites
- Completed Fire Water Network in the Plant
- DWSIM 10.3.0 or later
- The Pipe Network and its Fire Protection tool are part of the Patreon edition (Premium+).
Process Overview¶
The network is the one of tutorials 4 and 5. The jockey JP-01 holds the ring at rest, the main pump BI-01A (electric, 3000 L/min at 76 m) starts at 7 bar g after 10 s, and the standby BI-01B (diesel, the same curve) starts at 6.3 bar g after 20 s. In the fire on TQ-01, the open outlets are the spray rings AN-01 and AN-02, the foam chamber CF-01 and the foam line LS-01. The spray ring and the foam chamber of TQ-01 sit 12 m above grade, at the top of their risers.
The transient model takes each pipe of the network as it is: its length from the route, its elevation change, its diameter and its friction. It adds what a transient needs:
| Item | Value | Where it comes from |
|---|---|---|
| Wave speed | 1227 to 1391 m/s | the wall of each pipe: steel, standard wall for the size, anchored throughout |
| Allowable pressure | 16 bar g (PN 16) | the pipe editor, Water Hammer group |
| Pump inertia | 0.891 kg m² for BI-01A and BI-01B | estimated from the power and the speed, unless you enter it |
| Run-up time | 3 s electric, 8 s diesel | the pump editor, Water Hammer group |
| Vapour pressure | 0.03 bar abs (-0.98 bar g) | from the water temperature |
| Time step | 3.06 ms over 161 sections | fitted so that every pipe holds a whole number of sections |
Step-by-Step in the Classic UI¶
1. The allowable pressure of the pipes¶
Open the pre-built flowsheet of tutorial 5 (fire_water_plant.dwxmz) or your own. Every pipe editor has a Water Hammer group with the wall thickness, the wall modulus, the anchoring, the wave speed and the allowable pressure. Leave the wall data at zero, so the tool takes the standard wall and the modulus of steel, and type 16 bar in Allowable Pressure for every pipe. The editor shows the wave speed it calculates from the wall.
The pump editors have their own Water Hammer group: the inertia of the pump and its driver, the rated speed, the check valve at the discharge and the run-up time. If you have the inertia from the pump and motor data sheets, enter it, because it decides how fast a pump runs down after a trip.
2. Generate the standard cases¶
Open Tools > Fire Protection > Water Hammer and click Generate Cases. The tool writes four cases from the most unfavourable hydrant scenario of the zone, which has two hydrants open:
| Case | What happens |
|---|---|
| TP: power failure | every running electric pump (BI-01A and JP-01) loses its power at 1 s |
| TP: trip of BI-01A | BI-01A stops alone, and the jockey keeps running |
| TP: outlets close | the open outlets close together in 2 s, as when the hoses are shut |
| TP: fire starts | the outlets open in 2 s with the fire pumps stopped, and BI-01A starts after its start delay |
3. Write the cases of the fire on TQ-01¶
The generated cases start from the hydrants, where the pump discharge carries only 400 L/min. The water moves fastest in the fire on TQ-01, so the cases that matter for the design start from there. Click Add Case for each of the cases below, choose TP: fire on TQ-01 in Starts from the scenario, and type the actions, one per line, as time; action; tag; and, for outlets and valves, the time to close or open:
| Case | Duration (s) | Actions |
|---|---|---|
| TQ-01: power failure during the fire | 30 | 1; trip; BI-01A and 1; trip; JP-01 |
| TQ-01: cooling ring shut in 1 s | 20 | 1; close outlet; AN-01; 1 |
| TQ-01: the fire starts | 40 | 1; open outlet; AN-01; 2 (and the same for CF-01, LS-01 and AN-02), then 11; start; BI-01A |
| TQ-01: power failure, the diesel pump takes over | 45 | 1; trip; BI-01A, 1; trip; JP-01 and 21.5; start; BI-01B |
In the case where the fire starts, also type the four outlets in Outlets shut at the start and BI-01A, BI-01B in Pumps stopped at the start, so the case starts from the network at rest.

The last case adds what happens next in a real power failure. BI-01B is a diesel pump, so it starts when the ring falls below 6.3 bar g, which happens within half a second of the failure, and then it waits its 20 s start delay.
Outlets discharge as emitters is on in every case. In a code scenario, each outlet draws its required flow, but in a transient each outlet is an orifice with its K factor, so its flow follows the pressure at its valve.
4. Run all the cases¶
Click Run All Cases. Each case takes about one second. With no case selected, the results show one row per case:

| Case | Highest (bar g) | Lowest (bar g) | Where the lowest is |
|---|---|---|---|
| TP: power failure | 9.28 | -0.59 | the riser of the foam chamber CF-01 |
| TP: trip of BI-01A | 9.28 | -0.59 | the riser of CF-01 |
| TP: outlets close | 10.24 | 0.57 | the pump suction |
| TP: fire starts | 10.17 | -0.98 | the riser of CF-01 |
| TQ-01: power failure during the fire | 7.59 | -0.64 | the riser of CF-01 |
| TQ-01: cooling ring shut in 1 s | 9.89 | 0.51 | the pump suction |
| TQ-01: the fire starts | 10.17 | -0.98 | the riser of the spray ring AN-02 |
| TQ-01: power failure, the diesel pump takes over | 7.62 | -0.64 | the riser of CF-01 |
Every check is met. The highest pressure of any case is 10.24 bar g. It occurs when the hoses close and the ring rises to about the jockey's shut-off pressure, and it stays far below PN 16. The velocities in this network are low, so a closure cannot raise much of a surge. The risk is in the other direction. When the pumps stop with the outlets open, the risers to the outlets 12 m up fall below the atmosphere.
5. Read one case¶
Select TQ-01: power failure, the diesel pump takes over. The Summary tab gives the highest and the lowest pressure, the time step, the actions and the warnings. Here the warnings say that the inertia of the pumps is an estimate, and that the jockey has a specific speed of 1. Outside its own curve, the jockey follows the four-quadrant data of a radial pump of specific speed 25, which is the only set in the open literature. The jockey moves 18 L/min, so this matters little.

The Pipes tab gives the envelope of every pipe: its wave speed, its number of sections, and its initial, highest and lowest pressure, against the allowable pressure.

The Checks tab compares every pipe with its allowable pressure, and it reports the lowest pressure below the atmosphere, any vapour cavity larger than 0.1 L, and any pump that turns backwards.

The Events tab lists what happened and when: the pumps losing their drivers, the check valves, the cavities forming and collapsing. The Histories tab has the pressure at every node and the speed and flow of every pump and outlet, and Save Histories writes them as a CSV file. This is the pressure at the pump discharge and at the two outlets on TQ-01:

The pumps lose most of their speed within 3 s, and the ring falls to the head of the reserve, 0.6 bar g at the pump discharge. At 4.2 s the spray ring AN-01 and the foam chamber CF-01 fall below the atmosphere and stop discharging. BI-01B starts at 21.5 s and runs up over its 8 s, so the two outlets stay dry until 23.7 s. AN-01 is back above 5 bar g at 29.2 s, and BI-01B ends at 3426 L/min.
The tank on fire goes about 19 s without cooling and without foam. If that is too long for your risk assessment, the remedy is a shorter start delay or a standby pump that runs before the main pump is lost. A device that stores water (see the exercises) cannot hold up an outlet that keeps discharging.
6. A deluge valve that shuts¶
The case TQ-01: cooling ring shut in 1 s shows the classic surge. When AN-01 shuts, the 1529 L/min that went up its riser stops in 1 s:

The pressure at AN-01 rises from 5.71 to 9.89 bar g as the valve closes, and then it settles at 7.49 bar g, so the surge is 2.4 bar above the new steady pressure. At the pump discharge, the pressure rises only to 8.73 bar g, because the pump moves back up its curve. The short riser keeps ringing for a few seconds, because the model uses the steady friction of the pipe and a real pipe damps these waves faster.
7. The report¶
Go back to Verification and Report and write the calculation report. Its Water hammer section lists every case that has been run, with its actions, its envelope, its checks and its first events. The results of the runs aren't saved with the file, so run the cases again after you open it.
Model Notes¶
- Below the atmosphere the model keeps the water: when the ring falls to the head of the reserve, the risers 12 m up go to between -0.6 and -1.0 bar g. A real riser drains and takes air through the open nozzles, and the next start then has to fill it. The model holds the water column and lets a vapour cavity form at the vapour pressure, so read these minima as a sign that the riser empties. Don't use them as pressures to design for.
- The check valve of BI-01A hovers: after the power failure, the check valve of BI-01A shuts at 5.2 s and then opens and shuts about 40 times, while the pump runs down near zero flow. The model doesn't damp the disc of the valve, so read these events as a disc that hovers near its seat.
- The pump inertia is an estimate: if you enter the inertia of the pump and its driver, the run-down follows the real machines. A larger inertia keeps the pump turning longer, so the ring falls more slowly.
Results and Validation¶
Expected results
- Eight cases, all with every check met; time step 3.06 ms over 161 sections.
- The highest pressure of any case is 10.24 bar g, when the hoses close and the ring rises to the jockey's shut-off pressure, against PN 16.
- The lowest is the vapour pressure (-0.98 bar g) in the risers when the fire starts with the pumps stopped, with a cavity under 0.01 L.
- When the power fails during the fire on TQ-01, AN-01 and CF-01 stop discharging at 4.2 s; BI-01B brings AN-01 back above 5 bar g at 29.2 s.
- When AN-01 shuts in 1 s, its riser peaks at 9.89 bar g, 2.4 bar above the pressure it settles at.
Automating This Tutorial¶
Files in this repository
- Python script:
examples/pipe-networks/06_fire_water_hammer.py - Pre-built flowsheet:
examples/saved/fire_water_hammer.dwxmz(the network on the plant with its eight water hammer cases; run them after you open it)
The script runs the script of tutorial 5 without its drawings, sets PN 16 on every pipe, generates the standard cases, adds the cases of the fire on TQ-01 and runs them all. It writes the histories of each case as a CSV file in fire_water_hammer and the calculation report as fire_water_report.html, both next to itself. It needs DWSIM_PATRON_KEY when DWSIM is not activated on the machine.
import os
import runpy
HERE = os.path.dirname(os.path.abspath(__file__))
# the network on the plant of tutorial PN05 (positions, routes, verified scenarios), without its drawings
g = runpy.run_path(os.path.join(HERE, "05_fire_water_plant.py"))
fs, net = g["fs"], g["net"]
from DWSIM.UnitOperations.PipeNetwork.Blocks import WaterPipe # noqa: E402
from DWSIM.UnitOperations.PipeNetwork.Hammer import ( # noqa: E402
HammerAction, HammerActionKind, HammerChecks)
fp = net.Object.FireProtection
fire = next(s for s in fp.Scenarios if s.Kind == "RiskFire" and "TQ-01" in s.Name)
# the piping is PN 16: every pipe is checked against 16 bar g; the wave speed comes from the wall
# (steel, ASME B36.10 STD thickness for the nominal size, anchored throughout), unless it is given
for o in net.Object.NetworkObjects.Values:
block = o.__implementation__ if hasattr(o, "__implementation__") else o
if isinstance(block, WaterPipe):
block.RatedPressurePa = 16e5
def action(kind, target, time_s, duration_s=0.0):
a = HammerAction()
a.Kind, a.Target, a.TimeS, a.DurationS = kind, target, time_s, duration_s
return a
# --- the standard cases: power failure, trip of BI-01A, the hydrants closing, the fire starting -----
made = net.GenerateHammerCases()
print(f"{made.Count} cases generated from the most unfavourable hydrants")
# --- three cases by hand from the fire on TQ-01, where the water moves fastest ----------------------
c = net.AddHammerCase("TQ-01: power failure during the fire")
c.InitialScenario, c.DurationS = fire.Name, 30.0
c.Description = "BI-01A and JP-01 lose their power 1 s into the fire on TQ-01."
c.Actions.Add(action(HammerActionKind.PumpTrip, "BI-01A", 1.0))
c.Actions.Add(action(HammerActionKind.PumpTrip, "JP-01", 1.0))
c = net.AddHammerCase("TQ-01: cooling ring shut in 1 s")
c.InitialScenario, c.DurationS = fire.Name, 20.0
c.Description = "The deluge valve of the spray ring AN-01 shuts in 1 s while the pumps keep running."
c.Actions.Add(action(HammerActionKind.CloseOutlet, "AN-01", 1.0, 1.0))
c = net.AddHammerCase("TQ-01: the fire starts")
c.InitialScenario, c.DurationS = fire.Name, 40.0
c.Description = "The outlets of the fire on TQ-01 open in 2 s with the fire pumps stopped; BI-01A starts after its delay."
for tag in fire.OpenOutlets:
c.ShutAtStart.Add(tag)
c.Actions.Add(action(HammerActionKind.OpenOutlet, tag, 1.0, 2.0))
c.PumpsOffAtStart.Add("BI-01A")
c.PumpsOffAtStart.Add("BI-01B")
c.Actions.Add(action(HammerActionKind.PumpStart, "BI-01A", 11.0))
# --- run every case ------------------------------------------------------------------------------
out = os.path.join(HERE, "fire_water_hammer")
os.makedirs(out, exist_ok=True)
def save_histories(r, path):
with open(path, "w", encoding="utf-8") as f:
f.write("t (s);" + ";".join(f"{s.Name} {s.Quantity} ({s.Unit})" for s in r.Series) + "\n")
for i, t in enumerate(r.Times):
f.write(f"{t:.4f};" + ";".join(f"{s.Values[i]:.6g}" if i < s.Values.Count else "" for s in r.Series) + "\n")
def run(name):
r = net.RunHammerCase(name)
if r.Error:
print(f" {name}: {r.Error}")
return r
checks = HammerChecks.Evaluate(r)
failed = [k for k in checks if not k.Pass]
print(f" {name:42s} {r.MaxPressure / 1e5:6.2f} bar g at {r.MaxAt:10s} {r.MinPressure / 1e5:6.2f} bar g at {r.MinAt:10s}"
f" {'met' if not failed else str(len(failed)) + ' not met'}")
for k in failed:
print(f" {k.Item}: {k.Message}")
safe = "".join(ch if ch.isalnum() or ch == "-" else "-" for ch in name).strip("-")
save_histories(r, os.path.join(out, safe + ".csv"))
return r
print(" case highest lowest checks")
results = {hc.Name: run(hc.Name) for hc in list(fp.Hammer.Cases)}
first = results["TQ-01: power failure during the fire"]
print(f"time step {first.TimeStep * 1000:.2f} ms over {first.Sections} sections")
events = list(first.Events)
for e in [e for e in events if "check valve" not in e][:6]:
print(f" {e}")
print(f" and {sum('check valve' in e for e in events)} openings and closings of the check valves")
# --- the power failure again, with the diesel pump taking over -------------------------------------
# BI-01B starts when the ring falls below 6.3 bar g, which happens within half a second of the power
# failure, and then waits its 20 s start delay
c = net.AddHammerCase("TQ-01: power failure, the diesel pump takes over")
c.InitialScenario, c.DurationS = fire.Name, 45.0
c.Description = "BI-01A and JP-01 lose their power 1 s into the fire on TQ-01; BI-01B starts 20 s later."
c.Actions.Add(action(HammerActionKind.PumpTrip, "BI-01A", 1.0))
c.Actions.Add(action(HammerActionKind.PumpTrip, "JP-01", 1.0))
c.Actions.Add(action(HammerActionKind.PumpStart, "BI-01B", 21.5))
diesel = run(c.Name)
ring = diesel.Find("N-AN-01", "Pressure")
print(f"AN-01 before the failure {ring.Values[0] / 1e5:.2f} bar g, lowest {min(ring.Values) / 1e5:.2f} bar g, "
f"at the end {ring.Values[ring.Values.Count - 1] / 1e5:.2f} bar g")
# the calculation report of tutorial PN04, now with the water hammer section
net.SaveFireMemorial(os.path.join(HERE, "fire_water_report.html"))
print(f"histories written to {out}")
Output may vary
Results depend on the LLM's reasoning quality and tool-use accuracy. Always verify the simulation matches your intent before relying on the numbers.
In the DWSIM Assistant, open the flowsheet fire_water_hammer.dwxmz and
use the Water Hammer tab of the Fire Protection tool of its Pipe Network:
- Run all the water hammer cases and list each one with its highest
and lowest pressure, where they occur, and whether the checks are met
- For the case where the power fails and the diesel pump takes over,
say how long the spray ring AN-01 stays without water
- Compare the highest pressure of every pipe with its allowable
pressure and name the pipe with the smallest margin
Exercises
- Add an air vessel (Add Device, kind Air vessel) at N-PO, of 2 m³ with 1 m³ of gas and a 150 mm connection, and run TQ-01: power failure during the fire again. How long does it hold the risers above the atmosphere, and why does it run out of water? What happens on the pump suction?
- Change the closing time of AN-01 to 0.2 s. How high does its riser go now, and how does that compare with Joukowsky's ρaΔV for the velocity in its branch?
- Enter an inertia of 3 kg m² for BI-01A and run TQ-01: power failure during the fire again. When does its check valve shut now?
- Shorten the start delay of BI-01B to 10 s (start at 11.5 s in the case). How long are AN-01 and CF-01 without water now?
Further Reading¶
- E. B. Wylie and V. L. Streeter, Fluid Transients in Systems, Prentice Hall, 1993
- A. R. D. Thorley, Fluid Transients in Pipeline Systems, 2nd ed., Professional Engineering Publishing, 2004
- NFPA 20, Standard for the Installation of Stationary Pumps for Fire Protection
- DWSIM User Guide: the Pipe Network unit operation (water hammer)
Next Steps¶
You now know how to generate and write water hammer cases for a fire water network, run them and read their envelopes, checks and histories. This is the last tutorial of the pipe network set. Go back to the Pipe Networks overview, or apply the same steps to a fire water network of your own.