Ordinary differential equations 17
horizontal plane n and plane n + 1 (n = 1 to N + 1). The plane n = 1
corresponds to the bottom, and the plane n = N + 1 to the free surface.
The computational time step is selected as 5 seconds. The simulation
results of the receding water elevation and the outflow discharge are
illustrated in Figure 2.4.
Computer code 2.1
% Example 2.1 Cylindrical Reservoir with No Refilling
Emptying through an Orifice
% S = Reservoir surface area of a cylindrical tank [m^2];
% H = Reservoir initial depth [m];
% A = Orifice surface area [m^2];
% Co = Discharge coefficient [dimensionless];
% Dt = Computational time step [s];
% Dz = Computational depth step [m];
% Qout(z) = Outflow discharge [m^3/s];
% z(t) = Numerical solution for the water depth [m];
% ns = number of horizontal sections;
clc; clear all; close all;
% Input data;
g=9.81;
ns=10;
H=10;
10
9
8
7
6
5
4
3
2
1
0 0
5 0
100
150
200
250
300
350
400
450
Number of time steps
z: water stage (m)
Q out : outflow discharge × 10 –2 (m 3 /s)
Figure 2.4 Water elevation of the emptying tank.
horizontal plane n and plane n + 1 (n = 1 to N + 1). The plane n = 1
corresponds to the bottom, and the plane n = N + 1 to the free surface.
The computational time step is selected as 5 seconds. The simulation
results of the receding water elevation and the outflow discharge are
illustrated in Figure 2.4.
Computer code 2.1
% Example 2.1 Cylindrical Reservoir with No Refilling
Emptying through an Orifice
% S = Reservoir surface area of a cylindrical tank [m^2];
% H = Reservoir initial depth [m];
% A = Orifice surface area [m^2];
% Co = Discharge coefficient [dimensionless];
% Dt = Computational time step [s];
% Dz = Computational depth step [m];
% Qout(z) = Outflow discharge [m^3/s];
% z(t) = Numerical solution for the water depth [m];
% ns = number of horizontal sections;
clc; clear all; close all;
% Input data;
g=9.81;
ns=10;
H=10;
10
9
8
7
6
5
4
3
2
1
0 0
5 0
100
150
200
250
300
350
400
450
Number of time steps
z: water stage (m)
Q out : outflow discharge × 10 –2 (m 3 /s)
Figure 2.4 Water elevation of the emptying tank.
