Muskingum-Cunge Matlab
Muskingum-Cunge Matlab
Muskingum-Cunge Matlab
9-1. Detention basin with 700ft x 700ft with 4:1 side slope. Top of the berm is at elevation 9 ft.
Inflow hydrograph is a triangular shape with a peak discharge of 125 cfs at a time of 8 hr and
with a base time of 24 hr. The detention basin is initially empty. Route the inflow hydrograph
through the detention basin and determine the peak outflow and stage.
Table. Stage-storage-outflow relationships based on given outlet structures and detention basin geometry
The peak outflow is 36.7 cfs at 19 hr. The maximum storage is 8 ft at 19 hr.
140
120
100
80
Q [cfs]
60
40
20
0
0 5 10 15 20 25
Time [hr]
Figure. Inflow and outflow hydrograph
10
6
Z [ft]
0
0 5 10 15 20 25
Time [hr]
Figure. Temporal change in stagee, Z
HW-Chapter 9 Naoki Mizukami
9-3. Rout the inflow hydrograph given using Muskingum method with Δt = 2 hr, Δx = 25000 ft,
θ = 3.6 hr, X = 0.2. Plot the inflow and outflow hydrographs and determine the percent reduction
in the inflow peak as well as the travel time of the peak
HW-Chapter 9 Naoki Mizukami
Using average Q, find average velocity, flow area with manning’s equation
5 5
Kn A 3
1 Kn y 0 b m y 0 3 1
Q S 2 S 2
0 0
n 23 n 2
P b 2 y0 1 m 2 3
5
1.49 y 0 100 2 y 0 3
1
2500 0.001 2
2
0.025
100 2 y 0 1 2 2 3
Solving for y0, y0 = 4.65 ft,
2500
V Q/A = 4.91 ft/s
4.65 (100 2 4.65)
So wave celerity is calculated
5 5
ck V 4.91 8.19
3 3
Δt = 0.5 hr is chosen so that 5 discretized points are in rising part of inflow hydrograph
1 Q 1 2500
x c k t 8.19 0.5 60 60 8659 ft
2 BS 0 c k 2 118 .6 0 .001 8.19
So select Δx = 6000 ft
Matlab Code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Muskingum-Cunge with variable coefficient method
%Coefficients X, and ck (wave celerity) are dynamic in time and space due to
%varying Q, resulting in variable C0, C1, and C2.
%
% brief description of 4 point variable parameter method
%the 4 point method computes an average Q using inflow and outflow at the first step and next step and
%use the average Q to estimate M-C parameters. This computation is performed every time outflow at the
%next time step is computed. Since outflow at the next time step is unknown, three point Q are used for
%first guess for average Q. Iteration is necessary to make average Q converged at a certain error
%tolerance.
%
%
clear all
close all
%River geometry
L = 18000; %river reach length [ft]
S0 = 0.0005; %bed slope [ft/ft]
b = 100; %bottom width [ft]
m = 2; %side slope
n = 0.025; %manning n
%some constant
Kh = 1.49; %manning equation
%initial condition at x
for j = 1:length(x)
Q(1,j) = Q(1,1);
end
%compute depth, y0, based on manning equation. use bisect method with 0.01 error tolerance
y0 = fbisect(func,0,10,0.01);
%compute flow area, A, velocity, V, and wave celerity, ck, top width, TOP, given depth y0
A = y0*(b+2*y0);
V= Qave/A;
ck = 5/3*V;
TOP = b+2*m*y0;
%If difference between current 4 point average and previous one is less than 0.1
%leave iteration loop, otherwise use new average to compute new estimate of
%outflow at next time step
if abs(Qave-Qave1)< 0.1; break; end
Qave = Qave1;
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of code
HW-Chapter 9 Naoki Mizukami
Results (applied this code to example 9.6)
Table. Muskingum-Cunge routing (inflow and routed hydrograph at x =9000 and x = 18000)
5000
infow
4500 x=9000 ft
x=18000 ft
4000
3500
3000
Q [cfs]
2500
2000
1500
1000
500
0
0 1 2 3 4 5 6 7 8
Time [hr]
Figure. Inflow and outflow hydrographs