1 0 GfsRiver GfsBox GfsGEdge {} { PhysicalParams { L = 8. } # size of GfsBox PhysicalParams { g = 1. } # gravity (for GfsOcean and GfsRiver) # Define a 1D domain using cell masking RefineSurface 9 (y - 8.*(0.5 - 1./512.)) InitMask {} (y < 8.*(0.5 - 1./512.)) # Set the topography Zb and the initial water surface elevation P Init {} { Zb = x*x/8. P = { double p = x > 0. ? 0.35 : x < -2. ? 1.9 : -1.; return MAX (0., p - Zb); } } # # Use a first-order scheme rather than the default second-order # minmod limiter. This is just to add some numerical damping. # AdvectionParams { # gradient = gfs_center_minmod_gradient gradient = none } Time { end = 160 } # use gfsplot/gnuplot for online visualisation and generation of figures OutputSimulation { step = 0.3 } { gfsplot " set title sprintf('t = %4.1f', (t)) plot [-4.:4.]'-' u (x):(Zb):(H) w filledcu lc 3, \ '-' u (x):(Zb) w l lw 4 lc 1 lt 1 set term pngcairo size 800,600 set output sprintf('sim-%04.1f.png', (t)) replot set term wxt noraise " } { format = text } } GfsBox { left = Boundary right = Boundary }