ivan-pi / periodic-lbm

A personal collection of research codes for LBM in periodic domains
Apache License 2.0
9 stars 1 forks source link

Barotropic vortex #2

Open ivan-pi opened 2 years ago

ivan-pi commented 2 years ago

The code from Filip:

 // initialize vortex
    for (auto i : domain.all()) {
        double eps = 0.5 * cs;
        double xc = 0.5;
        double yc = 0.5;
        double xx = domain.pos(i)[0] / LX;
        double yy = domain.pos(i)[1] / LX;
        double xxc = xx - xc;
        double yyc = yy - yc;
        double xxc2 = xxc * xxc;
        double yyc2 = yyc * yyc;
        double rh0 = 1.;

        u[i][0] = u0 - eps * (yyc / Rc) * exp(-(xxc2 + yyc2) / (2. * Rc * Rc));
        u[i][1] = eps * (xxc / Rc) * exp(-(xxc2 + yyc2) / (2. * Rc * Rc));

        rho[i] = rh0 * (1. - 0.5 * eps * eps / (cs * cs) * exp(-(xxc2 + yyc2) / (Rc * Rc)));
    }

The benchmark is explained in the paper:

Wissocq, G., Boussuge, J. F., & Sagaut, P. (2020). Consistent vortex initialization for the athermal lattice Boltzmann method. Physical Review E, 101(4), 043306. https://doi.org/10.1103/PhysRevE.101.043306

ivan-pi commented 2 years ago

The code above uses the first-order Taylor expansion in density. The paper seems to recommend, the true barotropic initialization instead.