The Gresho vortex test is a notoriously difficult problem for grid-based (and SPH) codes. A rotating vortex is initialized such that the centrifugal force is balanced by the pressure gradient. The solution is time-independent. For these tests, I used the initial conditions described in Liska & Wendroff (2003).
The velocity in the gresho problem is specified in polar coordinates, which I convert to Cartesian to initialize the voretx. Given
(where ). Since for the Gresho problem, that gives
is calculated from and using and using .
In plotting the data, the conversion goes the other direction, from to . After a similar derivative analysis, I get
How about the vorticity? Vorticity is the curl of the velocity field, so in 2D it’s
or in polar coordinates
I’m running the test until t = 3.0 on a 40x40 grid with transmissive boundaries, PPMC, the exact solver, and CTU. The domain is x = [0, 1], y = [0, 1], with the vortex centered at (x, y) = (0.5, 0.5). The movies below show the evolution in azimuthal velocity (), pressure, and vorticity (). For and , both 1D and 2D projections are shown.
The L1 error is a useful measurement of how well the code is doing, as well as the convergence rate for this test. I calculate the L1 error for vorticity and density using the standard definition
where is the initial solution, and is the total number of points. The L1 errors for density and vorticity are 0.14% and 135% on a grid, and 0.04% and 80% on a grid.