src/test/higuera.c

Viscous hydraulic Jump

We want to reproduce the hydraulic jump of Higuera (1994).

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

int main() {
  X0 = 0.14;
  L0 = 1. - X0;
  G  = 1.;
  N  = 128;
  nl = 15;
  ν = 1.;
  run();
}

We impose boundary condition for h and η.

h[left] = dirichlet (.2);
η[left] = dirichlet (.2);

h[right] = dirichlet (0.02);
η[right] = dirichlet (0.02);

Initialization

We define a scalar field hc to check for convergence on h.

scalar hc[];

event init (i = 0) {

We set a constant velocity at the inlet and a free outlet.

  for (vector u in ul) {
    u.n[left] = 5.5;
    u.n[right] = neumann(0.);
  }

We initialize h and hc.

  foreach()
    hc[] = h[] = 0.2;
}

We check for convergence.

event logfile (t += 0.1; i <= 10000) {
  double dh = change (h, hc);
  printf ("%g %g\n", t, dh);
  if (i > 0 && dh < 1e-5)
    return 1;
}

Output

We print the elevation and the stress.

event output (t = end) {
  vector u0 = ul[0];
  foreach()
    fprintf (stderr, "%g %g %g\n", x, η[], 2.*u0.x[]/(h[]/nl));
}

Results

Comparison with Figure 2 of Higuera (1994).

Comparison with Figure 2 of Higuera (1994).

Bibliography