Astrophysics in computers: Building virtual laboratories

Neutron stars, black holes and the plasma around them cannot be studied in a laboratory, so we build virtual laboratories in computers. Modeling physics in computers requires discretizing continuous quantities in space. Approximations are key to simplify systems with millions of particles, waves and their interactions across scales. One such approximation is to treat a magnetized plasma as a fluid. Theoretical physicists then assign densities, electromagnetic fields and velocities to each point in a grid and ask one question over and over again: During a tiny step in time, how do balance laws, such as energy and momentum conservation, change these quantities at the interface between two cells of the numerical mesh? This question is called a Riemann problem. The information needed to answer it is encoded in partial differential equations, the building blocks of all continuous dynamics. These equations dictate the speeds at which signals move within the fluid, and knowing these speeds allows us to answer the above question at each point in space very rapidly. In many cases, a scientific simulation breaks down a complex problem into simple questions that can be asked over and over again. With small enough grid cells and time steps, the answers converge to the correct physical behavior.

Research summary

  • We developed a high-order numerical simulation tool for general relativistic force-free electrodynamics, the low-inertia limit of relativistic ideal MHD, on the infrastructure of the Einstein Toolkit. It uses the fast parallelization provided by the Carpet driver. The animations below illustrate why astrophysical codes need parallelization.
  • Our code accurately evolves force-free plasma waves, so-called Alfvén and fast waves. It has been tested against a wide range of astrophysically relevant standard scenarios: aligned and tilted dipole magnetospheres of neutron stars, aligned pulsar magnetospheres, and black hole monopole and Wald magnetospheres.
  • Monotonicity preserving (MP) discretization operators allow us to achieve very high order when modeling smooth force-free dynamics. We also reviewed the caveats of force-free electrodynamics, which is constrained to ideal electric fields and magnetic dominance, in current sheets, that is, in physically resistive layers.
  • We provide implementations for both Cartesian and spherical meshes. The latter are well suited for curved geometries, as they often occur in the magnetospheres of compact objects.
  • Beyond fluid models, our group develops and uses the open-source GPU particle-in-cell code Entity, which follows the kinetic dynamics of individual plasma particles at scale.

Visualizing science

On a 2D grid, the evaluation of intercell fluxes proceeds quickly by today’s computational standards.

In the early days of computer simulations, 1D and 2D setups dominated the field. They are much less demanding than their 3D counterparts, and the consecutive solution of Riemann problems was feasible on the computers available at the time. Even today, some of the largest simulations, such as models of plasma turbulence with well above one billion grid cells, can only be conducted in 2D. This omits dynamics that emerge in the important third dimension, but it allows physicists to resolve very large and very small structures at the same time.

In three dimensions, the number of intercell fluxes grows with the cube of the resolution, and evaluating all of them takes very long even on small grids.

In many situations, capturing the full dynamics of a physical problem requires all three spatial dimensions. Examples are plasma waves and extended reconnection structures, where magnetic field lines wind around each other and rearrange their topology. However, a 3D simulation requires solving far more Riemann problems than its 1D and 2D counterparts. Large, high-resolution 3D simulations therefore rely on a variety of techniques to run efficiently on today’s computing infrastructures.

Decomposing the domain into smaller pieces lets astrophysical simulations run in reasonable time, but requires many processing units working at once.

The most basic strategy is to decompose the 3D domain into many smaller subdomains. Large computers with thousands of processing units can split even large 3D domains into many small simulations that solve all Riemann problems simultaneously. This step is essential for all modern astrophysical simulations and builds on major progress in computer science, as all processing units holding small chunks of the simulation have to communicate with each other. Developing ever more efficient decompositions and hardware, such as GPUs, is an active field and will enable even more powerful virtual laboratories in the future.

Collaborative results

J. F. Mahlmann, M. Á. Aloy, V. Mewes, P. Cerdá-Durán, Computational general relativistic force-free electrodynamics: I. Multi-coordinate implementation and testing, Astronomy and Astrophysics, Volume 647, A57, March 2021, https://doi.org/10.1051/0004-6361/202038907

J. F. Mahlmann, M. Á. Aloy, V. Mewes, P. Cerdá-Durán, Computational general relativistic force-free electrodynamics: II. Characterization of numerical diffusivity, Astronomy and Astrophysics, Volume 647, A58, March 2021, https://doi.org/10.1051/0004-6361/202038908