1 Introduction

Relativistic hydrodynamics has been widely used for description of collective dynamics in various phenomena from nuclear physics to astrophysics. The high-energy heavy-ion collision experiment is one of the active fields of application of relativistic hydrodynamics.

At Relativistic Heavy Ion Collider (RHIC), production of the strongly interacting quark–gluon plasma (QGP) was succeeded, which was achieved by measurement of key observables and theoretical interpretation to them [1,2,3,4]. In particular, at that time, the strong elliptic flow was successfully explained by hydrodynamic models. Along with other phenomenological analyses, this fact reached the conclusion that the QGP created at RHIC is not weakly interacting gas but strongly interacting plasma. The analysis of high-energy heavy-ion collisions based on the relativistic viscous hydrodynamics shed light on not only understanding dynamics of space-time evolution after collisions, but also QGP bulk properties such as temperature dependence of shear and bulk viscosities and a diffusion constant. Usually, the QGP bulk properties are discussed in comparison between experimental data and hydrodynamic model calculation. Intensive computation of Bayesian analysis is also performed for extracting detailed information of thermodynamic properties of QCD [5, 6].

During the relativistic collision of positively charged heavy nuclei, the highest intense electromagnetic fields in our universe are produced, e.g. \(|eB|\sim 10^{15} ~{\textrm{T}}\) [7]. The high-energy heavy-ion collision is possible to address the property of interaction between deconfined strongly interacting matter and electromagnetic fields. The effect of electrical conductivity of the medium on the evolution of electromagnetic fields has been discussed with the semi-analytic solutions of electromagnetic fields in Refs. [8, 9]. The contribution of electromagnetic fields to the charge-dependent anisotropic flow has been estimated from the semi-analytic solution of simplified relativistic hydrodynamic equations with electromagnetic fields in Refs. [10,11,12]. Furthermore, relativistic hydrodynamic simulation with background electromagnetic fields has been investigated [13, 14].

The fully realistic analysis of high-energy heavy-ion collisions would require one to solve Maxwell equations together with relativistic hydrodynamic equations. It is called a full relativistic magneto-hydrodynamic (RMHD) framework, which describes the dynamics of the plasma coupled with electromagnetic fields. Such an analysis with infinite electrical conductivity, relativistic ideal MHD, has been carried out [15, 16]. In the relativistic ideal MHD, the electric field measured in the fluid comoving frame vanishes. In order to consider the charge distribution of hadrons in high-energy heavy-ion collisions, the simulation based on the RMHD framework with finite electrical conductivity is needed. Therefore, we construct a model for high-energy heavy-ion collisions based on relativistic resistive magneto-hydrodynamics (RRMHD).

The RRMHD simulation has been performed in astrophysical situations such as black hole accretion disks, jets, and neutron star magnetospheres. The dissipation associated with Ohmic conduction current affects the topology of the magnetic field and liberates the magnetic energy, which is known as magnetic reconnection discussed in astrophysical applications [17,18,19,20,21,22].

In astrophysical community, there are two known difficulties for constructing the RRMHD code. First one is that a time step size \(\Delta t\) becomes too much short for calculation of highly conducting medium with explicit time integration. Then it is time consuming to follow a long time evolution of dynamics. Several numerical schemes are proposed to solve this problem such as adopting a semi-analytic solution [23] and an implicit-explicit (IMEX) Runge–Kutta algorithm [24, 25]. Then, the time step size is determined by the advection time of the fluid or the wave rather than the diffusion time. Another difficulty is found in keeping the constraints of the Maxwell equations, e.g., Gauss’s law and the divergence-free constraint. Ampere’s law and Faraday’s law describe the time evolution of electric and magnetic fields, respectively. These equations ensure that constraints hold if they are satisfied at the initial state. These conditions are, however, not preserved numerically in a not well-designed scheme for multi-dimensional problems. The violation of the constraints leads to the growth of spurious oscillation and the simulation is unexpectedly terminated. In the framework of RRMHD, the generalized Lagrange multiplier (GLM) method is proposed to guarantee these conditions [23, 26]. In this scheme, the numerical errors relating to the violation of the constraints are advected and dissipated. The GLM scheme is commonly used also in MHD [27] and RMHD [28] and shows the robustness of the numerical code. As another solution of this problem, a constrained transport (CT) method [29,30,31,32,33] is also developed. This approach takes the magnetic field as a staggered representation whereby the different components are situated on the cell surface which is normal to the corresponding components.

In this paper, we construct a RRMHD code by adopting the semi-analytic method for time integration and GLM method for preserving the conditions in the Milne coordinates for the purpose of understanding high-energy heavy-ion collisions. These methods are well-known in the astrophysical community, but we adopted them in the Milne coordinates to understand the high-energy heavy-ion collisions for the first time. We check the correctness and robustness of our code by performing several numerical tests which are common test problems for relativistic ideal MHD and RRMHD. We also propose the test problem of longitudinal expansion with an acceleration of relativistic resistive magneto-hydrodynamics. The semi-analytic solution of this problem is shown by mimicking the electromagnetic configuration and fluid velocity in high-energy heavy-ion collisions [34]. We apply this solution as a test problem of RRMHD in the Milne coordinates.

This paper is organized as follows. In Sect. 2, we briefly review the formulation of RRMHD. We explain the numerical algorithm of the RRMHD systems in our simulation code in Sect. 3. We show numerical benchmark tests as a verification of our RRMHD simulation code in Sect. 4. A summary is given at the end in Sect. 5. Unless otherwise specified, we use natural units \(\hbar = c = \epsilon _0 = \mu _0 = 1\), where \(\epsilon _0\) and \(\mu _0\) are the electric permittivity and the magnetic permeability in vacuum, respectively. Throughout the paper, the components of the four tensors are indicated with Greek indices, whereas three vectors are denoted as boldface symbols.

2 Relativistic resistive magneto-hydrodynamics

The conservation laws for the number density current \(N^\mu \) and for the total energy–momentum tensor of the plasma \(T^{\mu \nu }\) in the dynamics of the whole system are written by,

$$\begin{aligned}{} & {} \nabla _\mu N^\mu = 0, \end{aligned}$$
(1)
$$\begin{aligned}{} & {} \nabla _\mu T^{\mu \nu } = 0, \end{aligned}$$
(2)

where \(\nabla _\mu \) is the covariant derivative. The electromagnetic fields follow Maxwell equations,

$$\begin{aligned}{} & {} \nabla _\mu F^{\mu \nu } = -J^{\nu }, \end{aligned}$$
(3)
$$\begin{aligned}{} & {} \nabla _\mu ~^\star F^{\mu \nu } = 0, \end{aligned}$$
(4)

where \(F^{\mu \nu }\) is a Faraday tensor and \(^{\star }F^{\mu \nu } = \frac{1}{2}\epsilon ^{\mu \nu \rho \sigma }F_{\rho \sigma }\) is its dual tensor, with \(\epsilon ^{\mu \nu \rho \sigma } = (-g)^{-1/2}[\mu \nu \rho \sigma ]\), \(g = \det (g_{\mu \nu }) \) and \([\mu \nu \rho \sigma ]\) is a completely anti-symmetric tensor. Here \(g_{\mu \nu }\) is a metric tensor. If the magnetization and polarization effects are ignored, the energy–momentum tensor of the electromagnetic fields is written by,

$$\begin{aligned} T^{\mu \nu }_{f} = F^{\mu \lambda }F_\lambda ^\nu - \frac{1}{4}g^{\mu \nu }F^{\lambda \kappa }F_{\lambda \kappa }, \end{aligned}$$
(5)

and this tensor follows \(\nabla _\mu T^{\mu \nu }_f = J_{\mu }F^{\mu \nu }\), from Maxwell equations. The total energy–momentum tensor is the sum of the contribution of matter and electromagnetic fields \(T^{\mu \nu } = T^{\mu \nu }_m + T^{\mu \nu }_f\). The conservation law of the total system shown by Eq. (2) gives,

$$\begin{aligned} \nabla _\mu T^{\mu \nu }_m = -J_{\mu }F^{\mu \nu }. \end{aligned}$$
(6)

For the ideal fluid, the energy–momentum tensor and the charged current of fluids are written by,

$$\begin{aligned}{} & {} N^\mu = \rho u^\mu , \end{aligned}$$
(7)
$$\begin{aligned}{} & {} T^{\mu \nu }_m = (e+p)u^\mu u^\nu +pg^{\mu \nu }, \end{aligned}$$
(8)

