Summary
- Noise in a uniform shear flow
- ≈ 10−3 before
- Relative density noise with the default scheme; with the new one the ground state is preserved to machine precision on a static unstructured mesh.
- Cause
- Single-point fluxes
- One flux evaluation at the center of each face is exact only if the flux varies linearly across the face.
- Method
- Gauss–Legendre quadrature
- Two points per face in 2D; in 3D each face is split into triangles with four points each.
- Extra cost in 3D
- ≈ 30%
- Down from about 110% for a naive implementation, with one time extrapolation per face and AVX-2 vectorization.
- Cold Keplerian disk
- Intact at t = 800
- With the previous version the inner edge begins to break up at about t = 600.
- Yee vortex
- 2nd-order convergence
- Independent of the initial grid.
The work is described in Zier & Springel (2022). The improved fluxes are the basis of the shearing-box studies.
Noise in a uniform shear flow
The simplest test of a shearing box is its ground state, a uniform flow with a linear shear profile, which should stay unchanged. With the default code it did not: relative density noise of about 10−3 appeared and was sheared into stripes. It did not decrease with smaller time steps, and vanished on static Cartesian or hexagonal meshes, but persisted once the cells became irregular.
Single-point flux evaluation
The noise originated in the flux integral over each cell face. A finite-volume code updates each cell from the fluxes through its faces, and AREPO evaluated each flux once at the face center. This midpoint rule is exact only if the flux varies linearly across the face. With a linear velocity gradient, however, the momentum flux is quadratic in position, and with linear density and velocity gradients the energy flux reaches fourth order. On symmetric cells the resulting errors cancel between opposite faces; on an unstructured mesh they do not, and every distorted cell becomes a small noise source.
Gauss–Legendre quadrature
Replacing the midpoint rule with higher-order Gauss–Legendre quadrature over each face avoids these errors. In two dimensions, two evaluation points per face integrate polynomials up to third order exactly, which was sufficient for all tests in the paper. In three dimensions the faces are polygons, so each one is split into triangles taken from the Delaunay tessellation, and each triangle is integrated with four points. Every point needs its own state reconstruction and Riemann solution, totaling on average more than 15 flux evaluations per face. In a three-dimensional test of the background shear flow, a naive implementation cost about 110 percent more than the single-point scheme; extrapolating the states in time only once per face and vectorizing the flux calculation with AVX-2 instructions cut this overhead to about 30 percent. In two dimensions the extra cost is small compared with the mesh construction, and the method became the default there.
Smaller changes complete the scheme: a slope limiter that is no longer triggered by smooth gradients on highly irregular cells, a consistent frame for the time extrapolation, and an optional third-order Runge–Kutta integrator. On a static unstructured mesh, the ground state is now preserved to machine precision. On a freely moving mesh, a small time-integration residual remains and decreases at second order with the time step.
Results
In the standard test of a cold gas disk on Keplerian orbits started from a polar grid, the inner edge of the disk begins to break up at about t = 600 with the previous version of AREPO; with the new scheme the disk is still intact at t = 800, whether the initial mesh is polar or Cartesian. The Yee vortex now converges at second order independently of the initial grid. As a first application, AREPO sustained MRI turbulence without a net magnetic field at 32 cells per scale height, with stresses somewhat below those of the static-grid code ATHENA.
Data from the paper are available on reasonable request via Software and data.
Paper
-
Simulating cold shear flows on a moving mesh
Zier & Springel · MNRAS 515, 525–542 · 2022
The shearing box in AREPO and the higher-order flux integration that removes grid noise in shear flows.