sandbox/Antoonvh/rb4.c

    2D Rayleigh-Bernard convection in a periodic square.

    Setting Ra = 10^6 and Pr = 1 results in a periodic-in-time pattern.

    Buoyancy

    #define NOSLIP_TOP (1)
    #define NOSLIP_BOTTOM (1)
    #include "nsf4t.h"
    scalar zeros[], b[], * tracers = {b};
    
    b[bottom] = dirichlet_vert_bottom(0.5);
    b[top]    = dirichlet_vert_top(-0.5);
    
    int main() {
      periodic (left);
      const scalar diff[] = 1e-3;
      kappa = nu = diff;
      a.x = zeros;
      a.y = b;
      run();
    }
     
    event init (t = 0) {
      TOLERANCE = 1e-5;
      foreach_vert()
    Basilisk C parse error near `foreach_vert()
        b[] = noise()/100;
      boundary ({b});
    }
    invalid storage class for function ‘mov_expr0’
    invalid storage class for function ‘mov’
    event mov (t += 0.1) 
      output_ppm (b, file = "b.mp4", n = 300, min = -0.55, max = 0.55);
    invalid storage class for function ‘stop_expr0’
    invalid storage class for function ‘stop’
    event stop (t = 100);