Simulating turbulent MHD dynamos with Astaroth GPU library
Miikka Väisälä1*, Johannes Pekkilä2, Maarit Käpylä3,2,4, Matthias Rheinhardt2, Hsien Shang1, Ruben Krasnopolsky1
1Institute of Astronomy and Astrophysics, Academia Sinica, Taipei, Taiwan
2Department of Computer Science, Aalto University, Espoo, Finland
3Max Planck Institute for Solar System Research, Max Planck Institute, Göttingen, Germany
4Nordita, KTH Royal Institute of Technology and Stockholm University, Stockholm, Sweden
* Presenter:Miikka Väisälä,
Turbulent plasma can generate magnetic fields via dynamo process which transfer kinetic energy of the turbulence into magnetic energy. Dynamos have multiple application in both astro- and geophysics, and they can occur in both large-scale and small-scale. In simplified sense, if turbulence has helical flows, those flows can induce an emergent large-scale magnetic field. Otherwise with or without helicity, magnetic energy is generated at small scales. Due to the non-linearity of a turbulent plasma, however, separating and understanding how both large-scale and small-scale dynamos (LSD and SSD respectively) relate to each other is a challenging task.

To understand the relation of LSD and SSD, we examined their early growth with turbulent magnetohydrodynamical simulations MHD simulations. To perform such simulations efficiently, we have developed a code called Astaroth, which is able to accelerate high-order stencil computations, such as required by MHD turbulence, by using the power of GPUs. It reaches to a 35 times speedup on as single node and double precision arithmetic, in compared to the reference code Pencil Code. It solves the issue of long memory latencies cause by high-order operation by utilizing the methods inspired by vertex processing pipelines in computer graphics. In addition, while we have used Astaroth for a specific task, it has been constructed as a general API-type library for working with stencil-type operations and it is not bound to a limited algorithm. The code itself is openly available at

With the power afforded by GPU acceleration, we set up a dense parameter space to examine the growth of both LSD and SSD by inducing helical and non-helical turbulence in a periodic domain as a function of magnetic Reynolds numbers (Rm). We also performed our runs with multiple resolutions to check for convergence. We found that for the most diffusive low Rm cases would only result in the emergence of a large-scale field, with intermediate Rm the LSD growth was inhibited somewhat and at high Reynolds numbers the SSD drives the initial growth stage itself. We also show that the growth rate a SSD follows a logarithmic trend with respect to Rm. In addition, the computed mean-field estimates can predict comparable growth rates. While the turbulence magnetic field as a whole is non-linearly coupled, both LSD and SSD show characteristic features within the system in their own scales.

Keywords: Plasma modeling and numerical simulation, Plasma turbulence and transport, Graphics processing units, Magnetohydrodynamics, Astrophysics