where \(u^{\mu }\) (\(u^\mu u_\mu = -1\)) is a single fluid four-velocity, \(\rho \) is the number density, \(e = T^{\mu \nu }_m u_\mu u_\nu \) is energy density and \(p =\frac{1}{3}\Delta _{\mu \nu }T^{\mu \nu }_m\) is pressure of the fluid. We have introduced the projection tensor \(\Delta _{\mu \nu }= g_{\mu \nu } + u_\mu u_\nu \). The Faraday tensor and its dual tensor can be rewritten as,

$$\begin{aligned}{} & {} F^{\mu \nu }= u^\mu e^\nu - u^\nu e^\mu + \epsilon ^{\mu \nu \lambda \kappa }b_\lambda u_\kappa , \end{aligned}$$
(9)
$$\begin{aligned}{} & {} {}^\star F^{\mu \nu } = u^{\mu } b^{\nu } - u^{\nu } b^{\mu } - \epsilon ^{\mu \nu \lambda \kappa }b_\lambda u_\kappa , \end{aligned}$$
(10)

where,

$$\begin{aligned}{} & {} e^\mu = F^{\mu \nu }u_\nu ,~( e^{\mu }u_\mu = 0 ), \end{aligned}$$
(11)
$$\begin{aligned}{} & {} b^\mu = ~^\star F^{\mu \nu }u_\nu ,~( b^{\mu }u_\mu = 0), \end{aligned}$$
(12)

are the electric and magnetic fields measured in the comoving frame of the fluid. We introduce the electric field \(E^i\) and the magnetic field \(B^i\), which are related to \(e^\mu \) and \(b^\mu \) by

$$\begin{aligned}{} & {} e^\mu = (\gamma v_kE^k, \gamma E^i + \gamma \epsilon ^{ijk}v_jB_k), \end{aligned}$$
(13)
$$\begin{aligned}{} & {} b^\mu = (\gamma v_kB^k, \gamma B^i - \gamma \epsilon ^{ijk}v_jE_k), \end{aligned}$$
(14)

where \(\gamma \) is the Lorentz factor of the fluid and \(v^i\) is the fluid three-velocity. The projections of \(\nabla _\mu T^{\mu \nu }_m = -J_{\mu }F^{\mu \nu }\) along the perpendicular and parallel directions with respect to \(u^{\mu }\) are given by,

$$\begin{aligned}{} & {} (e+p)Du^{\alpha }+(\nabla ^\alpha + u^\alpha D)p = F^{\alpha \lambda }J_\lambda - u^{\alpha }e^{\lambda }J_{\lambda }, \end{aligned}$$
(15)
$$\begin{aligned}{} & {} De + (e+p)\Theta =e^{\lambda }J_{\lambda }, \end{aligned}$$
(16)

where \(D=u^{\mu }\nabla _\mu \) and \(\Theta =\nabla _\mu u^{\mu }\). Equations (15) and (16) correspond to the equation of motion and energy equation, respectively. They are auxiliary equations that are not solved in our numerical code. However, they are useful for the discussion of Bjorken flow in resistive medium, shown in Sects. 4.6 and 4.7.

Since the system of equations Eqs. (1)–(4) is closed by Ohm’s law, we adopt the simplest form of it shown in Ref. [35]. In the covariant form, Ohm’s law is written by,

$$\begin{aligned} J^\mu = \sigma F^{\mu \nu }u_{\nu } + qu^\mu , \end{aligned}$$
(17)

where \(\sigma \) is electrical conductivity and \(q = -J^\mu u_\mu \) is electric charge density of the fluid in the comoving frame. Maxwell equations lead to the charge conservation law,

$$\begin{aligned} \nabla _\mu J^\mu = 0. \end{aligned}$$
(18)

When we take the ideal limit \((\sigma \rightarrow \infty )\) of Ohm’s law, Eq. (17) is reduced to,

$$\begin{aligned} e^{\mu } = 0. \end{aligned}$$
(19)

3 Numerical procedure

We now represent governing equations of the RRMHD in a suitable form for numerical calculation. Also, we show a numerical scheme to solve RRMHD equations which are appropriate for studying high-energy heavy-ion collisions.

3.1 Metric

We split the space-time into 3 + 1 components by space-like hypersurface defined as the iso-surfaces of a scalar time function t and assume a metric of the form,

$$\begin{aligned} ds^2= -dtdt + g_{ij}dx^idx^j. \end{aligned}$$
(20)

Since we consider only the Cartesian and the Milne coordinates in this paper, the metric tensor is diagonal. We will use the Cartesian coordinates (txyz) in Sects. 4.14.2, 4.34.4 and 4.5.1. The Milne coordinates \((\tau ,x,y,\eta _s)\) will be adopted in Sects. 4.5.2, 4.6 and 4.7, where \(\tau := \sqrt{t^2-z^2}\) is the longitudinal proper-time and \(\eta _s:= \frac{1}{2}\ln {\frac{t+z}{t-z}}\) is the space rapidity. We note that in the Cartesian coordinates, the three metric \(g_{ij} = {\textrm{diag}}\{1,1,1\}\), with \(\sqrt{-g} = 1\), whereas in the Milne coordinates, \(g_{ij} = {\textrm{diag}}\{1,1,\tau ^2\}\), with \(\sqrt{-g} = \tau \). In both coordinates, \(\partial _j g_{ik} =0~(j = 1,2,3)\), source terms of space-components in conservation equations vanish. However, in the Milne coordinates, where \(g_{33} = \tau ^2\), the source terms for the energy conservation equation contain a non-zero term proportional to \(\frac{1}{2}\partial _0 g_{33} = \tau \).

3.2 Constraint equations

Maxwell equations contain two constraint equations,

$$\begin{aligned}{} & {} \partial _i(\sqrt{-g}E^i) = \sqrt{-g}q,\ \end{aligned}$$
(21)
$$\begin{aligned}{} & {} \partial _i(\sqrt{-g}B^i) = 0. \end{aligned}$$
(22)

Though Maxwell equations ensure that these constraints are satisfied at all time steps, a simple integration of Maxwell equations in numerical simulation does not preserve these conditions because of numerical error. The accumulation of numerical errors leads to unphysical oscillation and numerical simulation crashes in the end for multi-dimensional problems. For this reason, a number of numerical techniques for avoiding this problem are investigated. In this model, we adopt the GLM method to guarantee these conditions [23, 26, 28]. The main idea is that one introduces two variables, \(\psi \) and \(\phi \) as the deviation from constraints. One manages a system of equations to decay or carry the deviation \(\psi \) and \(\phi \) out of the computation domain by relatively high-speed waves.

For the GLM method, we extend the Eqs. (3) and (4) to,

$$\begin{aligned}{} & {} \nabla _\nu (F^{\mu \nu } + g^{\mu \nu }\psi ) = -\kappa n^{\mu }\psi + J^{\mu }, \end{aligned}$$
(23)
$$\begin{aligned}{} & {} \nabla _\nu (^{\star }F^{\mu \nu } + g^{\mu \nu }\phi ) = -\kappa n^{\mu }\phi , \end{aligned}$$
(24)

where \(\psi \) and \(\phi \) are new variables and \(\kappa \) is a positive constant. In the Cartesian coordinates, we obtain the telegraph equations for \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}}-q\) and \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}\),

$$\begin{aligned}{} & {} \partial _t^2({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}} - q) + \kappa \partial _t({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}} - q) - \partial _i\partial ^i({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}} - q) = 0,\nonumber \\ \end{aligned}$$
(25)
$$\begin{aligned}{} & {} \partial _t^2({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}) + \kappa \partial _t({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}) - \partial _i\partial ^i({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}) = 0. \end{aligned}$$
(26)

Consequently, \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}}-q\) and \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}\) propagate at the speed of light and decay exponentially over a timescale \(1/\kappa \). In the form of the metric Eq. (20), a time-like normal vector is reduced to \(n_\mu = (-1,\varvec{0})\). The modified divergence-free equation of \(\varvec{B}\) and the Faraday’s law become,

$$\begin{aligned}{} & {} \partial _t(\sqrt{-g}\phi )+\partial _i(\sqrt{-g}B^i) = -\sqrt{-g}\kappa \phi , \end{aligned}$$
(27)
$$\begin{aligned}{} & {} \partial _t(\sqrt{-g}B^j) + \partial _i[\sqrt{-g}(\epsilon ^{ijk}E_k + g^{ij}\phi )] = 0. \end{aligned}$$
(28)

