- 2070 Bhadra · 8 marks
Algorithm for unsteady pipe flow FD equations
Short answer
Set up grid with Δt=Δx/a. At interior nodes, equate the C+ and C− equations to solve for Q_{P_i}=[H_{i-1}−H_{i+1}+B(Q_{i-1}+Q_{i+1})−R(Q_{i-1}|Q_{i-1}|+Q_{i+1}|Q_{i+1}|)]/(2B), then compute H_{P_i} from either. Upstream boundary uses C− with known head; downstream uses C+ with given condition. Update all nodes and march in time.
Prepare an algorithm to compute discharge and head based on the following form of finite difference equations for unsteady pipe flow problem using a rectangular grid.
where = head, = discharge, and = head and discharge at the point of intersection of two characteristics, and = coefficients.
Given: the two finite difference (characteristic) equations on a rectangular grid, with :
with and .
Solution of the two equations at an interior node
Equate the two expressions for and solve for :
Then follows by substituting in either equation. Equivalently, , with and .
Algorithm
- Read , , , , the number of reaches , the total time , the initial and for , and the boundary conditions (upstream and downstream).
- Compute , , , and .
- Set and store the initial values.
- Repeat while :
- .
- For (interior nodes):
- Upstream boundary (): only the equation is available. Use it with the boundary condition (e.g. a reservoir, ):
- Downstream boundary (): only the equation is available: , used together with the boundary condition (for a closed end , so ; otherwise a valve, pump or reservoir relation).
- Update: , for all .
- Output and at the required nodes and times.
- Stop when .
read data; compute dx, dt, B, R; set initial Q, H; t = 0
while t < T:
t = t + dt
for i = 2..N: Q_P(i) from the C+ / C- pair, then H_P(i)
upstream node: C- + boundary condition
downstream node: C+ + boundary condition
Q(i) = Q_P(i); H(i) = H_P(i) for all i
print / store results
end while
The time step must satisfy (Courant number 1) so that the characteristics pass through the grid points and no interpolation is needed.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Method of characteristics; FD form for pipe flow · Computational Techniques in Civil Engineering, chapter 6 · asked 4×
- MOC numerical: discharge and head at P (30 cm pipe) · Computational Techniques in Civil Engineering, chapter 6
- Characteristic form FD solution (velocity, pressure) · Computational Techniques in Civil Engineering, chapter 6 · asked 2×
- Water hammer: rectangular grid and specified intervals · Computational Techniques in Civil Engineering, chapter 6
- Resection, two point problem, intersection · Surveying II, chapter 5
- Velocity, head loss, discharge in pipes BC, CD, BF, FD (0.1 m) · Water Supply Engineering, chapter 7
- Velocity, head loss, discharge in loop pipes BC, CD, BF, FD · Water Supply Engineering, chapter 7
- Derive continuity equation for unsteady pipe flow · Hydraulics, chapter 4
All Computational Techniques in Civil Engineering chapter 6 questions →