src/test/bar.c

Sinusoidal wave propagation over a bar

Beji and Battjes, 1993 and Luth et al, 1994 studied experimentally the transformation of sinusoidal waves propagating over a submerged bar (or reef). This is a good test case for dispersive models as higher harmonics are nonlinearly generated and released with phase shifts corresponding to the dispersion relation.

#include "grid/multigrid1D.h"
#include "green-naghdi.h"

The basin needs to be long enough so as to minimise the influence of wave reflection at the outlet. Relatively high resolution is needed to capture the dynamics properly.

int main() {
  N = 2048;
  L0 = 50;
  G = 9.81;
  run();
}

We use “radiation” conditions at the inlet and outlet. At the inlet (on the left), we try to impose the desired sinusoidal wave form. We have to tune the amplitude to obtain the required amplitude as measured in the experiment at gauge 4. The period of 2.02 seconds matches that of the experiment.

u.n[left]  = - radiation (0.03*sin(2.*π*t/2.02));
u.n[right] = + radiation (0);

event init (i = 0) {

Here we define the bathymetry, see e.g. Figure 3 of Yamazaki et al, 2009.

  foreach() {
    zb[] = (x < 6 ? -0.4 :
	    x < 12 ? -0.4 + (x - 6.)/6.*0.3 :
	    x < 14 ? -0.1 :
	    x < 17 ? -0.1 - (x - 14.)/3.*0.3 :
	    -0.4);
    h[] = - zb[];
  }
}

We use gnuplot to visualise the wave profile as the simulation runs and to generate a snapshot at t=40.

Snapshot of waves. The top of the bar is seen in white.

Snapshot of waves. The top of the bar is seen in white.

void plot_profile (double t, FILE * fp)
{
  fprintf (fp,
	   "set title 't = %.2f'\n"
	   "p [0:25][-0.12:0.04]'-' u 1:3:2 w filledcu lc 3 t ''\n", t);
  foreach()
    fprintf (fp, "%g %g %g\n", x, η[], zb[]);
  fprintf (fp, "e\n\n");
  fflush (fp);
}

event profiles (t += 0.05) {
  static FILE * fp = popen ("gnuplot", "w");
  plot_profile (t, fp);
  fprintf (stderr, "%g %f\n", t, interpolate (η, 17.3, 0.));
}

event gnuplot (t = end) {
  FILE * fp = popen ("gnuplot", "w");
  fprintf (fp,
           "set term pngcairo enhanced size 640,200 font \",8\"\n"
           "set output 'snapshot.png'\n");
  plot_profile (t, fp);
}

The location of the gauges is difficult to find in the litterature, we used a combination of Yamazaki et al, 2009 and Dingemans, 1994.

Gauge gauges[] = {
  {"WG4",  10.5},
  {"WG5",  12.5},
  {"WG6",  13.5},
  {"WG7",  14.5},
  {"WG8",  15.7},
  {"WG9",  17.3},
  {"WG10", 19},
  {"WG11", 21},
  {NULL}
};

event output (i += 5; t <= 40)
  output_gauges (gauges, {η});

The modelled and experimental (circles) timeseries compare quite well. The agreement is significantly better than that in Yamazaki et al, 2009 (figure 4) in particular for gauge 9, but probably not as good as that in Lannes and Marche, 2014 (figure 12), who used a higher-order scheme, and a three-parameter optimised dispersion relation. Note that using the optimised dispersion relation (with αd=1.153) is necessary to obtain such an agreement.

Comparison of experimental and numerical timeseries

Comparison of experimental and numerical timeseries