sandbox/bugs/leaking.c
Leaking boundaries
This is based on the shock test.
#include "saint-venant.h"
int LEVEL = 5;
We define a new boundary for the cylinder.
bid cylinder;
int main() {
(5.);
size = 9.81;
G (-L0/2., -L0/2.);
origin // gradient = zero;
(1 << LEVEL);
init_grid run();
}
We impose height and velocity on the left boundary.
#define H0 3.505271526
#define U0 6.29033769408481
event init (i = 0) {
The geometry is defined by masking and the initial step function is imposed.
If this is replaced by “convex” boundaries there seems to be no problem.
mask (sq(x + 0.5) + sq(y) < sq(0.5) ? cylinder : none);
foreach() {
[] = (x <= -1 ? H0 : 1.);
h.x[] = (x <= -1 ? U0 : 0.);
u}
}
event logfile (i++; t <= 0.3) {
stats s = statsf (h);
fprintf (ferr, "%g %d %g %g %.8f\n", t, i, s.min, s.max, s.sum);
}
The mass is not conserved as it should.
plot 'log' u 1:5 w l