You do not have the rights to run code in /sandbox.

collapse of a rectangular viscous column

As a test case of Shallow Water laminar we propose the Hupper (“The propagation of two-dimensional and axisymmetric // viscous gravity currents over a rigid horizontal surface” JFM 82, self similar solution of a collapse of a viscous column

#include "grid/cartesian1D.h"
#include "saint-venant.h"

size of the domain and value of friction

void parameters()
  X0 = -15.;
  L0 = 30.;
  G = 1;
// friction
double Cf = 0.125;

start by a rectangular column of surface 2

void init()
  foreach() {
    zb[] = 0;
    h[] = 0.25*(fabs(x)<4);

The friction splited step, Poiseuille friction (implicit scheme)

event friction (i++) {
  {  	 double ff = h[] < dry ? HUGE : (1. + Cf*dt/h[]/h[]);
    u.x[] /= ff;}
  boundary ({u.x});

save the values in files “eta”

event outputfile (t <= 1000;t+=200) {
  static int nf = 0;
  fprintf (stderr,"file: eta-%d\n", nf++);
  fprintf (stderr,"%g %g \n", x, h[]);

save the values in self similar variable

 event field (t <= 1000;t+=200) {	
     printf ("p %g %g %g %g \n", x/pow(t,.2), h[]*pow(t,.2), u.x[], zb[]);
         printf ("p\n");

run with 2048 points

int main() {
	N = 512*4;

then after run:

gnuplot viscous_collapse.plot

will run gnuplot (using the commands in viscous_collapse.plot) to produce :

Collapse of the viscous column. Collapse of the viscous column.