delay framerate:fps

Use your fingers or mouse to control the model (hold

The shallow-water (or Saint-Venant) equations are
h
_{t} + u_{x} + v_{y} = 0,
u _{t} + (u^{2}/h + gh^{2})_{x}
+ (uv/h)_{y} = 2ghH_{x} ,
v _{t} + (uv/h)_{x} +
(v^{2}/h + gh^{2})_{y} = 2ghH_{y} , |

The simplest possible scheme is the first-order Lax-Friedrichs scheme

+ [F(Q

This is a very robust scheme, which unfortunately gives excessive smearing of nonsmooth parts of the solution.

The main fragment shader is a little lengthy. You can see it in the source of this page.

[1] T.R. Hagen, J.M. Hjelmervik, K.-A. Lie,
J.R. Natvig, M. Ofstad Henriksen
*Visual
simulation of shallow-water waves*
Simulation Modelling Practice and Theory 13 (2005) 716-726

[2] Miguel Lastra, Jose M. Mantas, Carlos Urena,
Manuel J. Castro, Jose A. Garcia-Rodriguez
*Simulation of shallow-water systems using graphics processing units*

Mathematics and Computers in Simulation 80 (2009) 598-618

[3] Trond Runar Hagen, Martin O. Henriksen, Jon M. Hjelmervik, and
Knut-Andreas Lie
*How to Solve Systems of Conservation Laws Numerically Using the
Graphics Processor as a High-Performance Computational Engine*, 2005

Simulations on GPU