A&A 528, A101 (2011) Astronomy DOI: 10.1051/0004-6361/201015945 & c ESO 2011 Astrophysics General relativistic magnetohydrodynamics in axisymmetric dynamical spacetimes: the X-ECHO code N. Bucciantini1 and L. Del Zanna2 1 NORDITA, AlbaNova University Center, Roslagstullsbacken 23, 10691 Stockholm, Sweden e-mail:
[email protected] 2 Dipartimento di Fisica e Astronomia, Università di Firenze, Largo E. Fermi 2, 50125 Firenze, Italy e-mail:
[email protected] Received 18 October 2010 / Accepted 13 January 2011 ABSTRACT We present a new numerical code, X-ECHO, for general relativistic magnetohydrodynamics (GRMHD) in dynamical spacetimes. This aims at studying astrophysical situations where strong gravity and magnetic fields are both supposed to play an important role, such as in the evolution of magnetized neutron stars or in the gravitational collapse of the magnetized rotating cores of massive stars, which is the astrophysical scenario believed to eventually lead to (long) GRB events. The code extends the Eulerian conservative high-order (ECHO) scheme (Del Zanna et al. 2007, A&A, 473, 11) for GRMHD, here coupled to a novel solver of the Einstein equations in the extended conformally flat condition (XCFC). We solve the equations in the 3 + 1 formalism, assuming axisymmetry and adopting spherical coordinates for the conformal background metric. The GRMHD conservation laws are solved by means of shock-capturing methods within a finite-difference discretization, whereas, on the same numerical grid, the Einstein elliptic equations are treated by resorting to spherical harmonics decomposition and are solved, for each harmonic, by inverting band diagonal matrices. As a side product, we built and make available to the community a code to produce GRMHD axisymmetric equilibria for polytropic relativistic stars in the presence of differential rotation and a purely toroidal magnetic field.