Skip to main content

Disks & MHD · Methods

MNRAS 2022

Cold shear flows on a moving mesh

The moving-mesh code AREPO follows the gas in a rotating disk, but in strongly sheared flows it produced noise that could disrupt a cold disk. I traced this noise to the single-point integration of fluxes over cell faces and largely removed it with higher-order quadrature.

On this page

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.

Two zoomed density maps of a cold Keplerian disk with the Voronoi cells drawn. Left, the old scheme: a patchwork of cells with random density deviations of up to about 15 percent and an irregular mesh. Right, the improved scheme: an orderly polar mesh with smooth, ring-shaped density variations below one percent.
Zoomed view of a cold Keplerian disk at t = 100 (code units), started from a polar grid, without (left) and with (right) the improvements. With the old scheme the initial grid structure is lost and the local noise reaches about 10 percent; with the new scheme the maximum deviation is about 1 percent and forms coherent rings. Note the different color ranges. Figure: Zier & Springel 2022, Fig. 6.

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.

Two face-on density maps of a cold Keplerian disk at time 800. Left, labeled Old: the disk is broken up into irregular, noisy rings with a disrupted inner region. Right, labeled Improved: a smooth, uniform annulus with a clean inner edge.
Density of a cold Keplerian disk at t = 800, started from a Cartesian grid of 320 × 320 cells, with the previous version of AREPO (left) and with the improved flux integration and limiter (right). Apart from a slight density increase at the inner edge caused by the boundary, the improved run keeps the disk intact. Figure: Zier & Springel 2022, Fig. 7.

Data from the paper are available on reasonable request via Software and data.

Paper

  1. 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.

    arXiv ADS DOI