You are on page 1of 3

Engineering School of Sustainable Infrastructure and Environment

EOC 6934 – "Hydrodynamic models for estuarine and coastal waters"


3 Credits – Fall 2021

Instructor: Alberto Canestrelli

Fortran project: a model for the steady state 1-D shallow water equations

Part 1

Implement in Fortran a numerical model which solves the steady state 1-D shallow water equations
for a rectangular prismatic channel. The ODE is solved by means of an Euler explicit scheme.

Part 2

In the Fortran code developed in part 1, implement also the following numerical schemes for an
infinitely large channel:
- Euler explicit scheme (1st order)
- Modified Euler, explicit (a specific case of a 2nd order Runge Kutta)
- Runge-Kutta, explicit, 4th order

For the case of infinitely wide rectangular channel, with these inputs:

Discharge=13 m2/s = 450


z0 (Bed elevation downstream) = -11 m
D0 (depth downstream) = -z0
slope = 0.00002
Ks (Gauckler Stricker) = 70
Domain Length = 400000 m

Perform a convergence analysis. Start with 100 cells and progressively double the number of cells.
Compute both errors in norm L2 and Lmax, which read:

𝑛𝑛
1
𝐿𝐿2 = � �(𝑌𝑌𝑖𝑖exact − 𝑌𝑌𝑖𝑖numer )2
𝑛𝑛
𝑖𝑖=1

𝐿𝐿max = max(|𝑌𝑌𝑖𝑖exact − 𝑌𝑌𝑖𝑖numer |)

where for this project you have two options for the exact solution: (i) you can approximate 𝑌𝑌𝑖𝑖exact
VeryRefined
with 𝑌𝑌𝑖𝑖 , which is the solution obtained using a very refined grid (e.g. with 100,000 cells);
(ii) you can use the exact solution of Venutelli computed by the exe file provided by me (easier
option).
Turn in the following items for part 1 and 2:

- The executable of the model


- The Fortran code, which should have a few clear comments explaining what it is done
- The Simply Fortran project file, use the same project for part 1 and 2.
Note for items above
- The input files
- By running your executable, I should be able to obtain an output file which is similar to
this:

X(m) z(m) depth(m) U(m/s)

0 -10 13 0.85
100 -8 12.5 0.9
..... .... .... ...

- For part 2, provide a document having the errors in norm L2 and Lmax and the order of
accuracy for each of the implemented schemes. That means, for each scheme provide a
table like this:

Ν cells L2 norm Order Lmax norm Order


100 1.3
200 0.8
400 0.98
800 1.01

You do not necessarily have to stick with the numbers above for Ncells. That is just an example,
think carefully about that. ∆x has to be small enough so that you are close to an asymptotic
behaviour and the order of accuracy is reached. But inspect the errors, you might be surprised by
what happens for small ∆x and high orders. Are those numbers above maybe too high or too low?

Notes:
-please add a switch in the input file so that the user can select the proper scheme for his
application)
-Please use international units.
-In the Fortran code employ functions when a quantity has to be repeatedly computed (e.g. Area,
hydraulic radius etc)

Part 3 (optional)

In the numerical model developed in part 1-2, and for the case of an infinitely large channel set:

number of cells =10


Discharge=13 m2/s = 450
z0 (Bed elevation downstream) = -11 m
D0 (depth downstream) = -z0
slope = 0.00002
Ks (Gauckler Stricker) = 70
Domain Length = 400000 m

and run the model with the different numerical schemes. Plot all the results (i.e. the depth obtained
by solving the ODE with each different scheme) in a single plot. In the same plot, also include the
analytical solution of Venutelli (Direct Integration of the Equation of Gradually Varied Flow,
Journal Of Irrigation And Drainage Engineering, 2004). Compute the analytical solution using the
executable provided by me. Turn in the plot, together with comments explaining why some
schemes perform better than others.

You might also like