- 2072 Asoj · 4 marks
Algorithm for water hammer using MOC
Short answer
Read data, set grid with dx=L/N and dt=dx/a, and compute constants Bp and Rp. Initialize steady Q and H including friction. At each time step compute interior K1, K2, Q_P, H_P; apply reservoir C- and valve C+ with valve law; update and store until t<T.
Write an algorithm for simulation of the water hammer process using the method of characteristics.
Problem: a reservoir at the upstream end, a pipe of length with a valve at the downstream end that closes in a given time.
Algorithm
- Input data: , , wave speed , friction factor , reservoir head , initial steady discharge , valve closure law (relative opening), total simulation time .
- Grid: choose the number of reaches ; set and (characteristics along the diagonal).
- Constants: , , .
- Initial conditions (): at all nodes ; (steady friction loss along the pipe).
- Time loop: set .
- Interior nodes :
- ,
- Upstream node (, reservoir): ; ; .
- Downstream node (, valve): . With the valve law the solution is For complete closure (): , .
- Update: replace old values by the new ones, , .
- Store/print and (especially the maximum at the valve and mid-pipe).
- If go to step 5; otherwise stop. Plot against to read the maximum pressure rise.
Start -> read data -> grid, B, R -> initial Q, H
-> t = t + dt
-> interior nodes (C+ and C-)
-> reservoir node (C-) , valve node (C+ and valve law)
-> update Q, H -> output
-> t < T ? yes: back to "t = t + dt" no: stop
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- MOC numerical, characteristics not on diagonal (25 cm) · Computational Techniques in Civil Engineering, chapter 6 · asked 2×
- MOC numerical, characteristics not on diagonal (30 cm) · Computational Techniques in Civil Engineering, chapter 6 · asked 2×
- Water hammer: rectangular grid and specified intervals · Computational Techniques in Civil Engineering, chapter 6
- MOC single reach, reservoir pipe (2 s) · Computational Techniques in Civil Engineering, chapter 6
- MOC numerical: discharge and head at P (30 cm pipe) · Computational Techniques in Civil Engineering, chapter 6
- MOC single reach, reservoir pipe (3 s) · Computational Techniques in Civil Engineering, chapter 6
- Water hammer and how to minimize it · Power Plant Equipment, chapter 1 · asked 4×
- Surge and water hammer: 25 m³/s, 15 m surge tank · Hydropower Engineering, chapter 6 · asked 3×
- Water hammer in penstock and surge tank · Power Plant Equipment, chapter 1 · asked 2×
- One cycle of water hammer pressure wave · Hydraulics, chapter 4 · asked 2×
All Computational Techniques in Civil Engineering chapter 6 questions →