Hydromagnetic waves in an expanding universe -- cosmological MHD code tests using analytic solutions

Thomas Berlok
3/22/2022
astro-ph.CO

Official code: tberlok/comoving_mhd_waves (8 stars, Python, last commit 2023-09-27).

Abstract

We describe how analytic solutions for linear hydromagnetic waves can be used for testing cosmological magnetohydrodynamic (MHD) codes. We start from the comoving MHD equations and derive analytic solutions for the amplitude evolution of linear hydromagnetic waves in a matter-dominated, flat Einstein-de-Sitter (EdS) universe.

Show full abstract

The waves considered are comoving, linearly polarized Alfvén waves and comoving, magnetosonic (fast) waves modified by self-gravity. The solution for compressible waves is found for a general adiabatic index and we consider the limits of hydrodynamics without self-gravity in addition to the full solution. In addition to these analytic solutions, the linearized equations are solved numerically for a $Λ$CDM cosmology. We use the analytic and numeric solutions to compare with results obtained using the cosmological MHD code AREPO and find good agreement when using a sufficient number of grid points. We interpret the numerical damping clearly evident in simulations with few grid points by further deriving the Alfvén wave solution including physical Navier-Stokes viscosity. A comparison between Alfvén wave simulations and theory reveals that the dissipation can be described by a numerical viscosity coefficient $η_\mathrm{num} \propto a^{-5/2}$ where $a$ is the scale factor. We envision that our examples could be useful when developing a new cosmological MHD code or for regression testing of existing codes.

View on arXivView PDF

Code Implementations(1)

Analytic and numeric reference solutions for comoving magnetohydrodynamic waves

81PythonMar 21, 20223 years ago
cosmological-simulationscosmologymagnetohydrodynamicspythonwaves

Similar Papers

Cite this paper

@article{berlok2022hydromagnetic,
  title  = {Hydromagnetic waves in an expanding universe -- cosmological MHD code tests using analytic solutions},
  author = {Thomas Berlok},
  year   = {2022},
  eprint = {2203.11887},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.11887}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.11887.svg)](https://codeofpaper.com/paper/2203.11887)

Discussion