src/test/poiseuille-axi.c

Axisymmetric Poiseuille flow

Same as poiseuille-periodic.c but axisymmetric.

#include "grid/multigrid.h"
#include "axi.h"
#include "navier-stokes/centered.h"

int main() {
  periodic (right);
  
  stokes = true;
  TOLERANCE = 1e-6;

  u.t[top] = dirichlet(0);

  for (N = 8; N <= 64; N *= 2)
    run(); 
}

scalar un[];

event init (t = 0) {
  const face vector g[] = {1.,0.};
  a = g;
  μ = fm;
  foreach()
    un[] = u.x[];
}

event logfile (t += 0.1; i <= 100) {
  double du = change (u.x, un);
  if (i > 0 && du < 1e-6)
    return 0; /* stop */
}

event profile (t = end) {
  printf ("\n");
  foreach()
    printf ("%g %g %g %g %g\n", x, y, u.x[], u.y[], p[]);
  scalar e[];
  foreach()
    e[] = u.x[] - 0.25*(1. - y*y);
  norm n = normf (e);
  fprintf (stderr, "%d %g %g %g\n", N, n.avg, n.rms, n.max);
}
Second-order convergence is obtained as expected.

Second-order convergence is obtained as expected.