File Exchange

image thumbnail

1D Shallow Water Equations Dam Break

version (13.8 KB) by James Adams
Solves the 1D Shallow Water Equations for a Dam Break scenario


Updated 06 May 2014

View License

Solves the 1D Shallow Water equations using a choice of four finite difference schemes (Lax-Friedrichs, Lax-Wendroff, MacCormack and Adams Average). The Adams Average scheme was devised by myself (James Adams) in 2014.
Uses Dam Break conditions (initial water velocity is set to zero).

A choice of either zero gradient (water flows out of the domain) or reflective boundary conditions is given.

Plots both the water height and velocity at each iteration.

A heuristic time step is used. The simulation is halted if the time step becomes too small.

Plots a graph of the time step values once the simulation has finished.

Cite As

James Adams (2019). 1D Shallow Water Equations Dam Break (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)


where can i change the height of the initial calculation .....


well done, did you work on finite volume method?


Great code dear James,
Is it possible to show some parameters used in your code schematically?
specially for left/right boundary, damwall,...

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux