Hydromagnetic waves in an expanding universe  cosmological MHD code tests using analytic solutions
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 matterdominated, flat EinsteindeSitter (EdS) universe. The waves considered are comoving, linearly polarized Alfvén waves and comoving, magnetosonic (fast) waves modified by selfgravity. The solution for compressible waves is found for a general adiabatic index and we consider the limits of hydrodynamics without selfgravity in addition to the full solution. In addition to these analytic solutions, the linearized equations are solved numerically for a Λ cold dark matter 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 NavierStokes viscosity. A comparison between Alfvén wave simulations and theory reveals that the dissipation can be described by a numerical viscosity coefficient η_{num} ∝ 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.
 Publication:

Monthly Notices of the Royal Astronomical Society
 Pub Date:
 September 2022
 DOI:
 10.1093/mnras/stac1882
 arXiv:
 arXiv:2203.11887
 Bibcode:
 2022MNRAS.515.3492B
 Keywords:

 hydrodynamics;
 MHD;
 waves;
 cosmology: theory;
 software: simulations;
 software: development;
 Astrophysics  Cosmology and Nongalactic Astrophysics
 EPrint:
 19 pages, 9 figures, submitted to MNRAS, python code available at https://github.com/tberlok/comoving_mhd_waves