Also, the modified Gauss’s law and Ampere’s law are obtained as,

$$\begin{aligned}{} & {} \partial _t(\sqrt{-g}\psi ) + [\partial _i(\sqrt{-g}E^i)-\sqrt{-g}q] = -\sqrt{-g}\kappa \psi ,\nonumber \\ \end{aligned}$$
(29)
$$\begin{aligned}{} & {} \partial _t(\sqrt{-g}E^j) - \partial _i[\sqrt{-g}(\epsilon ^{ijk}B_k + g^{ij}\psi )] = - \sqrt{-g}J^j.\nonumber \\ \end{aligned}$$
(30)

The conservation law of electric charge is written by,

$$\begin{aligned} \partial _t (\sqrt{-g} q) +\partial _i (\sqrt{-g}J^i) = 0. \end{aligned}$$
(31)

3.3 Basic equations

Let us rewrite the equations of motion Eqs. (1), (2), (23), (24) and (31) in a conservative form which is appropriate for numerical integration,

$$\begin{aligned} \partial _0 \left( \sqrt{-g}~\varvec{U}\right) + \partial _i \left( \sqrt{-g}~\varvec{F}^i\right) = \sqrt{-g}~(\varvec{S}_e+\varvec{S}_s), \end{aligned}$$
(32)

where \(\varvec{U}, \varvec{F}^i\), \(\varvec{S}_e\) and \(\varvec{S}_s\) are the sets of conservative variables, fluxes, source terms which are explicitly solved, and source terms of the stiff part, respectively. These variables contain the following components,

$$\begin{aligned}{} & {} \varvec{U} = \left( \begin{array}{c} D \\ \Pi _{j}\\ \varepsilon \\ B^j\\ E^j\\ q\\ \psi \\ \phi \end{array} \right) , \quad \varvec{F}^i = \left( \begin{array}{c} Dv^i\\ T^i_j\\ \Pi ^i\\ \epsilon ^{jik}E_k + g^{ij}\psi \\ {}-\epsilon ^{jik}B_{k} + g^{ij}\phi \\ J^{i}\\ E^{i}\\ B^{i} \end{array} \right) \nonumber , \\{} & {} \quad \varvec{S_e} = \left( \begin{array}{c} 0\\ \frac{1}{2}T^{ik}\partial _{j} g_{ik}\\ {}-\frac{1}{2}T^{ik}\partial _{0}g_{ik}\\ 0\\ {}-qv^i\\ 0\\ 0\\ 0 \end{array} \right) ,\quad \varvec{S_s} = \left( \begin{array}{c} 0\\ 0\\ 0\\ 0\\ {}-J^{i}_{c}\\ 0\\ {}-\kappa \psi \\ {}-\kappa \phi \end{array} \right) , \end{aligned}$$
(33)

where the number density D, the total momentum \(\Pi ^i\), the stress tensor \(T_{ij}\), the total energy density \(\varepsilon \) and the conduction electric current \(J^i_c\) are given by,

$$\begin{aligned} D= & {} \gamma \rho , \end{aligned}$$
(34)
$$\begin{aligned} \Pi _i= & {} (e+p)\gamma ^2v_i + \epsilon _{ijk}E^jB^k, \end{aligned}$$
(35)
$$\begin{aligned} T_{ij}= & {} (e+p)\gamma ^2v_iv_j + (p+p_{\mathrm{{em}}})g_{ij} - E_iE_j - B_iB_j,\nonumber \\ \end{aligned}$$
(36)
$$\begin{aligned} \varepsilon= & {} (e+p)\gamma ^2 - p + p_{\mathrm{{em}}}, \end{aligned}$$
(37)
$$\begin{aligned} J_c^i= & {} \sigma e^i, \end{aligned}$$
(38)

where the electromagnetic energy density \(p_{\textrm{em}}\) is defined as \(p_{\mathrm{{em}}} = \frac{1}{2}(E^2+B^2)\). We adopt the operator splitting method for time integration. Then Eq. (32) can be divided into two equations as,

$$\begin{aligned}{} & {} \partial _0 \left( \sqrt{-g}~\varvec{U}\right) + \partial _i \left( \sqrt{-g}~\varvec{F}^i\right) = \sqrt{-g}\varvec{S}_e, \end{aligned}$$
(39)
$$\begin{aligned}{} & {} \partial _0 \left( \sqrt{-g}~\varvec{U}\right) = \varvec{S}_s. \end{aligned}$$
(40)

Equation (39) can be integrated in time with an explicit manner, while Eq. (40) becomes stiff for large \(\sigma \) and \(\kappa \). The one-dimensional discretization of Eq. (39) can be written by,

$$\begin{aligned} \varvec{U}^{n+1}_i = \varvec{U}^{n}_i - \frac{\Delta t}{\Delta x} (\varvec{f}_{i + 1/2} - \varvec{f}_{i - 1/2}) + \varvec{S}_e\Delta t, \end{aligned}$$
(41)

where \(\Delta x\) is the grid spacing and \(\varvec{f}\) is the numerical flux. The subscript i denotes the grid point, \(x = i\Delta x\), and the superscript n shows the number of time steps, \(t=n\Delta t\).

We need to reconstruct the primitive variables on the cell surface from those of the cell center to evaluate the numerical flux. We adopt the second-order accurate scheme for this reconstruction [36] given by,

$$\begin{aligned} \varvec{P}^n_{i \pm 1/2} {=} \varvec{P}^n_{i} \pm \delta \varvec{P}^n_i/2, \end{aligned}$$
(42)
$$\begin{aligned} \delta \varvec{P}^n_i {=} \left\{ \begin{array}{ll} {\textrm{sign}}(\delta \varvec{P}_{i {+} 1/2})\min (|\delta \varvec{P}_{i{+}1/2}&{} \\ |/2,2|\delta \varvec{P}_{i{+}1}|,2|\delta \varvec{P}_{i}|) &{}{\textrm{if}}\ {\textrm{sign}}(\delta \varvec{P}_{i{+}1}){\textrm{sign}}(\delta \varvec{P}_{i})>0,\\ 0&{}{\textrm{otherwise}}, \end{array} \right. \nonumber \\ \end{aligned}$$
(43)

where \(\delta \varvec{P}_{i+1/2} = \varvec{P}_{i+1} - \varvec{P}_{i-1}\), \(\delta \varvec{P}_{i+1} = \varvec{P}_{i+1} - \varvec{P}_{i}\), and \(\delta \varvec{P}_{i} = \varvec{P}_i - \varvec{P}_{i-1}\). Then the numerical flux is computed by using the Harten–Lax–van Leer (HLL) method [37] given by,

$$\begin{aligned}{} & {} \varvec{f}_{i \pm 1/2} \nonumber \\{} & {} = \frac{\lambda ^{+} \varvec{F}^{{\textrm{L}}}_{i \pm 1/2} {-} \lambda ^{-} \varvec{F}^{{\textrm{R}}}_{i \pm 1/2} {+} \lambda ^{+}\lambda ^{-}(\varvec{U}^{{\textrm{R}}}_{i \pm 1/2} {-} \varvec{U}^{{\textrm{L}}}_{i \pm 1/2})}{\lambda ^+ - \lambda ^-},\nonumber \\ \end{aligned}$$
(44)

where \(\lambda ^+\) and \(\lambda ^-\) represent the maximum and minimum wave speeds of the system, respectively. We evaluate them by the speed of light for simplicity. The superscript \({\textrm{L}}\) \(({\textrm{R}})\) denotes that the variables are calculated from the primitive variables reconstructed by these at grid on the left (right) side. Then, we numerically integrate Eq. (39) using numerical fluxes.

3.4 Stiff part

In this subsection, we show how to solve the stiff part Eq. (40) based on Ref. [23], which contains Ampere’s law and equations of \(\phi \) and \(\psi \). For Ampere’s law, we split the stiff relaxation equation Eq. (40) into the perpendicular and the parallel directions with respect to \(v^i\) by the operator splitting method and we redefine \(E^{'i} = \sqrt{-g}E^i\) and \(B^{'i} = \sqrt{-g}B^i\) to,

$$\begin{aligned}{} & {} \partial _0(E_{\parallel }^{'i}) = -\sigma \gamma [E_\parallel ^{'i} - (E^{'k} v_k)v^i], \end{aligned}$$
(45)
$$\begin{aligned}{} & {} \partial _0(E_{\perp }^{'i}) = -\sigma \gamma (E_\perp ^{'i} + \epsilon ^{ijk}v_j B^{'}_k), \end{aligned}$$
(46)

where \(E^{'i}_{\perp }\) and \(E^{'i}_{\parallel }\) are the perpendicular and the parallel directions of the electric field with respect to \(v^i\). Here, \(v^i\) and \(\gamma \) are assumed to be a constant during a small time step \(\Delta t\). The solutions of the initial value problem for these relaxation equations are given by,

$$\begin{aligned}{} & {} E_{\parallel }^{'i} = E_{0\parallel }^{'i}\exp {-\sigma \gamma t}, \end{aligned}$$
(47)
$$\begin{aligned}{} & {} E_{\perp }^{'i} = E_{\perp }^{*i} + (E^{'i}_{0\perp } - E_{\perp }^{*i}) \exp (-\sigma t/\gamma ), \end{aligned}$$
(48)

where \(E^{*i}_{\perp } = -\epsilon ^{ijk}v_j B^{'}_k\) and suffix 0 represents the initial value of \(E^{'i}\).

For \(\psi \) and \(\phi \), we can integrate Eq. (40) as

$$\begin{aligned}{} & {} \psi ' = \psi '_0\exp (-\kappa t), \end{aligned}$$
(49)
$$\begin{aligned}{} & {} \phi ' = \phi '_0\exp (-\kappa t), \end{aligned}$$
(50)

where \(\psi ' = \sqrt{-g}\psi \) and \(\phi '=\sqrt{-g}\phi \), and the suffix 0 represents the initial value of \(\psi '\) and \(\phi '\).

In this scheme, the fluid velocity and Lorentz factor are assumed to be constant within the time step \(\Delta t\). Thus our numerical scheme reduces to a first-order accuracy in time. The formal solution of Ampere’s law should be adopted in a small time step because the velocity and Lorentz factor are not the constant during \(\Delta t\). Hence, the numerical accuracy worsens if the velocity drastically changes with time. We note that the higher order accuracy scheme is proposed by the previous studies, e.g., Ref. [25].

3.5 Primitive recovery

In our numerical code, we need to reconstruct primitive variables \(\{\rho ,p,v^i\}\) from evolved conservative variables \(\{D,\varepsilon ,\Pi _i\}\) in order to calculate the numerical flux at each time step. To reconstruct the primitive variables, we introduce new variables,

$$\begin{aligned}{} & {} \varepsilon ' = \varepsilon - p_{em}, \end{aligned}$$
(51)
$$\begin{aligned}{} & {} \Pi '_i = \Pi _i - \epsilon _{ijk}E^jB^k, \end{aligned}$$
(52)

where \(\varepsilon '\) and \(\Pi '\) are the energy density and the momentum of fluid, respectively. The set of the variables \(\{D,\varepsilon ',\Pi '_i\}\) is the relativistic ideal fluid conservative variables. Therefore, we adopt the ordinary primitive reconstruction method of relativistic hydrodynamic simulation for these variables [38]. We obtain a one-dimensional equation about the gas pressure,

$$\begin{aligned} f(p):= [e(p,\rho ) +p]\gamma ^2(p) - \varepsilon ' - p = 0, \end{aligned}$$
(53)

where,

$$\begin{aligned} \frac{1}{\gamma ^2(p)} = 1- \frac{\Pi '^i\Pi '_i}{(\varepsilon '+p)^2},\rho = D/\gamma (p). \end{aligned}$$
(54)

The p and \(\rho \) dependence of e is determined by an equation of state (EoS). This equation is numerically solved by the Newton–Raphson algorithm. The other primitive variables are reconstructed as,

$$\begin{aligned}{} & {} v^i = \frac{\Pi '^i}{\varepsilon ' + p}, \end{aligned}$$
(55)
$$\begin{aligned}{} & {} \gamma = \frac{1}{\sqrt{1-v^iv_i}}, \end{aligned}$$
(56)
$$\begin{aligned}{} & {} \rho = D/\gamma , \end{aligned}$$
(57)
$$\begin{aligned}{} & {} e = (\varepsilon ' +p)/\gamma ^2 - p. \end{aligned}$$
(58)

We consider the ideal gas EoS \(p = (\Gamma -1)(e-m\rho )\) with the mass of conserved species \(m = 1\) in this paper. We note that we take the non-zero \(\rho \) in Sects. 4.14.2, 4.34.4, and 4.5.1. In Sects. 4.5.24.6, and 4.7, we set \(\rho =0\).

3.6 Numerical algorithm

Our numerical simulation code is based on finite difference schemes. The advection equation Eq. (39) including the source term \(\varvec{S}_e\) is solved by explicit time integration with the second-order TVD Runge–Kutta algorithm [39]. The primitive variables are interpolated from the cell center to the cell surface by using the second-order accurate scheme represented by Eqs. (42) and (43) [36]. The numerical flux is calculated by the HLL flux shown in Eq. (44) [37]. The stiff part Eq. (40) is integrated by the analytic solutions explained in Sect. 3.4. We adopt the GLM method to guarantee these conditions [23, 26, 28] as the divergence cleaning. The primitive recovery is executed by solving Eq. (53) by the Newton–Raphson algorithm explained in Sect. 3.5 [38]. We summarize our numerical algorithm as follows:

  • the values of the primitive variables are reconstructed from the cell center to the cell surface by using the second-order accurate scheme [36] shown in Eqs. (42) and (43).

  • conservative variables \(\varvec{U}\) and fluxes \(\varvec{F}\) on the cell surface in Eq. (32) are computed.

  • the Riemann problem for the numerical flux at cell surfaces is solved by using the HLL flux [37] described by Eq. (44).

  • Equation (39) is explicitly integrated by using the numerical flux.

  • the stiff equation Eq. (40) is integrated by using the analytic solutions given by Eqs. (47) and (48).

  • the new primitive variables are recovered from the evolved conservative variables by solving Eqs. (53)–(58).

4 Test problems

In this section, numerical tests are performed for the verification of our numerical simulation code. We will use the Cartesian coordinates (txyz) in Sects. 4.14.2, 4.34.4 and 4.5.1. The Milne coordinates \((\tau ,x,y,\eta _s)\) will be adopted in Sects. 4.5.2, 4.6 and 4.7. We take the CFL constant as \(C_{\textrm{CFL}} = 0.1\) for all test problems. In all tests, \(\phi \) and \(\psi \) are initialized as zero at all computational grids. The artificial constant \(\kappa \) for two constraints is determined by the relation \(\alpha := \Delta h \kappa /c_h\) where \(\Delta h = \text {min}(\Delta x,\Delta y, \Delta z)\) and the maximum speed of system \(c_h = 1\). We set \(\kappa = 5.5\) in all multidimensional tests [23], which keeps \(\alpha \le 1\).

4.1 Shock tube test problem

In order to test the shock-capturing properties of our numerical simulation code, we consider the simple MHD version of the Brio–Wu test in Ref. [25]. The initial left and right states are given by,

$$\begin{aligned}{} & {} (\rho ^L,p^L,(B^y)^L) = (1.0,1.0,1.0)\quad \text {for}\ x < 0.5, \end{aligned}$$
(59)
$$\begin{aligned}{} & {} (\rho ^R,p^R,(B^y)^R) = (0.125,0.1,-1.0)\quad \text {for}\ x \ge 0.5,\nonumber \\ \end{aligned}$$
(60)

and all the other variables are initially set to 0.

Fig. 1
figure 1

We display the magnetic field \(B_y\) at \(t = 0.4\) in the Brio–Wu type shock tube test problem

Figure 1 shows the results at \(t = 0.4\) for \(\sigma = 0,10,10^2,10^3\), and \(10^4\). The simulation box is bounded by \(x\in [0, 1.0]\) and the number of grid points is 400. For \(\sigma = 10^4\), the left going rarefaction and right going shock wave, and a tangential discontinuity between them appear. Our numerical solution with \(\sigma = 10^4\) reproduces the solution of relativistic ideal MHD simulations [40]. In addition, the solutions with low conductivity are similar to the results of the other RRMHD numerical simulations [25, 41]. Especially the electromagnetic field does not interact with gas for \(\sigma =0\), so that the electromagnetic waves propagate with speed of light. The wave fronts should be located at 0.1 and 0.9 for left and right going waves, respectively. Our results are consistent with these analytic solutions, although wave fronts slightly have a smooth profile due to the numerical diffusion.

4.2 Large amplitude circularly polarized Alfvén wave

We perform a test for the propagation of a large amplitude circularly polarized Alfv́en waves along a uniform background magnetic field \(B_0\). The analytical solution of relativistic ideal MHD is proposed in Ref. [42], which is given by,

$$\begin{aligned}{} & {} (B^y,B^z) = \eta _A B^0(\cos [k(x{-}v_At)],\sin [k(x{-}v_At)]), \end{aligned}$$
(61)
$$\begin{aligned}{} & {} (v^y,v^z) = -\frac{v_A}{B_0}(B^y,B^z), \end{aligned}$$
(62)

where \(B^x = B_0\), \(v_x = 0\), \(k = 2\pi \) is the wave number, and \(\eta _A\) is the amplitude of the wave. The square of the special relativistic Alfv́en wave’s speed \(v^2_A\) is given by,

$$\begin{aligned} v_A^2 = \frac{2B_0^2}{h{+}B_0^2(1{+}\eta _A^2)}\left[ 1{+}\sqrt{1{-}\left( \frac{2\eta _AB_0^2}{h+B_0^2(1{+}\eta _A^2)}\right) }\right] ^{-1},\nonumber \\ \end{aligned}$$
(63)

where \(h = (e + p)/\rho \) is the specific enthalpy. We set the initial parameters as \(\rho =p=\eta _A = 1\), and \(B_0 = 1.1547\). We use an ideal gas EoS, \(p=(\Gamma - 1)(e - m\rho )\) with \(\Gamma = 2\) in this test. From these parameters, the Alfv́en wave’s speed is estimated to \(v_A = 1/2\).

Fig. 2
figure 2

The magnetic field component \(B_y\) at \(t = 2\) is shown in the large amplitude circularly polarized Alfv́en waves. The blue solid, red long dashed-dotted and red dashed lines represent results with \(\sigma = 10^6\) and \(N=\{100,200,400\}\), respectively. The black dotted line stands for the analytical solution

4.2.1 One-dimensional propagation

For one-dimensional propagation, the computational domain is \(x \in [-0.5,0.5]\). We use a periodic boundary condition. Since the solution given by Eqs. (61) and (62) is obtained by solving special relativistic ideal MHD equations, we take a sufficiently large conductivity \(\sigma =10^6\) in this test problem. Figure 2 shows our results at \(t = 2.0\) (one Alfv́en wave crossing time) for the three different numbers of grid points \(N=\{100,200,400\}\) with the analytical solution, in the case of \(\sigma = 10^6\). The blue solid, red long dashed-dotted, and red dashed lines represent results with \(N=\{100,200,400\}\), respectively. The black dotted line stands for the analytical solution. The results with high conductivity \(\sigma \) mean that our simulation code can handle the ideal MHD limit. Also, there is no dependence of the number of grid points, which suggests that even 100 grid points are enough for the description of the analytical solution.

Fig. 3
figure 3

The \(L_1\) norm errors as a function of the inverse of grid-cell size are shown in the large amplitude circularly polarized Alfv́en waves. The two black dashed lines represent the \((-1)\) and \((-2)\) analytical slopes

For this problem, we cannot achieve full second-order accuracy. Figure 3 shows the \(L_1(u,\Delta x^{-1})\) norm errors of the tangential magnetic field \(B_y\) as a function of the inverse of grid-cell size \(\Delta x^{-1}\),

$$\begin{aligned} L_1(u,\Delta x^{-1}):= \sum _i^N|u(x_i;N) - u_{\textrm{EXACT}}(x_i)|\Delta x, \end{aligned}$$
(64)

where \(u_{\textrm{EXACT}}(x_i)\) is an exact solution at \(x = x_i\). The behavior of \(L_1\) norm shows that our numerical simulation is nearly 1.6-order convergence. The main reason for it is that we execute the second-order Runge–Kutta algorithm with many operator splittings. It makes the time accuracy of our scheme worsen [41]. This is the most difficulty to solve in RRMHD since this is the limit of large electrical conductivity.

4.2.2 Two-dimensional propagation

We consider the two-dimensional propagation of large amplitude circularly polarized Alfv́en waves to confirm the numerical convergence in the multi-dimensional test. The initial vector field such as velocity and the magnetic field is rotated in the \(x-y\) plane from one-dimensional propagation. The wave vector \(\varvec{k} = (k_x,k_y,k_z)\) in the three-dimensional Cartesian coordinates is determined by the rotation angle \(\alpha \),

$$\begin{aligned} \tan {\alpha } = \frac{k_y}{k_x}, \end{aligned}$$
(65)

where \(k_z\) is set to be zero since we consider two-dimensional propagation. Then, the vector \(\varvec{A}\) is rotated to \(\varvec{A}^\alpha \rightarrow R_{\gamma \alpha }\varvec{A}^\alpha \), where

$$\begin{aligned} R_{\gamma \alpha } = \left( \begin{array}{ccc} \cos {\alpha }&{}-\sin {\alpha }&{}0\\ \sin {\alpha }&{}\cos {\alpha }&{}0\\ 0 &{} 0 &{} 1\end{array} \right) . \end{aligned}$$
(66)
Fig. 4
figure 4

The magnetic field component \(B_z\) at \(t = 2.2\) and \(y = 0\) is shown in the two-dimensional propagation of large amplitude circularly polarized Alfv́en waves. The green long dashed-dotted, red dashed, and black solid lines represent results with \(\sigma = 10^2\) and \(N_x=\{100,200,400\}\), respectively

We set \(k_x=2\pi \) and the computational domain \(x\in [-0.5,0.5]\times y\in [-0.5/\tan {\alpha },0.5/\tan {\alpha }]\). The rotation angle is set to be \(\alpha = \tan ^{-1}{2}\). The number of grid points in y-direction is taken to be \(N_y = N_x/2\) where \(N_x\) is the number of grid points in x-direction. We take the periodic boundary condition in each direction. The artificial constant \(\kappa \) for the GLM method is chosen to be \(\kappa = 5.5\) in each case.

Figure 4 shows the z-component of magnetic field at \(t = 2.2\) and \(y = 0\). The green long dashed-dotted, red dashed, and black solid lines represent results with \(\sigma = 10^2\) and \(N_x=\{100,200,400\}\), respectively. In the low conductivity case, there is no analytical solution. To see the convergence rate, we compare the reference case \((N_x=400)\) with the other low-resolution cases. We calculate the convergence rate using the equation,

$$\begin{aligned} \text {ERROR}(B_z) = \frac{1}{N_xN_y}\sum _{x,y}\left| B_z(N_x = 400) - B_z(N_x)\right| .\nonumber \\ \end{aligned}$$
(67)

We confirm that the convergence rate is achieved with 1.3-order convergence. This convergence rate is the same as that of the one-dimensional propagation test with \(N=\{100,200,400\}\).

4.3 Self-similar current sheet

Next, we consider the evolution of the self-similar current sheet proposed in Refs. [23, 25]. In this test problem, we assume that the magnetic pressure is much smaller than the pressure of fluid. The magnetic field has only a tangential component \(\varvec{B} = (0, B(x,t), 0)\) and B(xt) changes the sign across the current sheet. The initial pressure of background fluid is set to be uniform, \(p = const\). We take the high conductivity \(\sigma \), so that the diffusion timescale is much longer than the light crossing timescale. In this assumption, the evolution equation of the magnetic field is reduced to,

$$\begin{aligned} \partial _t B -\frac{1}{\sigma }\partial _x^2 B =0. \end{aligned}$$
(68)

The analytic solution of this equation is given by,

$$\begin{aligned} B(x,t) = B_0{\textrm{erf}}\left( \frac{1}{2}\sqrt{\frac{\sigma x^2}{t}}\right) , \end{aligned}$$
(69)

where erf is the error function. We set the initial condition at \(t = 1\) with \(p = 50\), \(\rho = 1\), \(\varvec{E} = \varvec{v} = 0\), and \(\sigma = 100\). The computational domain is \(x \in [-1.5,1.5]\), and the number of grid points is \(N = 200\). Figure 5 shows the numerical result at \(t = 9\). The black long dashed-dotted line represents the initial profile of \(B_y\) at \(t = 1\). The blue solid and red dotted lines stand for the numerical result of \(B_y\) and the analytical solution at \(t = 9\), respectively. This indicates that the result of our simulation code is consistent with the analytical solution and captures the diffusion of the magnetic field.

Fig. 5
figure 5

The magnetic field component \(B_y\) at \(t = 9\) in the self-similar current sheet test, with the initial condition at \(t=1\)

4.4 Cylindrical explosion

The symmetric explosions are useful standard tests for MHD codes even though there are no exact solutions because of the existence of the shock waves in all possible angles [23]. This problem including a strong multidimensional shock wave is useful to check the robustness of the code. We take the same condition as that in Ref. [23]. The computational domain is \(x \in [-6.0,6.0] \times y \in [-6.0,6.0]\) in the two-dimensional Cartesian coordinates. The number of grid points is \(200 \times 200\) with the uniform grid. The initial cylinder radius is taken to \(r = 1\) centered at the origin, where \(r = \sqrt{x^2 + y^2}\). The pressure and number density of fluid are set to \(p=1\) and \(\rho = 0.01\) for \(r \le 0.8\) and exponentially decrease with increasing radius for \(0.8 \le r < 1.0\). The fluid in the exterior of the initial cylinder has \(p=\rho = 0.001\) for \(r \ge 1.0\). We take the uniform magnetic field, \(\varvec{B} = (0.1,0.0,0.0)\), and the velocity \(\varvec{v} = \varvec{0}\) at the initial state. The plasma resistivity and decay constant for variables \(\psi \) and \(\phi \) are set to be \(\sigma = 55\) and \(\kappa = 5.5\). This calculation with \(\sigma = 55\) is the case of the highest possible value of \(\sigma \) before our code crashes. This reason is that the spatial resolution \(\Delta h = 0.06\) is slightly larger than \(\tau _\sigma = 0.018\).

Fig. 6
figure 6

The pressure of the fluid at \(t = 4\) is shown in the 2D cylindrical explosion problem

Fig. 7
figure 7

The magnetic field component \(B_x\) at \(t = 4\) is shown in the 2D cylindrical explosion problem

Fig. 8
figure 8

The Lorentz factor \(\gamma \) at \(t = 4\) is shown in the 2D cylindrical explosion problem

Figures 6 and 7 show the two dimensional profiles of p and \(B_x\) at \(t = 4\), respectively. We can see that strong shock waves are formed and the initial uniform magnetic fields are deformed due to the cylindrical explosion. Such a deformation of the magnetic field may lead to the violation of constraints \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{B}}=0\) and \({\varvec{\nabla }}\,{\varvec{\cdot }}\,{\varvec{E}}=q\). If these constraints are violated, the calculation would crash due to the growth of unphysical spurious oscillation. We can avoid these problems by adopting the GLM method. Figure 8 represents the two dimensional profile of Lorentz factor \(\gamma \) at \(t = 4\). The profile of \(\gamma \) is not isotropic at this time since the magnetic force decelerates gas in y-direction. Figure 9 stands for the two-dimensional profile of the \(10^3\times \phi \) at \(t = 4\). The magnitude of \(\phi \) is very small, \(|\phi |\sim 10^{-3}\). The front of \(\phi \) moves to the outside of the computational domain faster than the expansion of fluids does. We have confirmed that the \(\psi \) is zero within a round error in all computational domains.

The results show the robustness of our code in multi-dimensional problems. We also note that our results are consistent with those of other groups (e.g., Ref. [23]). We get the same results on \(x{-}z\) and \(y{-}z\) planes.

Fig. 9
figure 9

The scalar potential \(\phi \) at \(t = 4\) is shown in the 2D cylindrical explosion problem

4.5 Rotor test

The rotor test is important for a calibration of resistive as well as ideal MHD numerical multidimensional codes [43, 44]. We perform the resistive rotor test both in the Cartesian and in the Milne coordinates.

4.5.1 Cartesian coordinates

The Cartesian computational domain is \(x \in [-0.5,0.5] \times y \in [-0.5,0.5]\) with 300 equidistant grid points in each direction. Inside \(r \le 0.1\) centered at the origin, the fluid rotates with constant angular velocity \(\Omega = 8.5\) with uniform number density \(\rho = 10\) at the initial state. Outside this region (\(r \ge 0.1\)), the medium is static and uniform (\(\rho =1\)). Both the pressure (\(p=1\)) and the magnetic field \(\varvec{B}=(1.0,0,0)\) are uniform in the whole region. The initial electric field is given by the ideal condition, \(-\varvec{v}\times \varvec{B}\). The adiabatic index is \(\Gamma = 4/3\).

Figures 10 and 11 show snapshots of the gas pressure p and the electric field component \(E_z\) at \(t = 0.3\) with electrical conductivity \(\sigma = 10^6\). These results agree with those of other simulation codes [43,44,45]. Again, the GLM method does work in our code, so that the growth of unphysical oscillation suppresses. The same results are reproduced by taking \(x{-}z\) and \(y{-}z\) planes.

4.5.2 Milne coordinates

Fig. 10
figure 10

The pressure of the fluid at \(t= 0.3\) is displayed in the 2D resistive rotor test in the Cartesian coordinates

Fig. 11
figure 11

The electric field component \(E_z\) at \(t = 0.3\) is shown in the 2D resistive rotor test in the Cartesian coordinates

Fig. 12
figure 12

a The pressure of fluid and b the energy density of the electromagnetic fields at \(t = 1.4\) are shown in the 2D resistive rotor test in the Milne coordinates in the case of \(\sigma = 10^3\)

Fig. 13
figure 13

a The pressure of fluid and b the energy density of the electromagnetic fields at \(t = 1.4\) are shown in the 2D resistive rotor test in the Milne coordinates in the case of \(\sigma = 10\)

The rotor test problem for the relativistic ideal MHD in the Milne coordinates is proposed in Ref. [15]. The computational domain in the Milne coordinates is \(x \in [-0.5,0.5] \times y \in [-0.5,0.5]\) with 400 equidistant grid points in each direction. We adopt the free boundary condition in both directions. In this test, the EoS is assumed to be the ultra-relativistic ideal gas EoS, \(p = e/3\), and the number density is set to \(\rho = 0\) at all grid points. We set the initial coordinate time to \(t = 1.0\). Instead of imposing high density around the origin, we set a high pressure region \(p = 5\) inside \(r=0.1\). The initial transverse velocity \((v_x,v_y)\) is given by angular speed \(\Omega =9.7\). Outside this region, the pressure is \(p=1\). The initial longitudinal velocity is set to \(v_\eta = 0\), which is assumed to be longitudinal Bjorken expansion amount to \(v^z = z/t\). The initial magnetic field is set to \(\varvec{B} = (2.0,0,0)\) and the electric field is taken to be \(-\varvec{v}\times \varvec{B}\).

Figure 12a and b show the results of p and \(p_{em}\) of our simulation code at \(t = 1.4\) with \(\sigma = 10^3\), respectively. In the Milne coordinates, we observe the decay of the pressure of the fluid and magnetic pressure, which occurs in the whole computational domain because of the longitudinal expansion of the system. An asymmetric shaped compression wave by the magnetic field is observed in our results because of the higher initial pressure inside the radius \(r < 0.1\) and the rotation of the cylinder. Our result with \(\sigma = 10^3\) has a similar configuration of the result in ECHO-QGP simulation [15]. In the high conductive case, our results capture the features of relativistic ideal MHD. Figure 13a and b represent the results of p and \(p_{em}\) of our simulation code at \(t = 1.4\) with \(\sigma = 10\), respectively. We can see that the anisotropy becomes weaker for a lower conductivity. It indicates that the fluid is weakly coupled with electromagnetic fields. The fluid vorticity does not affect the dynamics of electromagnetic fields. These features can be captured in our code.

4.6 Magnetized Bjorken flow

This problem is an extension of the one-dimensional boost invariant flow proposed by Bjorken [46] to the ideal MHD [47]. We consider the relativistic boost invariant flow in z-direction. In magnetized Bjorken flow, we consider that the fluid follows the ultra-relativistic ideal gas EoS, \(p = e/3\). The pressure of fluid is assumed to be uniform in space. The fluid velocity is given by \(v_z=z/t\), which is obtained by assuming a longitudinal boost invariant expansion. The corresponding four-velocity in the Cartesian coordinates is given by \(u^\mu = (\cosh {\eta _s},0,0,\sinh {\eta _s})\). In the Milne coordinates, the four-velocity becomes simply \(u^\mu = (1,0,0,0)\). The comoving derivative and the expansion rate become \(D = \partial _\tau \) and \(\Theta = 1/\tau \), respectively. The magnetic field is given by \(b^\mu = (0,b^x,b^y,0)\). In this assumption, from the energy conservation equation Eq. (2), one derives [47],

$$\begin{aligned} \partial _{\tau }\left( e+\frac{b^2}{2}\right) + \frac{e+p+b^2}{\tau } = 0, \end{aligned}$$
(70)

where \(b^2 = b^\mu b_\mu \). From the energy equation Eq. (16), we obtain,

$$\begin{aligned} \partial _\tau e + \frac{e+p}{\tau } = 0, \end{aligned}$$
(71)

for the ideal MHD. The evolution equation of the magnetic field is obtained as,

$$\begin{aligned} \partial _\tau b + b/\tau = 0. \end{aligned}$$
(72)

The analytic solutions of these equations for the ultra-relativistic ideal gas EoS, \(p = e/3\), are given by,

$$\begin{aligned}{} & {} e(\tau ) = e_0\left( \frac{\tau _0}{\tau }\right) ^{4/3}, \end{aligned}$$
(73)
$$\begin{aligned}{} & {} b(\tau ) = b_0\frac{\tau _0}{\tau }, \end{aligned}$$
(74)

where \(\tau _0 = 0.5\) fm is initial time, \(e_0 = 10~\text {GeV}/\text {fm}^3\) is initial energy density, and \(b_0 = 1.0 ~\text {GeV}^{1/2}/\text {fm}^{3/2}\) is initial magnetic field.

Figures 14 and 15 show the time evolution of energy density and magnetic field strength with \(\sigma = 10^6\), respectively. The solid curves show analytic solutions, while the dashed curves denote the numerical results. These results are in good agreement with the analytic solutions.

4.7 Accelerating longitudinal expansion

Fig. 14
figure 14

The energy density of the fluid is displayed as a function of \(\tau \) in the magnetized Bjorken flow

Fig. 15
figure 15

The magnetic field strength as a function of \(\tau \) is displayed in the magnetized Bjorken flow

This test problem is presented in Ref. [34]. This is a resistive extension of the magnetized Bjorken flow [47]. The derivation of the semi-analytic solutions is shown in Appendix A in detail, but we here show the results. In this problem, we do not suppose the boost invariant flow. We assume that the fluid velocity is parallel to the longitudinal (z-) direction, and the fluid is uniform on the transverse (xy) plane. Let us parametrize the four-velocity in the Milne coordinates as follows:

$$\begin{aligned} u^\mu= & {} \left( \cosh (Y-\eta _s),0,0,\frac{1}{\tau }\sinh (Y-\eta _s)\right) \nonumber \\= & {} {\bar{\gamma }}\left( 1,0,0,\frac{1}{\tau }{\bar{v}}\right) , \end{aligned}$$
(75)

where Y is the rapidity with \({\bar{\gamma }} = \cosh (Y-\eta _s)\) and \({\bar{v}} = \tanh (Y-\eta _s)\).

Fig. 16
figure 16

We display a the ratio of the energy density of the fluid to the initial energy density and b the fluid velocity component \(u^{\eta _s}/u^\tau \), respectively. The blue solid, red long dashed-dotted and black dashed lines show the numerical results at \(t = 0.5, 1.0\), and 3 fm, respectively. The blue, red, and black dotted lines show the semi-analytic solutions of the a Eqs. (A.17), (A.18), and b Eq. (81) divided by Eq. (80) at \(t = 0.5, 1.0\) and 3.0 fm, respectively

The electric and magnetic four vectors are considered on the transverse plane and orthogonal to each other,

$$\begin{aligned}{} & {} e^\mu = (0,e^x,0,0),\nonumber \\{} & {} b^\mu = (0,0,b^y,0). \end{aligned}$$
(76)

In Ref. [34], electromagnetic fields are taken to be the following forms,

$$\begin{aligned}{} & {} e_x(\tau ,\eta _s) = - \frac{c(\eta _s)}{\tau }\sinh (Y-\eta _s), \end{aligned}$$
(77)
$$\begin{aligned}{} & {} b_y(\tau ,\eta _s) = \frac{c(\eta _s)}{\tau }\cosh (Y-\eta _s). \end{aligned}$$
(78)

The solutions for the rapidity and electromagnetic fields are given by,

$$\begin{aligned}{} & {} Y = \eta _s + \sinh ^{-1}\left( \frac{1}{\sigma \tau }\frac{\partial _{\eta _s}c(\eta _s)}{c(\eta _s)}\right) , \end{aligned}$$
(79)
$$\begin{aligned}{} & {} u^{\tau } = \sqrt{1+\left( \frac{1}{\sigma \tau }\frac{\partial _{\eta _s}c(\eta _s)}{c(\eta _s)}\right) ^2}, \end{aligned}$$
(80)
$$\begin{aligned}{} & {} u^{\eta _s} = \frac{1}{\sigma \tau ^2}\frac{\partial _{\eta _s}c(\eta _s)}{c(\eta _s)}, \end{aligned}$$
(81)
$$\begin{aligned}{} & {} e_x(\tau ,\eta _s) = \frac{1}{\sigma \tau ^2}\frac{\partial c(\eta _s)}{\partial \eta _s}, \end{aligned}$$
(82)
$$\begin{aligned}{} & {} b_y(\tau ,\eta _s) = \frac{c(\eta _s)}{\tau }\times \sqrt{1+\left( \frac{1}{\sigma \tau }\frac{\partial _{\eta _s}c(\eta _s)}{c(\eta _s)}\right) ^2}. \end{aligned}$$
(83)

Here \(c(\eta _s)\) is an arbitrary function. We suppose,

$$\begin{aligned} c(\eta _s) = c_0\cosh (\alpha \eta _s), \end{aligned}$$
(84)

which is the same as that in Ref. [34]. Here \(\alpha \) is an arbitrary constant. The arbitrary constant \(c_0\) is taken to be \(0.0018\tau _0\), which determines the initial magnetic field strength on the laboratory frame in the Minkowski coordinates \(B_L^y(\tau _0, 0) = 0.0018~\text {GeV}^2/e\).

The energy density is determined by solving the following equations,

$$\begin{aligned}{} & {} \partial _\tau e(\tau ,\eta _s) + \frac{1+\kappa }{\tau }A(\tau ,\eta _s)e(\tau ,\eta _s) = B(\tau ,\eta _s), \end{aligned}$$
(85)
$$\begin{aligned}{} & {} \partial _{\eta _s}e(\tau ,\eta _s)+H(\tau ,\eta _s)e(\tau ,\eta _s) = G(\tau ,\eta _s), \end{aligned}$$
(86)

where,

$$\begin{aligned}{} & {} A(\tau ,\eta _s) = \left( \frac{\partial _{\eta _s}Y({\bar{v}}-\kappa )-(\kappa -1)\tau {\bar{v}}\partial _\tau Y}{\kappa ({\bar{v}}^2-1)}\right) \nonumber \\ \end{aligned}$$
(87)
$$\begin{aligned}{} & {} B(\tau ,\eta _s) = \frac{\sigma (e_x b_y{\bar{v}}-\kappa e_x^2)}{\kappa {\bar{\gamma }}({\bar{v}}^2-1)},\nonumber \\ \end{aligned}$$
(88)
$$\begin{aligned}{} & {} H(\tau ,\eta _s) = \frac{1}{\kappa }((1{+}\kappa )(\tau \partial _\tau Y{+}{\bar{v}}\partial _{\eta _s}Y)){-}(1{+}\kappa ){\bar{v}}A(\tau ,\eta _s),\nonumber \\ \end{aligned}$$
(89)
$$\begin{aligned}{} & {} G(\tau ,\eta _s) = \frac{(\sigma \tau )e_x b_y}{{\bar{\gamma }}\kappa }-\tau {\bar{v}}B(\tau ,\eta _s).\nonumber \\ \end{aligned}$$
(90)

Here, we take the ideal gas EoS, \(p = \kappa e\) and \(\kappa = 1/3\). We numerically solve these differential equations on a grid of points on the (\(\tau ,\eta _s\)) plane. First, we give the arbitrary function \(c(\eta _s)\), which is assumed to have a form given in Eq. (84). Then the rapidity, four-velocity, and electromagnetic fields are obtained from Eqs. (79)–(83). The function \(A(\tau ,\eta _s)\), \(B(\tau ,\eta _s)\), \(H(\tau ,\eta _s)\), and \(G(\tau ,\eta _s)\) are determined from Eqs. (87)–(90). We solve Eq. (85) as an ordinary differential equation (ODE) to find out the \(\tau \)-dependence of the function e, keeping constant as the variable \(\eta _s\). Then, we solve Eq. (86) with the solution of Eq. (85) in each \(\tau \) as an initial condition of the ODE. The energy density is obtained as numerical solutions of two ODEs with the initial value of the \(e(\tau _0,0) = e_0\).

Fig. 17
figure 17

We display a the magnetic field component \(b^y\) and b the electric field component measured in the comoving frame \(e^x\), respectively. The blue solid, red long dashed-dotted and black dashed lines show the numerical results at \(t = 0.5, 1.0\), and 3 fm, respectively. The blue, red, and black dotted lines show the semi-analytic solutions of the a Eq. (83) and b Eq. (82) at \(t = 0.5, 1.0\) and 3.0 fm, respectively

Here, we perform the RRMHD simulation using the numerical solution of the above ODEs as the initial condition. Since the resistive effect is prominent with small \(\alpha \) [34], we take the initial energy density \(e_0=1.0~\text {GeV}/\text {fm}^3\), \(\alpha = 0.1\), and the electrical conductivity \(\sigma = 0.023~\text {fm}^{-1}\). The number of grid points in the computational domain \(\eta _s \in [-3.0,3.0]\) is \(N = 200\). We adopt free boundary conditions at \(\eta _s = \pm 3.0\). The waves are, however, sometimes reflected at the boundaries and they affect the numerical results. To avoid this, we take the boundaries far away from the central region \(\eta _s \in [-1.0,1.0]\) and stop the calculation before the reflected waves reach the central region.

Figures 16 and 17 show the results of our simulation code in comparison with the semi-analytic solution. Our results are in good agreement with the semi-analytic solutions. In Fig. 16a, the energy density decays and expands to the longitudinal direction by the resistive effects. In Fig. 16b, the fluid velocity in the Milne coordinates has a finite value in the forward and backward rapidity regions and it decays with time. This feature comes from the resistive effect described in Eq. (81). Our results reproduce this behavior of the fluid. In Fig. 17a, the magnetic field component in the comoving frame \(b^y\) as a function of \(\eta _s\) is represented. The magnetic field decays with time by the longitudinal expansion similar to the magnetic Bjorken flow in Sect. 4.6. However, the magnetic field has a non-uniform profile in the \(\eta _s\) direction by the acceleration induced from the resistive effect, which is different from the magnetic Bjorken flow. Figure 17b shows the electric field component measured in the coming frame \(e^x\) as a function of \(\eta _s\). The electric field has a positive value in the backward rapidity region and it decreases with rapidity. The electric field changes its sign at \(\eta _s = 0\). This feature describes that the electric field is produced by the two colliding nuclei in high-energy heavy-ion collisions. Our results capture these features and its diffusion which is consistent with the semi-analytic solutions.

Figure 18 represents the electrical conductivity dependence of \(u^{\eta _s}/u^\tau \) at \(\tau = 1\) fm. The blue, red, and black dotted lines show the semi-analytic solutions given Eqs. (80) and (81) in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\), respectively. All our numerical results are in good agreement with the semi-analytic solutions. The magnitude of \(u^{\eta _s}/u^\tau \) in forward and backward rapidity regions decreases with increasing \(\sigma \). This means that the case of higher conductivity is close to the magnetized Bjorken flow explained in Sect. 4.6. In fact, if we take the limit of infinite electrical conductivity, Eq. (81) becomes zero, which is consistent with magnetized Bjorken flow.

Fig. 18
figure 18

The electrical conductivity dependence of the fluid velocity component \(v^\eta \) at \(\tau = 1.0\) fm. The blue solid, red long dashed-dotted and black dashed lines show the numerical results in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\) fm, respectively. The blue, red, and black dotted lines show the semi-analytic solutions given by Eqs. (80) and (81) in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\), respectively

Fig. 19
figure 19

The electrical conductivity dependence of the electric field component measured in the comoving frame \(e^x\) at \(\tau = 1.0\) fm. The blue solid, red long dashed-dotted and black dashed lines show the numerical results in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\), respectively. The blue, red, and black dotted lines show the semi-analytic solutions of the Eq. (82) in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\), respectively

Figure 19 shows the electrical conductivity dependence of \(e^x\) at \(\tau = 1\) fm. The blue, red, and black dotted lines show the semi-analytic solutions of the Eq. (82) in the cases of \(\sigma = 0.023, 0.033\) and 0.043 fm\(^{-1}\), respectively. The electrical conductivity dependence of \(e^x\) in our results is in good agreement with the semi-analytic solutions of Eq. (82). The magnitude of the electric field in forward and backward rapidity regions decreases with \(\sigma \). This is consistent with the ideal limit of RRMHD. In the relativistic ideal MHD, the electric field measured in the comoving frame of fluid vanishes. Our numerical results capture this feature of ideal limit of RRMHD.

5 Summary and discussion

We constructed a new RRMHD simulation code in the Milne coordinates which is suitable for study on high-energy heavy-ion collisions. We split the system of RRMHD equations into two parts, a non-stiff and a stiff part. The primitive variables are interpolated from the cell center to the cell surface by using the second-order accurate scheme [36]. For the non-stiff part, we evaluated the numerical flux using the HLL approximated Riemann solver and explicitly integrated the equations in time by the second-order of Runge–Kutta algorithm [39]. For the stiff part appeared in Ampere’s law, we executed time integration using semi-analytic solutions to avoid unexpected small time steps. Though Maxwell equations ensure that the divergence-free constraints are satisfied at all times, in numerical simulation, the integration of Maxwell equations in a not well-designed scheme does not preserve these conditions because of the numerical error. In order to avoid this problem, we employed the generalized Lagrange multiplier method to guarantee these conditions [23, 26, 28].

We checked the correctness of our algorithm from the comparison between numerical calculations and analytical solutions or the other RMHD simulations such as Brio–Wu type shock tubes, propagation of the large amplitude circularly polarized Alfv́en waves, self-similar current sheet, cylindrical explosion, resistive rotor, and Bjorken flow. In these test problems, our numerical solutions were in good agreement with analytic solutions or results of the other RRMHD simulations. Furthermore, we investigated the accelerating longitudinal expansion of relativistic resistive magneto-hydrodynamics in high-energy heavy-ion collisions in comparison with semi-analytic solutions [34]. Our numerical code reproduced these solutions. We conclude that our numerical simulations capture the characteristic features of dynamics in high-energy heavy-ion collisions.

We shall employ our RRMHD code to investigate experimental data at RHIC and the LHC and understand the detailed QGP bulk property such as electrical conductivity. As the first application, we have demonstrated calculation of the directed flow in RRMHD expansion in Au-Au and Cu-Au collision systems at RHIC [48]. We found that electrical conductivity prevents the growth of the directed flow in asymmetric systems. The Ohmic conduction current may affect the charge-dependent flow of hadrons. Recently, the charge-dependent directed flow of the heavy mesons and dileptons has been proposed as a signature of the electromagnetic fields [49, 50]. It can extract the initial electromagnetic fields and the QGP bulk properties from experimental results.

The highly intense electromagnetic fields induce novel quantum phenomena such as the chiral magnetic effect (CME) [51, 52] and the chiral magnetic wave (CMW) [53]. The CME and CMW signals in experimental data have been explored in iso-bar collisions, Zr-Zr and Ru-Ru collisions at RHIC [54, 55]. However, there are no striking evidences of these phenomena in the iso-bar experiments. For analytical studies, the initial condition of electromagnetic fields with CME in high-energy heavy-ion collisions has been studied [56, 57], but the evolution of these fields has not been well understood. The recent development of numerical simulation for the chiral RMHD has been investigated [58]. The comprehensive studies using RRMHD would shed light on these problems. This issue remains an important future work.