Open Access
Issue
A&A
Volume 701, September 2025
Article Number A71
Number of page(s) 22
Section Stellar structure and evolution
DOI https://doi.org/10.1051/0004-6361/202554539
Published online 04 September 2025

© The Authors 2025

Licence Creative CommonsOpen Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

This article is published in open access under the Subscribe to Open model. Subscribe to A&A to support open access publication.

1. Introduction

Neutron stars (NSs) are categorized into different classes (e.g., magnetars, rotation-powered pulsars, rotating radio transients, isolated thermal emitters) based on their observable properties (Ascenzi et al. 2024a). Efforts toward a “grand unification” (Kaspi 2010) of their vast observational phenomena have suggested that the magnetic field serves as a unifying factor (Harding 2013; Viganò et al. 2013). Consequently, the evolution of their magnetic field continues to be a relevant and active area of research. (For a recent review, see Igoshev et al. 2021.)

The current picture of magnetic field evolution in the fluid cores of NSs is as follows: Minutes after their formation, the charged particles in their interior (mostly protons, p; electrons, e; and muons, μ), which feel the magnetic force, are strongly coupled to each other and to neutrons, n, by collisions, and the particles essentially behave as a single fluid. However, their joint motion, which is driven by the magnetic force, is strongly hindered by fluid forces (pressure and gravity) that arise from stable stratification (Pethick 1992; Reisenegger & Goldreich 1992; Goldreich & Reisenegger 1992).

During this stage, sound and Alfvén waves propagate and are eventually damped, allowing the star to (very quickly) settle into a state of hydromagnetic quasi-equilibrium. The nature of such equilibria has been extensively studied in the literature, yielding geometries that vary from ordered axisymmetric “twisted-torus” configurations with poloidal and toroidal components that stabilize each other (Braithwaite & Spruit 2004, 2006; Braithwaite & Nordlund 2006) to disordered non-axisymmetric equilibrium magnetic fields (Braithwaite 2008; Becerra et al. 2022a), depending on the initial radial distribution of magnetic energy in the star (Braithwaite 2008) and the main energy dissipation mechanism invoked, namely, viscosity versus magnetic diffusivity (Becerra et al. 2022a).

While the star cools, a crust is formed; thus, the magnetic evolution continues in two different regions, a solid crust and a fluid core, with the transition between them occurring at approximately half of the nuclear saturation density. As discussed by Goldreich & Reisenegger (1992), the two long-term mechanisms that promote the evolution of the field in the crust are Ohmic diffusion (a dissipative effect due to electron-ion collisions) and Hall drift (non-dissipative advection of the magnetic field by the electrical current). The evolution of the magnetic field in this region, its effect on thermal evolution, and its potential impact on observations have been extensively studied in the literature (see, for instance, Hollerbach & Rüdiger 2002; Pons & Geppert 2007; Pons et al. 2009; Viganò et al. 2012; Gourgouliatos & Cumming 2014b; Viganò et al. 2013; Gourgouliatos & Cumming 2014a; Marchant et al. 2014; Lander & Gourgouliatos 2019; Viganò et al. 2021). Recent efforts have even involved full three-dimensional simulations (Wood & Hollerbach 2015; Dehman et al. 2023; Ascenzi et al. 2024b).

The core, on the other hand, follows a different picture. Young NSs have high temperatures, which in principle allow the core matter to overcome stable stratification while still moving as a single fluid strongly coupled by collisions. At such temperatures, the chemical imbalances due to the magnetic force are continuously reduced by weak interaction processes (Urca reactions). This erodes the initial quasi-equilibrium state, allowing the magnetic field and particles to move through a continuous sequence of quasi-equilibrium states as the chemical imbalances are reduced (Reisenegger et al. 2005; Reisenegger 2009; Ofengeim & Gusakov 2018). However, this so-called strong-coupling regime is short-lived. The star passively cools down due to Urca reactions that are faster than reheating from the feedback caused by the magnetic evolution (even for magnetar-strength fields), quickly rendering Urca reactions inefficient at restoring chemical equilibrium. Moreover, the timescale of magnetic field evolution increases very quickly as the temperature decreases (tB ∝ T−6); thus, the magnetic field is found to evolve very little at this stage (Moraga et al. 2024). As noted by Moraga et al. (2024), the latter implies that the kind of barotropic equilibrium configurations often used in the literature as initial configurations for proto-NSs (e.g., Thompson & Duncan 1996; Lander et al. 2021), which are solutions of the “Grad-Shafranov” (GS) equation (see Sect. 7.1 for details), cannot be reached in this early stage of evolution. However, as shown by Castillo et al. (2017, 2020), GS equilibrium configurations are expected to appear at later times in the so-called weak-coupling regime, which we discuss next.

As the star cools further, the collisional coupling between charged particles and neutrons is reduced, allowing for a motion of charged particles relative to neutrons in a dissipative process called ambipolar diffusion (Pethick 1992; Goldreich & Reisenegger 1992). The velocity of this relative motion is proportional to the imbalance between the magnetic force and the charged particle fluid forces it induces, and it is also inversely proportional to the collision rate between charged particles and neutrons. Such motion erodes the initial hydromagnetic quasi-equilibrium, promoting the evolution of the magnetic field and fluid forces as they continually readjust and move through a continuum of successive quasi-equilibria. In Castillo et al. (2020), we report two-fluid numerical simulations of ambipolar diffusion considering a core of normal (non-Cooper-paired) npe matter in axial symmetry. We showed that as ambipolar diffusion acts, the fluid forces due to neutrons and charged particles adjust, with the former going to zero and the latter eventually fully balancing the magnetic force. Thus, an equilibrium is reached that can only be very slowly eroded by the combination of Hall drift and Ohmic dissipation. Since charged particles are fully decoupled from neutrons, this corresponds to a single-fluid barotropic equilibrium configuration, which is a solution of the GS equation.

Ambipolar diffusion is arguably the main effect promoting the magnetic field evolution in the core (in that region, it is certainly more effective than Hall drift and Ohmic decay, as conductivity is much higher). Consequently, it has been proposed as a plausible alternative mechanism explaining the weak magnetic fields of millisecond pulsars (Cruces et al. 2019). It is also sometimes invoked to explain the activity of magnetars, as it strongly depends on the magnetic field strength (Thompson & Duncan 1995, 1996; Mereghetti 2008; Beloborodov & Li 2016; Tsuruta et al. 2023), although recent evidence suggests that it is difficult for it to account for the high thermal luminosity of some of these stars, unless their internal magnetic field is extremely strong (Moraga et al. 2025). Thus, its impact on the long-term evolution of the field is a matter of interest.

The method to self-consistently solve the relevant equations for npe matter (see Sect. 2) was introduced by Gusakov et al. (2017) and later refined by Ofengeim & Gusakov (2018). The latter authors presented a detailed scheme to semi-analytically solve the relevant system of equations for a given initial magnetic field configuration and demonstrated that, in general, the bulk motion of the particle fluids can be much larger than the relative velocity between species. This finding was confirmed by the numerical simulations of the magnetic field evolution presented in Castillo et al. (2020). Taking this into account makes the evolution significantly faster than previously estimated (e.g., Goldreich & Reisenegger 1992; Thompson & Duncan 1995; Beloborodov & Li 2016; Castillo et al. 2017; Passamonti et al. 2017).

The semi-analytical scheme proposed by Gusakov et al. (2017) and Ofengeim & Gusakov (2018), while useful to calculate the velocities and chemical potential perturbations induced by an analytically given magnetic field, has limited applicability in long-term numerical simulations, as the latter involve iterating over magnetic field data stored in tables, and these data are not given as explicit analytical expressions. The authors mention that using magnetic field configurations in the form of tables in their scheme produces unreliable results; this limitation is attributed to the high number of spatial derivatives involved in the calculation (see Sect. 2), which yield numerical errors that accumulate if iterated over time (private communication).

Alternatively, in Castillo et al. (2020), we followed a different approach. Instead of directly solving the relevant equations, we introduced a fictitious friction (FF) force acting on the neutrons. The FF approach can be regarded as a numerical trick that greatly simplifies the numerical calculation of the relevant velocities and yields a very good approximation of the solution of the relevant equations (see a detailed discussion in Sect. 4). This approach allowed us to report the first two-fluid axially symmetric numerical simulations of ambipolar diffusion, correctly capturing the bulk motion of neutrons and charged particles, which cannot be done with the one-fluid approximation usually found in the literature (e.g., Goldreich & Reisenegger 1992; Castillo et al. 2017; Igoshev et al. 2023). While definitely a step forward, that work has some features that may not be entirely convincing to some readers:

  1. The approach used involved two timescales that are very different for realistic magnetic fields. To capture both in the simulations, we had to consider unrealistically high values of the magnetic field (≳1017G).

  2. The FF approach is conceptually not trivial, and at first glance, it is not evident that it yields the correct velocity fields.

  3. The toy model equation of state (EoS) used (see Sect. 5) correctly captured the qualitative impact of stable stratification on the long-term magnetic evolution. However, the question of whether considering more realistic models would significantly affect the reported results remains.

In this paper, we compare different methods to solving the relevant equations, including the FF approach and semi-analytical approaches based on the explicit scheme of Gusakov et al. (2017) and Ofengeim & Gusakov (2018) as well as a pseudo-spectral method. Moreover, we present the results of an updated version of the code used in Castillo et al. (2020) that addresses the issues in items 1 and 3 of the above list, and we present arguments to convince the reader about the correctness and applicability of the FF approach (thus addressing item 2 in the same list).

This paper is organized as follows. In Sect. 2, we discuss the physical model and construct the equations to be solved in axial symmetry. In Sect. 3 and Sect. 4, we describe different approaches to obtaining the relevant velocities and chemical potential perturbations. In Sect. 5 and Sect. 6, we present the different stellar and magnetic field models used in this work. In Sect. 7, we describe the relevant equations for the magnetic field evolution, discuss the relevant timescales, and outline the mechanisms that promote the dissipation of the magnetic field. Our results are presented in Sect. 8, where we compare the different approaches to obtain the neutron velocity and use the FF approach to perform long-term time-evolving simulations. We check if the simulations are in agreement with the expected timescales and final equilibrium configurations. Finally, in Sect. 9, our results are summarized and our conclusions are outlined.

2. Physical model

Following the discussion of Castillo et al. (2020), we model the NS core as a fluid composed of normal (not superfluid or superconducting) neutrons, protons, and electrons, in axial symmetry. In the absence of a magnetic field, these are in a spherically symmetric hydrostatic and chemical equilibrium, having number densities, ni(r), and chemical potentials, μi(r) (i = n, p, e), respectively. Note that charge neutrality implies nc ≡ np = ne, and chemical equilibrium implies μ ≡ μn = μp + μe.

For strong enough magnetic fields, the relative velocity of protons and electrons (related to the electric current density) is much smaller than their bulk velocity (Ofengeim & Gusakov 2018). Therefore, all charged particles are assumed to move together with velocity vc, carrying along the magnetic flux according to Faraday’s law,

B t = × ( v c × B ) . $$ \begin{aligned} \frac{\partial \boldsymbol{B}}{\partial t}=\boldsymbol{\nabla }\times (\boldsymbol{v}_c\times \boldsymbol{B}). \end{aligned} $$(1)

In contrast, the neutrons are allowed to move with a different velocity, vn. The main challenge in simulating this process is obtaining the velocity fields vc and vn at each time step.

In the presence of a magnetic field, B, the magnetic force causes small perturbations to the number densities of neutrons, δnn, and charged particles, δnc ≡ δnp = δne, which evolve following the continuity equations

δ n n t + · ( n n v n ) = λ Δ μ , $$ \begin{aligned} \frac{\partial \delta n_n}{\partial t} + \boldsymbol{\nabla }\cdot \left(n_n\boldsymbol{v}_n\right)&= \lambda \Delta \mu ,\end{aligned} $$(2)

δ n c t + · ( n c v c ) = λ Δ μ . $$ \begin{aligned} \frac{\partial \delta n_c}{\partial t} + \boldsymbol{\nabla }\cdot \left(n_c\boldsymbol{v}_c\right)&= -\lambda \Delta \mu . \end{aligned} $$(3)

Here, λ is a temperature-dependent parameter; Δμ ≡ δμc − δμn; δμc ≡ δμp + δμe; and δμn, δμp, and δμe are the chemical potential perturbations of the neutrons, protons, and electrons, respectively. The terms on the right-hand side of the equations represent the net rates per unit volume at which weak interactions convert protons and electrons into neutrons, and vice versa; assuming |Δμ|≪kBT, where kB is the Boltzmann constant and T is the absolute temperature (Goldreich & Reisenegger 1992). In what follows, we focus on the low-temperature, “weak-coupling” regime, where λ ≈ 0. Chemical potential perturbations are related to the number density perturbations, δnn, and δnc, by

δ μ n = K nn δ n n + K nc δ n c , $$ \begin{aligned} \delta \mu _n = K_{nn}\delta n_n + K_{nc}\delta n_c ,\end{aligned} $$(4)

δ μ c = K cn δ n n + K cc δ n c , $$ \begin{aligned} \delta \mu _c = K_{cn}\delta n_n + K_{cc}\delta n_c , \end{aligned} $$(5)

where Kij ≡ ∂μi/∂nj (i, j = c, n). The off-diagonal element K ≡ Knc = Kcn accounts for strong interactions between protons and neutrons.

For any realistic magnetic field, the evolution timescale of such perturbations will be many orders of magnitude shorter than the magnetic evolution timescale. Therefore, in time-evolving simulations, resolving the time-evolution timescale of the density perturbations and magnetic field for a realistic magnetic field strength is computationally prohibitive. However, as shown by Gusakov et al. (2017), the time derivatives in the continuity Eqs. (2), and (3) can be safely neglected in the study of the long-term evolution, as the density perturbation of charged particles and neutrons will almost instantaneously adjust to the current configuration of the magnetic field. Thus, we reduced the continuity equations to

· ( n n v n ) = 0 , $$ \begin{aligned} \boldsymbol{\nabla }\cdot \left(n_n\boldsymbol{v}_n\right)&= 0,\end{aligned} $$(6)

· ( n c v c ) = 0 . $$ \begin{aligned} \boldsymbol{\nabla }\cdot \left(n_c\boldsymbol{v}_c\right)&= 0 . \end{aligned} $$(7)

Each particle species feels fluid forces due to their weight and degeneracy pressure gradient. Namely, the fluid forces on the neutrons and charged particles are, respectively, fi = −niδμi − ni(δμi/c2)Φ, for i = n, c; where Φ(r) is the gravitational potential. We note that the unperturbed star is in hydrostatic equilibrium, satisfying

μ + μ Φ / c 2 = 0 . $$ \begin{aligned} \boldsymbol{\nabla }\mu +\mu \boldsymbol{\nabla }\Phi /c^2=0 . \end{aligned} $$(8)

Thus, by the introduction of the relative chemical potential perturbations, χi = δμi/μ (i = n, c), fluid forces can be rewritten in a more compact form:

f n = n n μ χ n , $$ \begin{aligned} \boldsymbol{f}_{n}&=-n_n\mu \boldsymbol{\nabla }\chi _n ,\end{aligned} $$(9)

f c = n c μ χ c . $$ \begin{aligned} \boldsymbol{f}_{c}&=-n_c\mu \boldsymbol{\nabla }\chi _c . \end{aligned} $$(10)

Charged particles also feel the Lorentz force,

f B = ( × B ) × B 4 π . $$ \begin{aligned} \boldsymbol{f}_{B}=\frac{(\boldsymbol{\nabla }\times \boldsymbol{B})\times \boldsymbol{B}}{4\pi } . \end{aligned} $$(11)

An underlying assumption is that the star very quickly reaches a state of hydromagnetic quasi-equilibrium in which all the forces acting on a fluid element are close to balance, yielding

f B n n μ χ n n c μ χ c = 0 . $$ \begin{aligned} \boldsymbol{f}_{B}-n_n\mu \boldsymbol{\nabla }\chi _n-n_c\mu \boldsymbol{\nabla }\chi _c=0. \end{aligned} $$(12)

Consequently, in the long term, the magnetic field evolves moving through a continuum of successive hydromagnetic quasi-equilibria. In axial symmetry, the gradients, χi, cannot have a toroidal component; therefore, Eq. (12) imposes a strong constraint on the magnetic field that must satisfy fB, ϕ = 0.

The relative velocity of the charged particles with respect to the neutrons is the so-called ambipolar velocity, which is obtained from the force balance on the charged particles as

v ad v c v n = f B n c μ χ c γ cn n c n n . $$ \begin{aligned} \boldsymbol{v}_{ad}\equiv \boldsymbol{v}_c-\boldsymbol{v}_n = \frac{\boldsymbol{f}_{B}-n_c\mu \boldsymbol{\nabla }\chi _c}{\gamma _{cn}n_c n_n} .\\ \end{aligned} $$(13)

Here, γcn parametrizes the collision rate between charged particles and neutrons.

Fluid forces are written in terms of gradients of the chemical potential perturbations (see Eqs. (9) and (10)). Thus, there are additive constants in χn and χc that do not play a role in the evaluation of the velocities. If needed, these can be fixed using integral conditions corresponding to the conservation of charged particles and neutrons, i.e.,

V core δ n n d V = V core μ K cc χ n K χ c K nn K cc K 2 d V = 0 , $$ \begin{aligned} \int _{\mathcal{V} _\text{ core}}\delta n_n \,d\mathcal{V}&= \int _{\mathcal{V} _\text{ core}} \mu \frac{K_{cc}\chi _n-K\chi _c}{K_{nn}K_{cc}-K^2} \,d\mathcal{V} = 0,\end{aligned} $$(14)

V core δ n c d V = V core μ K nn χ c K χ n K nn K cc K 2 d V = 0 , $$ \begin{aligned} \int _{\mathcal{V} _\text{ core}}\delta n_c \,d\mathcal{V}&= \int _{\mathcal{V} _\text{ core}} \mu \frac{K_{nn}\chi _c-K\chi _n}{K_{nn}K_{cc}-K^2} \,d\mathcal{V} = 0 , \end{aligned} $$(15)

where the density perturbations are obtained inverting Eqs. (4) and (5), and 𝒱core is the volume of the core.

As stated before, we restricted ourselves to axial symmetry so the magnetic field could be decomposed as

B = α × ϕ + β ϕ . $$ \begin{aligned} \boldsymbol{B}=\boldsymbol{\nabla }\alpha \times \boldsymbol{\nabla }\phi + \beta \boldsymbol{\nabla }\phi . \end{aligned} $$(16)

The scalar potentials, α(r, θ), and β(r, θ), generate the poloidal and toroidal magnetic field, respectively, and ϕ = ϕ ̂ / ( r sin θ ) $ \boldsymbol{\nabla}\phi=\hat{\phi}/(r\sin\theta) $.

At each time step, the Lorentz force, fB, is known, but the velocity fields, vi, and the scalar fields, χi, for i = n, c must be obtained from the self-consistent solution of Eqs. (6), (7), (12), and (13). Different approaches to this challenge are discussed in Sect. 3. To perform numerical calculations using such approaches, the equations must be normalized appropriately. The units in which the different variables are measured are given in Table 1.

Table 1.

Normalization of the relevant variables.

Table 2.

Stellar parameters for the five different EoSs studied.

3. Semi-analytical approaches

3.1. Explicit approach

The set of Eqs. (6), (7), (12), and (13) can be solved for an analytically given magnetic field configuration in axial symmetry for which fB, ϕ = 0. A semi-analytical procedure to solve the set of equations was described by Gusakov et al. (2017) and more in depth by Ofengeim & Gusakov (2018). Their steps to obtain the poloidal component of the velocities and chemical potential perturbations are summarized here, adopting the notation and approximations used in the present paper.

The poloidal part of Eq. (12) implies scalar equations for the radial and polar components, respectively. For a given magnetic force, fB, these equations fix χn and χc up to a radial function for each, which can be fixed by taking the appropriate boundary conditions. However, these conditions are not trivial and must be set for vn. To proceed, we split the relative chemical imbalances into two components: χn(r, θ) = Xn(r, θ)+χn, 0(r), and χc(r, θ) = Xc(r, θ)+χc, 0(r), where χ n , 0 = P ̂ 0 { χ n } $ \chi_{n,0}=\hat{\mathrm{P}}_{0}\{\chi_{n}\} $ and χ c , 0 = P ̂ 0 { χ c } $ \chi_{c,0}=\hat{\mathrm{P}}_{0}\{\chi_{c}\} $. Here, we introduced the operator P ̂ l $ \hat{\mathrm{P}}_{l} $ that extracts the coefficient of the lth Legendre component of its argument,

P ̂ l { f ( r , θ ) } 2 l + 1 2 0 π f ( r , θ ) P l ( cos θ ) sin θ d θ , $$ \begin{aligned} \hat{\mathrm{P} }_{l} \{f(r,\theta )\} \equiv \dfrac{2l+1}{2}\int ^{\pi }_{0}\, f(r,\theta ) \,P_{l}(\cos \theta ) \sin \theta d\theta , \end{aligned} $$(17)

where f(r, θ) is a given function of r and θ, and Pl(cos θ) is a Legendre polynomial of degree l. The relation between these radial functions can be obtained by taking the radial component of Eq. (12) and projecting its 0th Legendre component

P ̂ 0 { f B , r } n c μ χ c , 0 n n μ χ n , 0 = 0 , $$ \begin{aligned} \hat{\mathrm{P} }_{0}\{f_{B,r}\} - n_c\mu \,\chi _{c,0}^{\prime } - n_n\mu \,\chi _{n,0}^{\prime } = 0 , \end{aligned} $$(18)

where prime (′) denotes derivative with respect to r. Replacing the decomposition of χc and χn into Eq. (12) together with the latter equation yields

F B n n X n n c X c = 0 , $$ \begin{aligned} \boldsymbol{F}_{B}-n_n\boldsymbol{\nabla } X_n-n_c\boldsymbol{\nabla } X_c=0, \\ \end{aligned} $$(19)

where F B ( f B P ̂ 0 { f B , r } r ̂ ) / μ $ \boldsymbol{F}_{B}\equiv(\boldsymbol{f}_{B}-\hat{\mathrm{P}}_{0}\{f_{B,r}\}\hat r)/\mu $, and r ̂ $ \hat r $ is the radial unit vector. We note that by defining ϵ ≡ nnXn + ncXc and δ ≡ nnXn + ncXc, Eq. (19) can be rewritten as ϵ δ r ̂ = F B $ \boldsymbol{\nabla}\epsilon-\delta\hat r=\boldsymbol{F}_{B} $. The solution for ϵ and δ can be easily obtained by first integrating its polar component with respect to θ. Thus,

ϵ ( r , θ ) = 0 θ r F B , θ d θ + ϵ ( r , 0 ) , $$ \begin{aligned} \epsilon (r,\theta )&=\int _{0}^\theta \,rF_{B,\theta }\,d\theta + \epsilon (r,0) , \end{aligned} $$(20)

δ ( r , θ ) = ϵ r F B , r , $$ \begin{aligned} \delta (r,\theta )&=\frac{\partial \epsilon }{\partial r}-F_{B,r} , \end{aligned} $$(21)

where the latter comes from the radial component and ϵ ( r , 0 ) = P ̂ 0 { 0 θ r F B , θ d θ } $ \epsilon(r,0) = - \hat{\mathrm{P}}_{0}\{\int_{0}^\theta \,rF_{B,\theta}\,d\theta\} $ is chosen so P ̂ 0 { ϵ } = 0 $ \hat{\mathrm{P}}_{0}\{\epsilon\} = 0 $. In terms of these variables, we can reconstruct

X n = n c ϵ n c δ n n 2 ( n c / n n ) , $$ \begin{aligned} X_n&= \frac{n_c^{\prime }\epsilon -n_c\delta }{n_n^2(n_c/n_n)^{\prime }} , \end{aligned} $$(22)

X c = n n ϵ n n δ n n 2 ( n c / n n ) , $$ \begin{aligned} X_c&= -\frac{n_n^{\prime }\epsilon -n_n\delta }{n_n^2(n_c/n_n)^{\prime }} , \end{aligned} $$(23)

which also satisfy P ̂ 0 { X n } = P ̂ 0 { X c } = 0 $ \hat{\mathrm{P}}_{0}\{X_n\}=\hat{\mathrm{P}}_{0}\{X_c\} = 0 $.

To fully determine χn and χc, we also needed to evaluate χn, 0 and χc, 0. We note that by integrating Eq. (6) over the volume, 𝒱(r), of any centered sphere of radius, r, we obtained

0 = V ( r ) · ( n n v n ) d V = 2 π r 2 n n 0 π v n , r ( r , θ ) sin θ d θ , $$ \begin{aligned} 0=\int _{\mathcal{V} (r)} \boldsymbol{\nabla }\cdot \left(n_n\boldsymbol{v}_n\right)\,d\mathcal{V} =2\pi r^2 n_n\int _0^\pi v_{n,r}(r,\theta ) \sin \theta \,d\theta , \end{aligned} $$(24)

implying P ̂ 0 { v n , r } = 0 $ \hat{\mathrm{P}}_{0}\{v_{n,r}\} = 0 $. Analogously, from Eq. (7) we obtained P ̂ 0 { v c , r } = 0 $ \hat{\mathrm{P}}_{0}\{v_{c,r}\} = 0 $, and thus also P ̂ 0 { v a d , r } = 0 $ \hat{\mathrm{P}}_{0}\{v_{ad,r}\} = 0 $. On the other hand, replacing Eq. (12) and χn = Xn + χn, 0 into Eq. (13) would yield

n c v ad = μ γ cn ( X n + χ n , 0 r ̂ ) . $$ \begin{aligned} n_c\boldsymbol{v}_{ad}=\frac{\mu }{\gamma _{cn}}\left(\boldsymbol{\nabla }X_n+\chi _{n,0}^{\prime }\hat{r}\right) .\\ \end{aligned} $$(25)

Taking the radial component of the latter and projecting its 0th Legendre component implies

χ n , 0 = 0 . $$ \begin{aligned} \chi _{n,0}^{\prime }=0. \end{aligned} $$(26)

This, together with Eq. (18), implies

χ c , 0 = P ̂ 0 { f B , r } n c μ . $$ \begin{aligned} \chi _{c,0}^{\prime }=\frac{\hat{\mathrm{P} }_{0}\{f_{B,r}\}}{n_c\mu }. \end{aligned} $$(27)

These conditions define χn, 0 and χc, 0 from fB, r up to additive constants that do not affect the calculation of the velocities. If needed, they can be fixed using Eqs. (14) and (15).

Finally, the velocities can be obtained as follows: vad, which is purely poloidal, can be obtained from Eqs. (25) and (26),

v ad = μ X n n c γ cn , $$ \begin{aligned} \boldsymbol{v}_{ad}=\frac{\mu \boldsymbol{\nabla }X_n}{n_c\gamma _{cn}} ,\\ \end{aligned} $$(28)

whereas vn follows by writing vc = vn + vad and replacing Eq. (28) into Eq. (7), which implies

· ( n c v n ) + · ( μ γ cn X n ) = 0 . $$ \begin{aligned} \boldsymbol{\nabla }\cdot \left(n_c\boldsymbol{v}_n\right) + \boldsymbol{\nabla }\cdot \left(\frac{\mu }{\gamma _{cn}}\boldsymbol{\nabla } X_n \right) = 0 . \end{aligned} $$(29)

By multiplying Eq. (6) by nc, Eq. (29) by nn, and then subtracting them, we obtained, after some algebra,

v n , r = 1 n n ( n c / n n ) · ( μ γ cn X n ) . $$ \begin{aligned} v_{n,r}=-\frac{1}{n_n(n_c/n_n)^{\prime }}\boldsymbol{\nabla }\cdot \left(\frac{\mu }{\gamma _{cn}}\boldsymbol{\nabla } X_n \right) .\\ \end{aligned} $$(30)

The polar component can be obtained from Eq. (6)

v n , θ = 1 r sin θ n n r ( r 2 n n 0 θ v n , r sin θ d θ ) , $$ \begin{aligned} v_{n,\theta }=-\frac{1}{r\sin \theta \, n_n}\frac{\partial }{\partial r}\left( r^2 n_n\int _0^\theta v_{n,r}\sin \theta \,d\theta \right) , \end{aligned} $$(31)

where the limits of the integral are chosen to be consistent with conditions arising from axial symmetry, i.e., vn, θ(r, 0) = vn, θ(r, π) = 0.

On the other hand, the toroidal magnetic force must remain null (∂fB, ϕ/∂t = 0), which imposes a quite complicated condition that can, in principle, be used to obtain vn, ϕ (see Ofengeim & Gusakov 2018). So far, no feasible numerical implementation to obtain vn, ϕ for an arbitrary magnetic field configuration has been proposed.

In summary, the steps to obtain the poloidal components of vn and vc for an analytically given magnetic field satisfying fB, ϕ = 0 are

  1. Evaluate ϵ and δ from the magnetic force using Eqs. (20) and (21).

  2. Evaluate Xn from Eq. (22).

  3. Evaluate vad from Eq. (28).

  4. Evaluate vn, r and vn, θ from Eqs. (30) and (31), respectively.

  5. Evaluate vc, Pol = vn, Pol + vad, Pol,

where the subscript “Pol” refers to the poloidal part of a vector field, v n , Pol = v n , r r ̂ + v n , θ θ ̂ $ \boldsymbol{v}_{n\text{, Pol}}=v_{n,r}\hat r + v_{n,\theta}\hat \theta $.

We note that this procedure completely defines the velocity fields everywhere in the NS core, leaving no room for imposing boundary conditions at the crust-core interface. Thus, any such conditions, for example no flux of particles through the interface (vn, r(r = R) = vc, r(r = R) = 0), would require constraining the magnetic field (Ofengeim & Gusakov 2018), and it is unclear whether these constraints will be maintained as the magnetic field evolves in time.

In Sect. 8.1, we show plots of the velocities, which are computed using the procedure described above. All steps are evaluated using Wolfram Mathematica1 software, which produces involved symbolic expressions for the velocities and chemical potential perturbations in terms of the coordinates r, θ, the magnetic force, the functions nc(r),nn(r),μ(r),γcn(r), and their radial derivatives. The latter background functions are evaluated from numerical data computed from the EoS.

3.2. Pseudo-spectral approach

In addition to the semi-analytical procedure outlined in Sect. 3.1, the system of Eqs. (6), (7), (12), and (13) can be solved using a pseudo-spectral approach. An optimal implementation of such an algorithm requires rewriting some of the previous equations in a spectral-friendly manner.

Spectral codes expand scalar and vector fields using polynomial bases for the radial and angular domains within a spherical region. The angular component is typically expanded in spherical harmonics as they satisfy the regularity conditions along the axis. In axial symmetry, these reduce to the Legendre polynomials Pl(cos θ). Consequently, the chemical perturbationsread as

χ i ( r , θ ) = l = 0 n θ χ i , l ( r ) P l ( cos θ ) , ( i = n , c ) , $$ \begin{aligned} \chi _{i}(r,\theta ) = \sum _{l = 0}^{n_{\theta }} \chi _{i,l}(r)P_{l}(\cos \theta ), \quad (i=n,c), \end{aligned} $$(32)

where nθ represents the truncation order of the polynomial basis in the angular domain, and χ i , l ( r ) = P ̂ l { χ i } $ \chi_{i,l}(r) = \hat{\mathrm{P}}_{l}\{\chi_{i}\} $; thus Xi = ∑l ≥ 1χi, l(r)Pl(cos θ). For simplicity, we have omitted the explicit expansion of χi, l(r) in radial polynomials. The solution procedure is the following:

  1. First, we computed the chemical potential perturbations. Instead of using Eqs. (22) and Eqs. (23) to obtain the {χi, l}l ≥ 1, we proceeded in the following manner. To obtain χc, we divided Eq. (12) by μnn and then took the curl

    × [ ( n c n n ) χ c r ̂ ] = × ( f B μ n n ) . $$ \begin{aligned} \boldsymbol{\nabla }\times \left[ \left( \frac{n_c}{n_n} \right)^{\prime } \chi _c \hat{r}\right] = - \boldsymbol{\nabla }\times \left(\dfrac{ \boldsymbol{f}_{B}}{\mu n_n}\right). \end{aligned} $$(33)

    Taking again the curl of Eq. (33) and computing only its radial component, we obtained

    ( n c n n ) Δ H χ c = r ̂ · × × ( f B μ n n ) . $$ \begin{aligned} \left( \frac{n_c}{n_n} \right)^{\prime } \Delta _{H} \chi _c =-\hat{r} \cdot \boldsymbol{\nabla }\times \boldsymbol{\nabla }\times \left(\frac{\boldsymbol{f}_{B}}{ \mu n_n} \right). \end{aligned} $$(34)

    Here, ΔH represents the horizontal Laplacian, which in axial symmetry can be expressed as

    Δ H 1 r 2 sin θ θ ( sin θ θ ) , $$ \begin{aligned} \Delta _H \equiv \dfrac{1}{r^{2}\sin \theta }\dfrac{\partial }{\partial \theta }\left(\sin \theta \dfrac{\partial }{\partial \theta }\right), \end{aligned} $$(35)

    and its eigenfunctions are the Legendre polynomials:

    Δ H P l ( cos θ ) = l ( l + 1 ) r 2 P l ( cos θ ) . $$ \begin{aligned} \Delta _{H} P_l (\cos \theta ) = -\dfrac{l(l +1)}{r^{2}} P_l (\cos \theta ). \end{aligned} $$(36)

    Thus, with the aid of equations (34)–(36), we obtained χc, l, while χn, l was determined by repeating the same procedure but dividing Eq. (12) by μnc instead. Thus, for l ≥ 1, the functions χi, l(r) read as

    χ n , l = r 2 l ( l + 1 ) ( n n / n c ) P ̂ l { r ̂ · × × ( f B μ n c ) } , $$ \begin{aligned} \chi _{n,l}&= -\dfrac{r^{2}}{l(l+1)(n_n/n_c)^{\prime }} \hat{\mathrm{P} }_{l}\left\{ \hat{r} \cdot \boldsymbol{\nabla }\times \boldsymbol{\nabla }\times \left(\frac{\boldsymbol{f}_{B}}{\mu n_c} \right)\right\} ,\end{aligned} $$(37)

    χ c , l = r 2 l ( l + 1 ) ( n c / n n ) P ̂ l { r ̂ · × × ( f B μ n n ) } . $$ \begin{aligned} \chi _{c,l}&= -\dfrac{r^{2}}{l(l+1)(n_c/n_n)^{\prime }} \hat{\mathrm{P} }_{l}\left\{ \hat{r} \cdot \boldsymbol{\nabla }\times \boldsymbol{\nabla }\times \left(\frac{\boldsymbol{f}_{B}}{\mu n_n} \right)\right\} . \end{aligned} $$(38)

  2. Next, we obtained the velocity fields. The ambipolar velocity is the simplest to acquire, and this can be done once Xn = ∑l ≥ 1χn, l(r)Pl(cos θ) has been determined (see Eq. (28)). Since nnvn is purely solenoidal, its poloidal component can be written as

    v n , Pol = 1 n n × × ( Ψ r ̂ ) . $$ \begin{aligned} \boldsymbol{v}_{n\text{,} \text{ Pol}} = \frac{1}{n_n}\boldsymbol{\nabla }\times \boldsymbol{\nabla }\times (\Psi \hat{r}) . \end{aligned} $$(39)

    Here, Ψ(r, θ) is a scalar field. Taking the radial component of the latter and projecting its lth Legendre component yields

    P ̂ l { v n , r } = l ( l + 1 ) Ψ l r 2 n n , $$ \begin{aligned} \hat{\mathrm{P} }_{l}\left\{ v_{n,r}\right\} = \frac{l(l+1)\Psi _l}{r^2 n_n} , \end{aligned} $$(40)

    where Ψ l = P ̂ l { Ψ } $ \Psi_{l}=\hat{\mathrm{P}}_{l}\left\{\Psi\right\} $. This, together with Eq. (30), implies

    Ψ l = r 2 l ( l + 1 ) ( n c / n n ) P ̂ l { · ( μ X n γ nc ) } , $$ \begin{aligned} \Psi _{l} =- \dfrac{r^{2}}{l(l+1)(n_c/n_n)^{\prime }}\hat{\mathrm{P} }_{l}\left\{ \boldsymbol{\nabla }\cdot \left(\dfrac{\mu \boldsymbol{\nabla } X_n}{\gamma _{nc}}\right)\right\} , \end{aligned} $$(41)

    for l ≥ 1, which can be used to compute vn, θ from Eq. (39), whereas the term Ψ0 is not relevant, as it vanishes from the right-hand side of the latter equation.

These equations are solved using the pseudo-spectral code Dedalus2: a flexible framework for spectrally solving differential equations, encompassing boundary, initial, and eigenvalue problems (Burns et al. 2020). It expands in terms of Jacobi polynomials and spherical harmonics in the radial and angular domains, respectively (for more details, see, e.g., Vasil et al. 2019).

To compute the velocity field, we implemented the procedure described above. We computed χi, l (i = n, c) for l ≥ 1 by straightforward substitution in Eqs. (37) and (38). After this, obtaining vad and vn was achieved through a simple substitution in Dedalus (Eqs. (28), (39), and (41)). If needed, we could also determine χn, 0 and χc, 0. To do so, a boundary value problem is solved consisting of Eq. (18) together with conditions (26)-(27) and the integral conditions (14)-(15). In the implementation of this approach, we set the truncation order to nr = 100 and nθ = 71 radial and angular polynomials, respectively.

We note that the pseudo-spectral approach just described has the same limitations as the explicit approach. Namely, it does not provide a way to compute the toroidal component of vn and vc, which makes the approach unsuitable for time-evolving simulations, and it does not allow one to impose boundary conditions at the crust-core interface.

4. Fictitious friction approach

In Sect. 3, we showed how the set of Eqs. (6), (7), (12), and (13) can, in principle, be solved for any given magnetic field configuration. However, the numerical implementation is cumbersome, as it requires knowledge of high-order derivatives of the magnetic field (Ofengeim & Gusakov 2018). In Castillo et al. (2020), we instead introduced a FF force in Eq. (12) (see Yang et al. 1986; Roumeliotis et al. 1994; Hoyos et al. 2008, 2010; Viganò et al. 2011), defined as

f ζ = ζ n n v n , $$ \begin{aligned} \boldsymbol{f}_{\zeta }=-\zeta n_n\boldsymbol{v}_n, \end{aligned} $$(42)

where ζ is a (small) adjustable parameter, which is a strategy that, to our knowledge, was first described by Chodura & Schlüter (1981). With this additional force, the force balance equation takes the form

f B + f n + f c ζ n n v n = 0 , $$ \begin{aligned} \boldsymbol{f}_{B}+\boldsymbol{f}_{n}+\boldsymbol{f}_{c}-\zeta n_n\boldsymbol{v}_n=0, \end{aligned} $$(43)

from which the neutron velocity can be determined:

v n = 1 ζ n n ( f B + f n + f c ) . $$ \begin{aligned} \boldsymbol{v}_n=\frac{1}{\zeta n_n}\left(\boldsymbol{f}_{B}+\boldsymbol{f}_{n}+\boldsymbol{f}_{c}\right) . \end{aligned} $$(44)

Within the framework of the FF approach, instead of solving the original system of Eqs. (6), (7), (12), and (13), it is proposed to solve a modified system consisting of equations Eqs. (6), (7), (13), and (44). This system of equations is hereafter referred to as the FF equations or the FF system, and the corresponding calculation method is called the FF approach. The main advantage of this approach is the simplicity of calculating all three components of the neutron velocity vn using Eq. (44). We note that in the limiting case ζ → ∞, we recover the one-fluid approximation, in which neutrons are modeled as a motionless background (see, e.g., Castillo et al. 2017).

However, we wanted to know how valid the FF approach is. To answer this question, we assumed that the solution of Eqs. (6), (7), (12), and (13) obtained using the rigorous method of Sect. 3.1 is known. We denote the quantities describing this solution with the superscript (0). For example, χ n ( 0 ) $ \chi^{(0)}_{n} $ and v n ( 0 ) $ \boldsymbol{v}^{(0)}_{n} $ represent the relative neutron chemical potential perturbation and neutron velocity in the quasi-stationary approximation, respectively, for a given B.

Then, we supposed that for a sufficiently small dimensionless parameter ζ (in the units specified in Table 1), the solution of the FF system can be expressed as a series expansion in ζ. For instance, for the quantities χn and vn, we can write

χ n = χ n ( 0 ) + ζ χ n ( 1 ) + ζ 2 χ n ( 2 ) + , $$ \begin{aligned} \chi _{n}&=\chi ^{(0)}_{n}+\zeta \chi ^{(1)}_{n}+\zeta ^2\chi ^{(2)}_{n}+\dots ,\end{aligned} $$(45)

v n = v n ( 0 ) + ζ v n ( 1 ) + ζ 2 v n ( 2 ) + . $$ \begin{aligned} \boldsymbol{v}_n&=\boldsymbol{v}^{(0)}_{n}+\zeta \boldsymbol{v}^{(1)}_{n}+\zeta ^2\boldsymbol{v}^{(2)}_{n}+\dots . \end{aligned} $$(46)

(Similar expansions are assumed to hold for other problem parameters, e.g., fc, fn.) Substituting these expansions into Eq. (44) gives

γ cn n c n n [ ζ v n ( 0 ) + ζ 2 v n ( 1 ) + ] = [ f B + f n ( 0 ) + f c ( 0 ) ] + ζ [ f n ( 1 ) + f c ( 1 ) ] + . $$ \begin{aligned} \begin{split} \gamma _{cn}n_c n_n[ \zeta \boldsymbol{v}^{(0)}_{n} +\zeta ^2\boldsymbol{v}^{(1)}_{n}+\dots ] =\,\,&[\boldsymbol{f}_{B}+\boldsymbol{f}^{(0)}_{n}+\boldsymbol{f}^{(0)}_{c}] + \\&\zeta [\boldsymbol{f}^{(1)}_{n}+\boldsymbol{f}^{(1)}_{c}] + \dots . \end{split} \end{aligned} $$(47)

Equating terms of the same order in ζ yields an infinite set of equations relating quantities of order k and k + 1 (k = 0, 1, …). The first two of these equations are

f B + f n ( 0 ) + f c ( 0 ) = 0 , $$ \begin{aligned}&\boldsymbol{f}_{B}+\boldsymbol{f}^{(0)}_{n}+\boldsymbol{f}^{(0)}_{c}=0 ,&\end{aligned} $$(48)

v n ( 0 ) = 1 γ cn n c n n [ f n ( 1 ) + f c ( 1 ) ] . $$ \begin{aligned}&\boldsymbol{v}^{(0)}_{n} = \frac{1}{\gamma _{cn}n_c n_n}\left[\boldsymbol{f}^{(1)}_{n}+\boldsymbol{f}^{(1)}_{c} \right].&\end{aligned} $$(49)

The first equation is satisfied automatically, as it coincides with the force balance equation (12) of our exact problem. The second equation, in turn, provides a relationship between the neutron velocity v n ( 0 ) $ \boldsymbol{v}^{(0)}_{n} $ of the exact solution and the first-order corrections f n ( 1 ) $ \boldsymbol{f}^{(1)}_{n} $ and f c ( 1 ) $ \boldsymbol{f}^{(1)}_{c} $ to the forces f n ( 0 ) $ \boldsymbol{f}^{(0)}_{n} $ and f c ( 0 ) $ \boldsymbol{f}^{(0)}_{c} $. It can be shown that the remaining Eqs. (6), (7), and (13) allow, in principle, for the complete calculation of all first-order corrections in terms of the zeroth-order quantities (computed using the rigorous approach). The higher-order terms can be found following the same strategy.

From this example, the essence of the FF approach becomes clear. Within this approach, the solution approximately corresponds to the exact solution of Eqs. (6), (7), (12), and (13) with an accuracy of 𝒪(ζ). For instance: v n v n ( 0 ) O ( ζ ) $ \boldsymbol{v}_n-\boldsymbol{v}^{(0)}_{n}\sim\mathcal{O}(\zeta) $. Thus, for sufficiently small ζ, the FF approach should yield a solution that deviates only slightly from the exact calculation.

We have just discussed how, given the exact solution of the system Eqs. (6), (7), (12), and (13), the solution of the FF system can be derived. However, in practice, the FF approach was specifically proposed to avoid solving the exact system of Eqs. (6)–(13). Supposing we chose a sufficiently small parameter, ζ, and found the solution of the FF equations, we wanted to determine whether this solution would always be close to the exact solution of the system (6)–(13). Unfortunately, this is not the case. As discussed below, the FF system requires more boundary conditions than the original system (6)–(13). Specifically, to uniquely solve the FF equations, some boundary conditions must be imposed, for example, by specifying the r components of the velocities vn and vc at the crust-core interface. Meanwhile, in the exact system, these components are determined automatically during the solution process, as they depend on the magnetic field structure. Thus, the FF system of equations describes a broader class of solutions, which only becomes close [to an accuracy of ∼𝒪(ζ)] to the exact solution if the boundary conditions for the FF system (values of the r components of the velocities vn and vc at the boundary) are chosen to be sufficiently close to the corresponding boundary values obtained in the exact calculation. This interpretation has been verified numerically; see Sect. 8.1.2 for details. With these caveats, the FF approach can be successfully used to determine velocity fields for a given magnetic field configuration, as described below.

To solve the FF system for a given initial condition for the magnetic field, we can replace the velocities from Eqs. (13) and (44) into the continuity Eqs. (6) and (7), together with Eqs. (9) and (10). After rearranging terms, leaving only the terms explicitly dependent on the magnetic field on the right-hand side of the equations, we obtained

· ( n n μ χ n + n c μ χ c ) = · f B , $$ \begin{aligned} \boldsymbol{\nabla }\cdot \left(n_n\mu \boldsymbol{\nabla } \chi _n+n_c\mu \boldsymbol{\nabla } \chi _c\right)&= \boldsymbol{\nabla }\cdot \boldsymbol{f}_{B},\end{aligned} $$(50)

· [ n c μ χ n + g ( ζ ) n c μ χ c ] = · [ g ( ζ ) f B ] . $$ \begin{aligned} \boldsymbol{\nabla }\cdot \left[n_c\mu \boldsymbol{\nabla } \chi _n + g(\zeta )n_c\mu \boldsymbol{\nabla } \chi _c \right]&= \boldsymbol{\nabla }\cdot \left[ g(\zeta ) \boldsymbol{f}_{B}\right] . \end{aligned} $$(51)

Here, we introduced a dimensionless radial function,

g ( ζ , r ) = ζ γ cn n n + n c n n . $$ \begin{aligned} g(\zeta ,r)= \frac{\zeta }{\gamma _{cn} n_n} + \frac{n_c}{n_n}. \end{aligned} $$(52)

The differential equations (50), (51), and integral conditions (14) and (15) fully define the functions χc and χn when combined with appropriate boundary conditions such as the non-penetration conditions at the crust-core interface for the velocity fields, i.e., vn, r = vad, r = 0, which translates into

χ c r | r = R = f B , r n c μ | r = R , $$ \begin{aligned} \left.\frac{\partial \chi _c}{\partial r}\right|_{r=R}&= \left.\frac{f_{B,r}}{n_c \mu }\right|_{r=R}, \end{aligned} $$(53)

χ n r | r = R = 0 . $$ \begin{aligned} \left.\frac{\partial \chi _n}{\partial r}\right|_{r=R}&=0. \end{aligned} $$(54)

We chose these boundary conditions because they can be easily implemented numerically. However, it should be noted that, as shown by Ofengeim & Gusakov (2018), for an arbitrary magnetic field, the exact solution to the set of Eqs. (6), (7), (12), and (13) will typically yield non-null radial components of the velocities at the boundary.

4.1. Numerical implementation using finite difference and finite volume

In order to numerically solve our equations using a finite difference and finite volume implementation, we discretize the relevant variables over a staggered polar grid composed of Nr points that can be homogeneously or inhomogeneously distributed in the radial direction and Nθ points equally spaced in the polar direction, following the rule

r i = ( i 1 N r 1 ) u i = 1 , , N r , $$ \begin{aligned} r_i&=\left(\frac{i-1}{N_r-1}\right)^u\quad i=1,\dots , N_r , \end{aligned} $$(55)

θ j = π j 1 N θ 1 = ( j 1 ) Δ θ j = 1 , , N θ . $$ \begin{aligned} \theta _j&=\pi \frac{j-1}{N_\theta -1}=(j-1)\Delta \theta \quad j=1,\dots , N_\theta . \end{aligned} $$(56)

The exponent, u, is specified later. We discretized the relevant variables on this grid in the following way, where half-integer indices denote averages (e.g., ri + 1/2 ≡ (ri + ri + 1)/2):

  1. The variable α was evaluated at the corner of each cell: αi, j = α(ri, θj).

  2. The variable β, χn, and χc and the ϕ component of the forces and velocities were evaluated at the center of each cell: βi, j = β(ri + 1/2, θj + 1/2).

  3. The radial components of vector fields, such as the magnetic field, the forces, and the velocities were evaluated at the centers of cell faces defined by a constant r = ri: Bri, j = Br(ri, θj + 1/2).

  4. The polar components of vector fields, such as the magnetic field, the forces, and the velocities were evaluated at the centers of cell faces defined by a constant θ = θj: Bθi, j = Bθ(ri + 1/2, θj).

The value of the divergence of a vector field F at the center of each cell ( ⋅ F)i, j = F|ri + 1/2, θj + 1/2 was given by

( · F ) i , j = 1 V i , j ( S r i + 1 , j F r i + 1 , j S r i , j F r i , j + S θ i , j + 1 F θ i , j + 1 S θ i , j F θ i , j ) , $$ \begin{aligned} \begin{split} (\boldsymbol{\nabla }\cdot \boldsymbol{F})_{i,j} = \frac{1}{\mathcal{V} _{i,j}}\big (&S_{r\,i+1,j}F_{r\,i+1,j}-S_{r\,i,j}F_{r\,i,j} \\&+S_{\theta \,i,j+1}F_{\theta \,i,j+1}-S_{\theta \,i,j}F_{\theta \,i,j}\big ) , \end{split} \end{aligned} $$(57)

where Fri, j = Fr(ri, θj + 1/2), Fθi, j = Fθ(ri + 1/2, θj); Sri, j and Sθi, j are the surface areas of the faces of each cell at constant r = ri and θ = θj, respectively; and 𝒱i, j is the volume of the cell. Therefore,

( · F ) i , j = 3 r i + 1 2 F r i + 1 , j r i 2 F r i , j r i + 1 3 r i 3 + 3 ( r i + 1 2 r i 2 ) 2 ( r i + 1 3 r i 3 ) sin θ j + 1 F θ i , j + 1 sin θ j F θ i , j cos θ j cos θ j + 1 . $$ \begin{aligned} \begin{split} (\boldsymbol{\nabla }\cdot \boldsymbol{F})_{i,j} =&\, 3\frac{r_{i+1}^2F_{r\,i+1,j}-r_{i}^2F_{r\,i,j}}{r_{i+1}^3-r_{i}^3} \\&+\frac{3(r_{i+1}^2-r_{i}^2)}{2(r_{i+1}^3-r_{i}^3)}\frac{\sin \theta _{j+1}F_{\theta \,i,j+1}-\sin \theta _{j}F_{\theta \,i,j}}{\cos \theta _j-\cos \theta _{j+1}} . \end{split} \end{aligned} $$(58)

Assuming boundary conditions vn, r(r = R) = vc, r(r = R) = 0, Eqs. (50) and (51) can be solved for the relative chemical perturbations, χn, and χc. Considering all grid cells, we have two sets of variables, {χni, j}i = 1, j = 1Nr − 1, Nθ − 1 and {χci, j}i = 1, j = 1Nr − 1, Nθ − 1, giving a total of 2(Nr − 1)(Nθ − 1) unknowns. Eqs. (50) and (51) are evaluated at the center of each grid cell. Thus, each of them provides (Nr − 1)(Nθ − 1) equations, making a total of 2(Nr − 1)(Nθ − 1). We note that these equations only involve spatial derivatives of the relative chemical perturbations. Thus, they determine χn and χc up to additive constants. Fixing these constants requires extra conditions provided by Eqs. (14) and (15). Therefore, for the system of equations to be consistent, we must replace two redundant equations from the discretization of Eqs. (50) and (51). We choose to replace the equations corresponding to the grid cell (i, j) = (1, 1).

In the evaluation of each divergence, the boundary conditions on the velocities must be taken into account. For each cell touching the symmetry axis, we impose the fluxes through the corresponding face of the cell to be null (i.e., θ = 0 or θ = π). In the cells touching the center of the star, we impose fluxes through the face defined by r = 0 to be null, and at the faces defined by r = 1 we impose vn, r = 0 and vad, r = 0, thus fluxes through those faces are null as well. In other words, radial fluxes at r = 1 of the cells touching the boundary are equal on both sides of equations (50) and (51).

Schematically, the linear system described before can be represented by a vector of unknown values of the relative chemical potential perturbations χ = {{χni, j}i = 1, j = 1Nr − 1, Nθ − 1,{χni, j}i = 1, j = 1Nr − 1, Nθ − 1}; a vector b containing the right-hand side of Eqs. (50), (51), (14), and (15); and a sparse matrix, Λ, generated from the coefficients extracted from the discretization of the left-hand side of the previous equation:

Λ { { χ n i , j } i = 1 , j = 1 N r 1 , N θ 1 { χ c i , j } i = 1 , j = 1 N r 1 , N θ 1 } = b { { rhs ( 50 ) } ( i , j ) ( 1 , 1 ) N r 1 , N θ 1 { rhs ( 51 ) } ( i , j ) ( 1 , 1 ) N r 1 , N θ 1 0 0 } . $$ \begin{aligned} \Lambda \begin{Bmatrix} \{\chi _{n\, i,j}\}_{i=1,j=1}^{N_r-1,N_\theta -1}\\ \{\chi _{c\, i,j}\}_{i=1,j=1}^{N_r-1,N_\theta -1} \end{Bmatrix} =\boldsymbol{b}\equiv \begin{Bmatrix} \{\text{ rhs}(50)\}_{ (i,j)\ne (1,1) }^{N_r-1,N_\theta -1}\\ \{\text{ rhs}(51)\}_{ (i,j)\ne (1,1) }^{N_r-1,N_\theta -1}\\ 0\\ 0 \end{Bmatrix}. \end{aligned} $$(59)

We note that all the dependence on the magnetic field is in b. Thus, Λ needs to be inverted only once in a time-evolving simulation. It is also worth noting that this approach has some limitations. Setting a very small value of ζ, is not only limited by the integration time. As ζ decreases, the matrix Λ becomes progressively more singular.

In summary, this solution consists of the following steps:

  1. An initial seed for the magnetic field is chosen.

  2. From the magnetic field, b is computed and used to solve for the chemical potential perturbations:

    χ = Λ 1 b . $$ \begin{aligned} \boldsymbol{\chi }=\Lambda ^{-1}\boldsymbol{b}. \end{aligned} $$(60)

  3. The values of χn and χc are replaced into Eqs. (13) and (44), yielding the relevant velocities.

In the case we are also interested in following the time evolution:

  1. The time derivative of the magnetic field from Eqs. (1) is computed and used to evolve the magnetic field one time step (see more details in Sect. 7).

  2. This procedure is iterated, going back to step 1 but using the evolved magnetic field.

4.2. Numerical implementation with the Dedalus pseudo-spectral code

As an alternative numerical implementation of the FF approach, we solved Eqs. (50) and (51) with the normalization described in Table 1 using Dedalus. The truncation orders were set to nr = 92 for the radial polynomials and nθ = 65 for the angular polynomials. As explained in Sect. 3.2, Dedalus expands the radial and angular domains using Jacobi polynomials and spherical harmonics, respectively, leveraging their properties to solve the system in Eq. (60) efficiently.

We remark that all regularity conditions imposed by axial symmetry are naturally satisfied, as the polynomial basis used in the expansion is inherently regular at the axis and the origin. Additionally, the boundary conditions, Eqs. (53) and (54), are enforced in Dedalus using the τ-method (see, e.g., Boyd 2001).

5. Background neutron star model

We performed our analysis considering five different EoSs. One is the same toy model described in Castillo et al. (2020). There, neutrons and protons are treated as a non-relativistic Fermi gas, and electrons are treated as an extremely relativistic Fermi gas. Both neutrons and protons are considered to have the same mass m. Therefore, the chemical potentials are related to the particle densities by

μ n ( r ) = m c 2 + p Fn ( r ) 2 2 m , $$ \begin{aligned} \mu _n(r)&= m c^2 + \frac{p_{Fn}(r)^2}{2m},\end{aligned} $$(61)

μ c ( r ) = m c 2 + p Fc ( r ) 2 2 m + p Fc ( r ) c , $$ \begin{aligned} \mu _c(r)&= m c^2 + \frac{p_{Fc}(r)^2}{2m} + p_{Fc}(r)c , \end{aligned} $$(62)

where pFi(r) = ℏ[3π2ni(r)]1/3  (i = n, c) are the Fermi momenta of neutrons and charged particles, respectively. Thus, the density profiles can be written as

n n ( r ) = [ 2 m c ħ ( 3 π 2 ) 1 / 3 n c ( r ) 1 / 3 + n c ( r ) 2 / 3 ] 3 / 2 , $$ \begin{aligned} n_n(r)&=\left[\frac{2mc}{\hbar (3\pi ^2)^{1/3}}n_c(r)^{1/3} + n_c(r)^{2/3}\right]^{3/2},\end{aligned} $$(63)

n c ( r ) = n 0 sinc 6 ( 0.7 π r / R ) , $$ \begin{aligned} n_c(r)&=n_{0}\,\text{ sinc}^6(0.7\pi r/R), \end{aligned} $$(64)

where sinc(x) = sin(x)/x. Equation (63) comes from the chemical equilibrium condition, μn(r) = μc(r), and Eq. (64) is an analytic approximation to the radial profile obtained by numerically integrating the (non-relativistic) stellar structure equations.

The other EoSs used are HHJ (Heiselberg & Hjorth-Jensen 1999), BSk24, BSk25, and BSk26 (Goriely et al. 2013), which have been adapted for npe matter. For all realistic models, the central density is adjusted so that the mass of the star is 1.4M. The basic parameters of the stellar models are summarized in Table 2. Unlike the toy model, these realistic EoSs consider strong interactions by means of a coefficient K ≠ 0 (see Sect. 2). A comparison between nn, nc, and nc/nn as functions of r for the different models can be seen in Figs. 1(a) and (b). The collision coefficient between charged particles and neutrons, γcn, for the different models is computed from Jpn(r, T) = nc(r)nn(r)γcn(r, T) given by Yakovlev & Shalybkov (1991), where T is the temperature.

thumbnail Fig. 1.

Comparison between the five different EoSs studied. (a) nn and nc, in units of nc(r = 0); (b) the ratio nc/nn; and (c) c/R, where c ≡ −[dln(nc/nn)/dr]−1 (see Sect. 7.2) and R is the core radius. All these variables are functions of the normalized radial coordinate, r/R.

6. Analytical magnetic field models

In our simulations, initial conditions are given by analytical expressions for α and β as functions of r and θ. These functions are normalized so that the rms value of the magnetic field in the core is 1:

B ( 1 V c V c B 2 d V ) 1 / 2 = 1 . $$ \begin{aligned} \langle \boldsymbol{B} \rangle \equiv \left(\frac{1}{\mathcal{V}_c}\int _{\mathcal{V}_c}\boldsymbol{B}^2d\mathcal{V}\right)^{1/2}=1. \end{aligned} $$(65)

We focus on the following models:

Model I: Arguably, the simplest expressions for a purely poloidal magnetic configuration are of the form

α ( r , θ ) = f ( r ) sin 2 θ , $$ \begin{aligned} \alpha (r,\theta )=f(r)\sin ^2\theta , \end{aligned} $$(66)

where f(r) is a polynomial on r. In particular, the following has been widely used in the literature (Akgün et al. 2013; Armaza et al. 2015; Passamonti et al. 2017; Ofengeim & Gusakov 2018; Castillo et al. 2020):

α I ( r , θ ) = 35 8 11 118 ( r 2 6 5 r 4 + 3 7 r 6 ) sin 2 θ . $$ \begin{aligned} \alpha _{\text{ I}}(r,\theta )=\frac{35}{8}\sqrt{\frac{11}{118}} \left( r^2 - \frac{6}{5} r^4 + \frac{3}{7} r^6 \right)\sin ^2\theta . \end{aligned} $$(67)

The numerical coefficients on the polynomial come from imposing continuity of B on the surface of the core with a current-free dipole solution outside [f(r)∝1/r], continuity of the toroidal component of the current density Jϕ (although this is not a physical requirement), and the normalization of the magnetic field (in addition to a regularity condition at the axis, which does not allow for terms proportional tor0 and r1).

Model II, a model with null radial velocities at the crust-core interface: Following Ofengeim & Gusakov (2018), we can construct poloidal magnetic field configurations for which the radial components of both vn and vad vanish at the crust-core interface. First, we take α as a multipolar expansion ofthe form

α ( r , θ ) = l 1 C l α l ( r , θ ) , $$ \begin{aligned} \alpha (r,\theta )=\sum _{l\ge 1} C_l\alpha _l(r,\theta ), \end{aligned} $$(68)

where

α l ( r , θ ) = f l ( r ) P l 1 ( cos θ ) sin θ . $$ \begin{aligned} \alpha _l(r,\theta )=f_l(r)P_l^1(\cos \theta )\sin \theta . \end{aligned} $$(69)

Here, Cl are constants that determine the relative weights of each multipole, fl(r) = ∑ial, iri are polynomials of r, and Pl1 are the associated Legendre functions. The potentials αl are normalized so their generated magnetic field Bl ≡ αl × ϕ satisfies ⟨Bl⟩ = 1, implying ∑lCl2 = 1. For this model, we only considered a dipole; however, equations are written for a more general case, as they also apply to model III. The order of the polynomial(s) depends on the number of conditions to be imposed. We enforce the same three conditions as for model I, namely

f l ( 1 ) + l f l ( 1 ) = 0 , $$ \begin{aligned}&f^{\prime }_l(1)+l\,f_l(1)=0,\end{aligned} $$(70)

f l ( 1 ) l ( l + 1 ) f l ( 1 ) = 0 , $$ \begin{aligned}&f^{\prime \prime }_l(1)-l(l+1)\,f_l(1)=0, \end{aligned} $$(71)

B l = 1 . $$ \begin{aligned}&\langle \boldsymbol{B}_l \rangle =1 . \end{aligned} $$(72)

These are, respectively, continuity of B at the crust-core boundary considering a current-free field everywhere outside the core; continuity of Jϕ, which is null outside; and a normalization.

Additional conditions follow from setting vn, r(1, θ) = vad, r(1, θ) = 0. If we expand vad, r(1, θ), using Eq. (28), into Legendre polynomials, all Legendre components should be null, which implies P ̂ l { X n / r | r = 1 } = 0 $ \hat{\mathrm{P}}_{l}\{\partial X_n/\partial r|_{r = 1}\} = 0 $, l = 1, 2, …. Thus, the first extra condition is

0 π X n r | r = 1 P l ( cos θ ) sin θ = 0 , l = 1 , 2 , . . $$ \begin{aligned} \int _0^\pi \left.\frac{\partial X_n}{\partial r}\right|_{r=1}P_l(\cos \theta )\sin \theta =0 ,\quad l=1,2,.. \end{aligned} $$(73)

Analogously, Eq. (30) implies P ̂ l { · [ ( μ / γ cn ) X n ] | r = 1 } = 0 $ \hat{\mathrm{P}}_{l}\{\boldsymbol{\nabla}\cdot[(\mu/\gamma_{cn})\boldsymbol{\nabla} X_n] |_{r = 1}\} = 0 $, l = 1, 2, …, which, together with Eq. (73), yields the second extra condition

0 π [ 2 X n r 2 l ( l + 1 ) r 2 X n ] r = 1 P l ( cos θ ) sin θ = 0 , l = 1 , 2 , . . . $$ \begin{aligned} \int _0^\pi \left[\frac{\partial ^2X_n}{\partial r^2}-\frac{l(l+1)}{r^2}X_n\right]_{r=1}P_l(\cos \theta )\sin \theta =0 ,\quad l=1,2,... \end{aligned} $$(74)

To apply these two conditions, we first need to obtain Xn in terms of the set of coefficients {al, i} in fl(r). This is done first by computing the magnetic force in terms of the al, i coefficients, then using (20), (21), and (22). The number of non-zero Legendre components in Xn, and consequently in Eqs. (73) and (74), increases nonlinearly with the number of non-zero Legendre components in B (as Xn is nonlinear in B). For a dipolar magnetic field configuration (corresponding to l = 1), the only non-zero Legendre component in Xn is l = 2, which imposes non-linear relations for the coefficients {al = 1, i} in Eqs. (73) and (74). We have a total of five conditions; thus, we used a polynomial of five coefficients of the form

f 1 ( r ) = a 1 , 2 r 2 + a 1 , 4 r 4 + a 1 , 6 r 6 + a 1 , 8 r 8 + a 1 , 10 r 10 . $$ \begin{aligned} f_1(r)=a_{1,2}r^2+a_{1,4}r^4+a_{1,6}r^6+a_{1,8}r^8+a_{1,10}r^{10} . \end{aligned} $$(75)

Solving for the coefficients, using the conditions previously described, yields eight solutions, four of which, evaluated with the HHJ EoS, are summarized in Table 3 and displayed in Fig. 2. The other four are the same, just with a global minus sign. We focus on “Solution 1” (hereafter model II, αII); as in the others, the magnetic flux is fully enclosed inside the core.

Table 3.

Coefficients for the polynomial in Eq. (75).

thumbnail Fig. 2.

Radial functions f1(r) for model II. The coefficients for each solution are given in Table 3.

Model III, a non-equatorially symmetric model with null radial velocities at the crust-core interface: Using the conditions from the previous model, we can build a non-equatorially symmetric poloidal magnetic configuration with null radial velocities at the crust-core interface. For this, we consider a combination of a dipolar and quadrupolar magnetic field configuration of the form α III ( r , θ ) = 0.5 α 1 ( r , θ ) + 0.5 α 2 ( r , θ ) $ \alpha_{\text{III}}(r,\theta) = \sqrt{0.5}\alpha_1(r,\theta)+\sqrt{0.5}\alpha_2(r,\theta) $, where

α 1 ( r , θ ) = i = 1 6 a 1 , 2 i r 2 i sin 2 θ , $$ \begin{aligned} \alpha _1(r,\theta )&=\sum _{i=1}^6 a_{1,2i}r^{2i}\sin ^2\theta ,\end{aligned} $$(76)

α 2 ( r , θ ) = i = 1 6 a 2 , 2 i + 1 r 2 i + 1 sin 2 θ cos θ . $$ \begin{aligned} \alpha _2(r,\theta )&=\sum _{i=1}^6 a_{2,2i+1}r^{2i+1}\sin ^2\theta \cos \theta . \end{aligned} $$(77)

The number of al, i coefficients considered comes from the number of conditions needed to fix the configuration. For each of the multipoles (l = 1 and l = 2), we have to satisfy the conditions from Eqs. (70) and (72); a total of four. We note that we relaxed condition (71), as it is not strictly needed. Also, αIII yields a function, Xn(r, θ), that includes non-zero multipoles l = 1, 2, 3, and 4. Thus, Eqs. (73) and (74) yield eight equations. So, we have set enough coefficients to satisfy the 12 conditions needed for αIII. There is a very large number of solutions for this system. The coefficients for the solution we use in this work are presented in Table 4.

Table 4.

Coefficients for the polynomials in Eqs. (76) and (77).

Model IV, a non-equatorially symmetric model with a toroidal component: We use the same non-equatorially symmetric magnetic field introduced in Castillo et al. (2020), with poloidal and toroidal components produced by the potentials

α IV ( r , θ ) = 0.18 α I ( r , θ ) + 0.42 α aux ( r , θ ) , $$ \begin{aligned} \alpha _{\text{ IV}}(r,\theta )&= \sqrt{0.18}\alpha _{\text{ I}}(r,\theta )+\sqrt{0.42}\alpha _\text{ aux}(r,\theta ),\end{aligned} $$(78)

β IV ( r , θ ) = 0.4 β aux ( r , θ ) , $$ \begin{aligned} \beta _{\text{ IV}}(r,\theta )&= \sqrt{0.4}\beta _\text{ aux}(r,\theta ) , \end{aligned} $$(79)

where

α aux ( r , θ ) = 3.718 ( r 3 10 7 r 5 + 5 9 r 7 ) sin 2 θ cos θ , $$ \begin{aligned} \alpha _\text{ aux}(r,\theta )&=3.718\, \left( r^3 -\frac{10}{7}r^5 +\frac{5}{9}r^7 \right)\sin ^2\theta \cos \theta ,\end{aligned} $$(80)

β aux ( r , θ ) = 112.546 r 5 ( 1 r ) 2 sin 2 θ sin ( θ π / 5 ) . $$ \begin{aligned} \beta _\text{ aux}(r,\theta )&=112.546\, r^5(1 -r)^2\sin ^2\theta \sin (\theta -\pi /5). \end{aligned} $$(81)

The quadrupolar poloidal potential, αaux, (which satisfies the same conditions as αI), and the toroidal potential, βaux, are both normalized so ⟨BPolaux⟩ = 1 and ⟨BToraux⟩ = 1, respectively3; so αIV and βIV will produce a magnetic configuration in which the toroidal magnetic field has 40% of the internal magnetic energy.

The magnetic field models I, II, III, and IV are shown in the first row of Fig. 3.

thumbnail Fig. 3.

Magnetic field configurations, relative chemical potential perturbations, and velocity fields produced by the models I, II, III, and IV. For B, lines represent the poloidal magnetic field lines labeled by the corresponding value of α. For models I–III, color represents the poloidal potential α, while in model IV, it represents the toroidal magnetic field Bϕ. For χn and χc, color represents their local value. For vn and vad, lines represent the poloidal component and color its magnitude; these are computed through the explicit semi-analytic approach described in Sect. 3.1 using the background NS model with the HHJ EoS.

7. Time evolution

The time-evolving equations for the magnetic potentials can be obtained from Eq. (1) together with Eq. (16)

α t = r sin θ [ ( v n + v ad ) × B ] · ϕ ̂ , $$ \begin{aligned} \frac{\partial \alpha }{\partial t}&=r\sin \theta \left[\left(\boldsymbol{v}_n+\boldsymbol{v}_{ad}\right)\times \boldsymbol{B}\right]\cdot \hat{\phi }, \end{aligned} $$(82)

β t = r 2 sin 2 θ · { [ ( v n + v ad ) × B ] × ϕ ̂ r sin θ } . $$ \begin{aligned} \frac{\partial \beta }{\partial t}&=r^2\sin ^2\theta \boldsymbol{\nabla }\cdot \left\{ \frac{\left[\left(\boldsymbol{v}_n+\boldsymbol{v}_{ad}\right)\times \boldsymbol{B} \right]\times \hat{\phi }}{r\sin \theta } \right\} . \end{aligned} $$(83)

The evolution in the core and crust of the star are coupled. For simplicity, in this work we assume that the crust acts as a vacuum or perfect resistor ( × B = 0). Therefore, the magnetic field outside of the core can be written as B = φ, where φ ( r , θ ) = l = 1 ( b l / r l + 1 ) P l ( cos θ ) $ \varphi(r,\theta) = \sum_{l = 1}^{\infty}(b_l/r^{l+1})P_l (\cos\theta) $ and bl are coefficients. The magnetic field in the crust and outside of the star is entirely determined by the radial component of the magnetic field at the crust-core interface, where continuity implies b l = R l + 2 P ̂ l { B r ( R , θ ) } / ( l + 1 ) $ b_l=-R^{l+2}\hat{\mathrm{P}}_{l} \{B_r(R,\theta)\}/(l+1) $ (see Marchant et al. 2011). Of course, in practice, we are only considering a finite number of external multipoles, NExp, satisfying the criterion NExp ≥ Nθ/4. It should be noted that the assumption of a current-free crust is properly justified only if currents therein dissipate much faster than in the core. The latter, however, is very uncertain (Jones 2001; Cumming et al. 2004), and simulations coupling the evolution of the core and crust may be more appropriate (see discussion in Sect. 9, numeral 5).

In our time-evolving simulations, the numerical computation of the time derivative of the toroidal potential β is performed conservatively using a finite-volume scheme, and the time derivative of the poloidal potential α is calculated using finite differences. The decomposition of the magnetic field in terms of α and β ensures that the condition  ⋅ B = 0 is maintained at all times with machine precision. The time evolution is computed using the midpoint method (a second-order Runge–Kutta method), which allows the system to be evolved with second-order accuracy in time. For more details on the numerical code, please refer to Castillo et al. (2017).

7.1. Hydromagnetic quasi-equilibrium

As discussed in Sect. 1, after a few Alfvén times, the magnetic field will evolve toward a hydromagnetic quasi-equilibrium state in which, under axial symmetry, the toroidal magnetic force must be null, since the fluid forces, fi = −niμχi (i = n, c), which are purely poloidal, cannot balance it. This imposes a strong condition on the magnetic field; Eq. (16) implies fB, ϕ ∝ |α × β| = 0; which can only be achieved if there is a relation between the magnetic potentials (e.g., β = β(α)). Since in our model there is no toroidal field outside of the core, the latter implies that the toroidal field must be confined to the regions in which the poloidal magnetic field lines close inside of the core, forming a “twisted torus” configuration (Chandrasekhar & Prendergast 1956; Braithwaite & Spruit 2004). It also implies that the magnetic force takes the form

f B = Δ α + β d β / d α 4 π r 2 sin 2 θ α , $$ \begin{aligned} \boldsymbol{f}_B=-\frac{\Delta ^*\alpha +\beta d\beta /d\alpha }{4\pi r^2\sin ^2\theta }\boldsymbol{\nabla }\alpha , \end{aligned} $$(84)

where

Δ 2 r 2 + sin θ r 2 θ ( 1 sin θ θ ) , $$ \begin{aligned} \Delta ^* \equiv \frac{\partial ^2}{\partial r^2} + \frac{\sin \theta }{r^2} \frac{\partial }{\partial \theta }\left( \frac{1}{\sin \theta }\frac{\partial }{\partial \theta }\right) , \end{aligned} $$(85)

is the so-called GS operator.

As time passes, this quasi-equilibrium is slowly eroded as the magnetic field lines, which are frozen into the charged particle fluid, keep moving relative to the neutron fluid with velocity vad. Eventually, a final barotropic equilibrium state is reached on a timescale ∼tB (see Sect. 7.2), in which the magnetic force is mainly balanced by the pressure gradient and gravitational force of the charged particle fluid, while neutrons stay in diffusive equilibrium,

f B n c μ χ c = 0 , $$ \begin{aligned}&\boldsymbol{f}_{B}-n_c\mu \boldsymbol{\nabla }\chi _c = 0, \end{aligned} $$(86)

χ n = 0 . $$ \begin{aligned}&\boldsymbol{\nabla }\chi _n=0 . \end{aligned} $$(87)

The latter formula indeed means diffusive equilibrium, since it is equivalent to the condition ∇δμn + (δμn/c2)∇Φ = 0 (see Eq. (8) and the definition of the function χn).

Eqs. (84) and (86) imply that, in this kind of equilibrium, not only β, but also χc, must be a function of α, and these variables must satisfy the so-called GS equation

Δ α + β d β d α + 4 π r 2 sin 2 θ n c μ d χ c d α = 0 . $$ \begin{aligned} \Delta ^*\alpha +\beta \frac{d\beta }{d\alpha } + 4\pi r^2\sin ^2\theta \, n_c\mu \frac{d\chi _c}{d\alpha } = 0 . \end{aligned} $$(88)

Solutions to this equation are called “GS equilibria” (Grad & Rubin 1958; Shafranov 1966) and have been widely studied in the literature (e.g., Armaza et al. 2015 and references therein). We note that in this equilibrium χn must be uniform, but χc is non-uniform. Together with Eq. (4), this implies that, unlike what one might have expected, δnn cannot be uniform.

7.2. Time-scale estimates

From Eq. (1), we can estimate the timescale for magnetic evolution in the core of the star as

t B B | v c | = B | v n + v ad | , $$ \begin{aligned} t_B\sim \frac{\ell _B}{|\boldsymbol{v}_c|}=\frac{\ell _B}{|\boldsymbol{v}_{n}+\boldsymbol{v}_{ad}|}, \end{aligned} $$(89)

where B is the length scale over which the magnetic field varies. The usual assumptions found in the literature (Goldreich & Reisenegger 1992; Thompson & Duncan 1996; Castillo et al. 2017; Passamonti et al. 2017) are that the neutron velocity can be neglected and that the magnitude of the poloidal component of the ambipolar velocity can be estimated from Eq. (13) as vad, Pol ∼ fB/(γcnncnn) (vad, ϕ = 0 in the quasi-stationary state). From Eq. (11), we see that the magnitude of the magnetic force can be estimated as fB ∼ B2/(4πℓB). Under these assumptions, we obtain the usual estimate for magnetic evolution under ambipolar diffusion as tB ∼ tad, where

t ad B | v a d , Pol | 4 π γ cn n c n n B 2 B 2 8 × 10 5 ( 10 14 G B ) 2 ( T 10 8 K ) 2 ( B 1 km ) 2 yr , $$ \begin{aligned} \begin{split} t_{ad} \equiv \frac{\ell _B}{|\boldsymbol{v}_{ad\text{,} \text{ Pol}}|}&\sim \frac{4\pi \gamma _{cn}n_c n_n \ell _B^2}{B^2} \\&\sim 8\times 10^{ 5}\left(\frac{10^{14}\text{ G}}{B}\right)^2\left(\frac{T}{10^8\text{ K}}\right)^2\left(\frac{\ell _{B}}{1\,\text{ km}}\right)^2 \text{ yr}, \end{split} \end{aligned} $$(90)

for BSk24. This derivation, however, has a few shortcomings. First, from Eqs. (12) and (13), we see that a better estimate of the magnitude of the poloidal component of the ambipolar velocity is vad ∼ fn/(γcnncnn); however, as demonstrated by Moraga et al. (2024), an arbitrary magnetic field can induce fluid forces larger than the Lorentz force, i.e., fc ∼ fn ∼ (c/B)fB, where we introduced a length scale

c [ d dr ln ( n c / n n ) ] 1 , $$ \begin{aligned} \ell _c\equiv -\left[\frac{d}{dr}\ln (n_{c}/n_{n})\right]^{-1}, \end{aligned} $$(91)

which is a measure of the stable stratification due to the composition gradient in the NS core [more strongly stratified for smaller c, see Fig. 1(c)]. Thus,

v a d , Pol c B f B γ cn n c n n . $$ \begin{aligned} v_{ad\text{,} \text{ Pol}} \sim \frac{\ell _c}{\ell _B}\frac{f_B}{\gamma _{cn}n_c n_n} . \end{aligned} $$(92)

More importantly, the implicit assumption of fixed neutrons is not justified. As shown in Ofengeim & Gusakov (2018) and numerically checked by Castillo et al. (2020), the neutron velocity can be much larger than the ambipolar diffusion velocity. Its magnitude can be estimated from Eqs. (9) and (30) as

v n , Pol c B f n γ cn n c n n c B v a d , Pol . $$ \begin{aligned} v_{n\text{,} \text{ Pol}}\sim \frac{\ell _c}{\ell _B} \frac{f_n}{ \gamma _{cn} n_c n_n} \sim \frac{\ell _{c}}{\ell _B}v_{ad\text{,} \text{ Pol}}. \end{aligned} $$(93)

Typically, c/B ≫ 1 (see Sect. 8.1); therefore, from Eqs. (92) and (93), we obtain a more accurate estimate of the long-term evolution timescale of the magnetic field under ambipolar diffusion

t B B v n , Pol ( B c ) 2 4 π γ cn n c n n B 2 B 2 = ( B c ) 2 t ad ( 0.01 - 0.1 ) t ad . $$ \begin{aligned} t_B \sim \frac{\ell _B}{v_{n\text{,} \text{ Pol}}}\sim \left(\frac{\ell _{B}}{\ell _c}\right)^2\frac{4\pi \gamma _{cn}n_c n_n \ell _B^2}{B^2} = \left(\frac{\ell _{B}}{\ell _c}\right)^2 t_{ad} \sim (0.01{\text{-}}0.1)\,t_{ad} . \end{aligned} $$(94)

In the case of the FF approach, the FF force sets a shorter timescale in which the star relaxes to a state of hydromagnetic quasi-equilibrium. The velocity of the motion that causes such relaxation can be obtained from Eq. (43), which yields fB ∼ ζnnvn. Thus, the configuration of the magnetic field and particles adjusts on a timescale

t ζ B B v n ζ n n B f B 4 π ζ n n B 2 B 2 ζ γ nc n c t ad , $$ \begin{aligned} t_{\zeta B} \sim \frac{\ell _B}{v_{n}} \sim \frac{\zeta n_n \ell _B}{f_B} \sim \frac{4\pi \zeta n_n \ell _B^2}{B^2} \sim \frac{\zeta }{\gamma _{nc}n_c}t_{ad}, \end{aligned} $$(95)

which should be identified with an Alfvén-like time and must be much shorter than the dynamical time tB of our interest for our simulations to accurately represent the long-term evolution. For this purpose, we use ζ/(γncnc) = 10−2 − 10−5 in our simulations, which satisfies this condition, but is of course much too large for a realistic Alfvén time. Since, under axial symmetry, there is no toroidal gradient of the chemical potentials to balance the toroidal magnetic force, toroidal motions will rearrange the magnetic field on a timescale tζB so the toroidal component of the force is null in the quasi-stationary state.

7.3. Magnetic energy dissipation

The loss of total magnetic energy (UB) due to ambipolar diffusion can be computed by taking the derivative of the magnetic energy and then using Eq. (1):

U ˙ B = 1 4 π V B · B t d V = 1 4 π V core B · × ( v c × B ) d V + U ˙ B , Ext , $$ \begin{aligned} \begin{split} \dot{U}_B&=\frac{1}{4\pi }\int _{\mathcal{V} _\infty } \boldsymbol{B}\cdot \frac{\partial \boldsymbol{B}}{\partial t}\,d\mathcal{V} \\&=\frac{1}{4\pi }\int _{\mathcal{V} _\text{ core}} \boldsymbol{B}\cdot \boldsymbol{\nabla }\times \left(\boldsymbol{v}_c\times \boldsymbol{B}\right)\,d\mathcal{V} + \dot{U}_{B\text{,} \text{ Ext}}, \end{split} \end{aligned} $$(96)

where 𝒱 stands for all space and UB, Ext is the magnetic energy outside of the core. Integrating this expression by parts and using Eq. (11), we obtained

U ˙ B = V core v c · f B d V , $$ \begin{aligned} \dot{U}_B=-\int _{\mathcal{V} _\text{ core}}\boldsymbol{v}_c\cdot \boldsymbol{f}_{B}\,d\mathcal{V} , \end{aligned} $$(97)

which is the net power transfer between the fluids and the magnetic field. We note that the boundary term from the integration by parts (i.e., minus the Poynting flux integrated over the surface of the core) cancels with U ˙ B , Ext $ \dot U_{B\text{, Ext}} $.

In the case of the FF approach, the latter can be further disassembled using Eqs. (13) and (44)

U ˙ B = V core v ad · ( γ cn n c n n v ad f c ) d V V core v n · ( ζ n n v n f n f c ) d V . $$ \begin{aligned} \begin{split} \dot{U}_B =&-\int _{\mathcal{V} _\text{ core}}\boldsymbol{v}_{ad}\cdot \left(\gamma _{cn}n_c n_n\boldsymbol{v}_{ad} -\boldsymbol{f}_{c}\right)\,d\mathcal{V} \\&-\int _{\mathcal{V} _\text{ core}}\boldsymbol{v}_n\cdot \left(\zeta n_n\boldsymbol{v}_n-\boldsymbol{f}_{n}-\boldsymbol{f}_{c}\right)\,d\mathcal{V} . \end{split} \end{aligned} $$(98)

Here, we identify the energy loss due to binary collisions between charged particles and neutrons as

L ad = V core γ cn n c n n | v ad | 2 d V $$ \begin{aligned} L_{ad}=\int _{\mathcal{V} _\text{ core}} \gamma _{cn}n_c n_n|\boldsymbol{v}_{ad}|^2 \,d\mathcal{V} \, \\ \end{aligned} $$(99)

and the energy loss due to the FF on the neutrons as

L ζ = V core ζ n n | v n | 2 d V . $$ \begin{aligned} L_{\zeta }=\int _{\mathcal{V} _\text{ core}} \zeta n_n|\boldsymbol{v}_n|^2 \,d\mathcal{V} . \end{aligned} $$(100)

The rate at which energy goes into (or comes from) the charged particles can be identified as

U ˙ c = V core v c · f c d V . $$ \begin{aligned} \dot{U}_c =-\int _{\mathcal{V} _\text{ core}} \boldsymbol{v}_c\cdot \boldsymbol{f}_{c} \,d\mathcal{V} . \end{aligned} $$(101)

This expression can be rearranged by replacing Eq. (10) and integrating by parts. Then, using Eq. (7) yields

U ˙ c = V core n c χ c μ · v c d V = V core n c δ μ c c 2 Φ · v c d V . $$ \begin{aligned} \begin{split} \dot{U}_c&=\int _{\mathcal{V} _\text{ core}} n_c\chi _c\boldsymbol{\nabla }\mu \cdot \boldsymbol{v}_c \,d\mathcal{V} \\&=-\int _{\mathcal{V} _\text{ core}} n_c\frac{\delta \mu _c}{c^2}\boldsymbol{\nabla }\Phi \cdot \boldsymbol{v}_c \,d\mathcal{V} . \end{split} \end{aligned} $$(102)

In the last equation, we have used Eq. (8). Thus, U ˙ c $ -\dot U_c $ could be interpreted as the mechanical work per unit time done by gravity on the charged particle fluid. Analogously, the work per unit time done by gravity on the neutrons can be identified as

U ˙ n = V core n n δ μ n c 2 Φ · v n d V . $$ \begin{aligned} -\dot{U}_n =\int _{\mathcal{V} _\text{ core}} n_n\frac{\delta \mu _n}{c^2}\boldsymbol{\nabla }\Phi \cdot \boldsymbol{v}_n \,d\mathcal{V} . \end{aligned} $$(103)

Here, U ˙ c $ \dot U_c $ and U ˙ n $ \dot U_n $ can be positive or negative. We note, however, that these terms are a direct consequence of the adopted Newtonian approximation (in particular, the way we account for redshifts) and they do not appear in the fully relativistic treatment (Gusakov et al. 2017; Moraga et al. 2025). Combining the equations above, the net rate of change of the total magnetic energy can be written as

U ˙ B = L ad L ζ U ˙ c U ˙ n . $$ \begin{aligned} \dot{U}_B = -L_{ad}-L_{\zeta }-\dot{U}_c-\dot{U}_n. \end{aligned} $$(104)

8. Results

8.1. Comparison between the different approaches

In this section, we compare the different methods described earlier by evaluating the neutron and ambipolar velocities. The different methods are compared to the semi-analytical velocities obtained for the magnetic field models studied in this work.

In Fig. 3, we show the relative chemical potential perturbations, χn and χc, and the velocity fields for each magnetic field model, evaluated with the explicit semi-analytical approach described in Sect. 3.1 using numerical data from the HHJ EoS. We note, however, that model IV is not in quasistationary equilibrium since, for this model, fB, ϕ is non-zero. Thus, strictly speaking, the procedure outlined in Sect. 3.1 does not apply. Aside from this caveat, we see that the neutron velocity is much larger than the ambipolar velocity for all magnetic field models studied and that this difference becomes larger as the magnetic field has a more complex structure, which is consistent with Eq. (93). This can be seen more clearly in Table 5, where the non-purely dipolar and non-equatorially symmetric models III and IV yield the largest ratios ⟨vn⟩/⟨vad⟩.

Table 5.

Root mean square velocities.

8.1.1. Solutions for the pseudo-spectral approach

As described in Sect. 3.2, the system of equations from Sect. 2 can be rewritten for a direct solution with a pseudo-spectral code (using Eqs. (28), (37), (38), (39), and (41)). The solution is implemented with Dedalus.

Figures 4 and 5 show radial profiles at two angles for the chemical potential perturbations and for the neutron and ambipolar velocities using magnetic field models I and II. For the pseudo-spectral approach, analytical fitting formulae for the background quantities (nn, nc, γcn, and μ; hereafter, HHJ-fit) were used (see Table 6), since using numerical data from the HHJ EoS yields incorrect results for the velocities at the crust-core interface. The slight difference between the HHJ-fit model and HHJ is shown in Fig. 6. In Figs. 4 and 5 we see there is very good agreement between the output of Dedalus and the semi-analytical solution evaluated using the explicit approach in most of the star. However, there are minor discrepancies close to the crust-core interface. This is consistent with the fact that nc, while overall quite similar in the HHJ-fit and HHJ models, differs up to ∼0.2% close to the crust-core interface (see Fig. 6).

thumbnail Fig. 4.

Comparison of the pseudo-spectral approach (dashed line) and the semi-analytical solution obtained using the explicit approach (continuous line) for magnetic field model I. The solution from the pseudo-spectral approach uses a polynomial fit for the relevant background radial profiles. From top to bottom: (a) χn, (b) χc, (c) vn, r, and (d) vad, r. All quantities are in code units, plotted as functions of r for θ = π/3 and θ = π/2.

thumbnail Fig. 5.

Comparison of the output of the pseudo-spectral approach (dashed line) and the semi-analytical solution obtained using the explicit approach (continuous line) for magnetic field model II. The solution from the pseudo-spectral approach uses a polynomial fit for the relevant background radial profiles. From top to bottom: (a) χn, (b) χc, (c) vn, r, and (d) vad, r. All quantities are in code units, plotted as functions of r for θ = π/3 and θ = π/2.

Table 6.

Analytical fit of the radial profiles for the HHJ EoS.

thumbnail Fig. 6.

Relative difference between the analytical fit of the radial profiles obtained for the HHJ EoS (see Table 6) and the data extracted from tables. That is, |xfit(r)/x(r)−1|, for x = nn, nc, μ, and γcn.

8.1.2. Solutions for the FF approach

As demonstrated in Sect. 4, the velocities obtained in the FF approach will differ from the real ones, with their difference increasing with ζ. From the expression used in this approach for vn (Eq. (44)), it is not evident for what value of ζ the obtained velocities (and other relevant variables) will resemble those obtained by the explicit approach with reasonable accuracy. It is also not obvious whether this value would be large enough so we can numerically invert the matrix Λ, which, as mentioned in Sect. 4.1, becomes singular for ζ = 0. Therefore, a numerical test for different values of ζ becomes necessary.

In Fig. 7, we show a comparison between four very different values of ζ and the semi-analytical result obtained using the explicit approach, which corresponds to ζ = 0 (hereafter, we refer to ζ in the dimensionless units of Table 1). The computation is done using magnetic field model II, as this is specifically built so that vn, r = vad, r = 0 at the crust-core interface, which in the FF approach is taken as a boundary condition. It can be observed that even for values as high as ζ = 10−2, the velocities and relative chemical potential perturbations are qualitatively similar to their semi-analytical counterpart in most of the volume, but they differ in magnitude. For ζ ≤ 10−3, the different variables also show similar qualitative behavior in the whole volume, but the difference in their magnitude decreases. For instance, for ζ = 10−3, the maximum neutron velocity is ∼47% smaller than the semi-analytical value, suggesting that this value of ζ may still be too large for an accurate evaluation, for ζ = 10−4 the maximum velocity is ∼10% smaller, while for ζ = 10−5, it is just ∼1.2% smaller. In practice, as discussed in Sect. 8.2.1, for time-evolution simulations, we are using values of ζ in the range 10−4–10−3, as smaller values yield a much longer integration time.

thumbnail Fig. 7.

Comparison between the explicit semi-analytical evaluation of the velocities and relative chemical potential perturbations (corresponding to ζ = 0) and the numerical calculation of the same quantities using the FF approach with different values of ζ. For vn and vad, lines represent the direction of their poloidal component and color its magnitude. This comparison is made for magnetic field model II, using the HHJ EoS. The computation is done over an equally spaced grid (u = 1 in equation (55)) of resolution Nr = 60, Nθ = 91, using an analytical expression for fB to minimize numerical errors.

The same behavior can also be observed in Fig. 8, where we plot vn, r as a function of r for θ = π/2 for different magnetic field models and for different values of ζ, finding convergence for small ζ for all models. However, for model I, the radial velocity near the crust-core interface obtained with the FF approach differs from the one obtained using the explicit approach because the latter is not null at the crust-core interface, whereas null radial velocities are enforced as boundary conditions in the FF approach. We note, however, that the velocities are substantially different only in a thin layer of thickness ∼0.05 R. We also note that for model III the curve using ζ = 10−5 has a sudden change of sign close to r = 0, which is not observed for the other models, whose curves go smoothly to zero. This suggests that such a value of ζ may be too small, as it yields an almost-singular Λ matrix (see Eq. (59)).

thumbnail Fig. 8.

Radial component of the neutron velocity, vn, r, for θ = π/2 as a function of r for magnetic field models I, II, III, and IV, all with the HHJ EoS. The evaluation is done with the explicit approach for ζ = 0 (no FF) and numerically using the FF approach with different values of ζ > 0.

The equations for the FF approach can also be solved within the pseudo-spectral code Dedalus. Figures 9 and 10 compare the neutron velocity field profiles obtained through the explicit approach and the artificial friction approach, where the latter was implemented using both a finite difference method and Dedalus. The figures show magnetic field models I and II at a given angle and with the value of ζ = 10−3, using the HHJ EoS. Unlike the pseudo-spectral approach, no explicit analytical fit for the relevant background radial profile is used. The results show a very good agreement between the pseudo-spectral and the finite difference implementation of the FF approach. However, for time-evolving simulations, we restrict to the finite difference implementation, as our code was developed exactly for this purpose and has already been extensively tested.

thumbnail Fig. 9.

(a) Radial and (b) polar components of the neutron velocity for θ = π/3 and θ = π/2 as functions of r for the magnetic field model I using the HHJ EoS. The evaluation is done semi-analytically (corresponding to ζ = 0; continuous line) and numerically, using the FF approach with Dedalus (dashed line) and our finite difference code (dotted line), both using ζ = 10−3.

thumbnail Fig. 10.

(a) Radial and (b) polar components of the neutron velocity for θ = π/3 and θ = π/2 as functions of r for the magnetic field model II using the HHJ EoS. The evaluation is done semi-analytically (corresponding to ζ = 0; continuous line) and numerically, using the FF approach with Dedalus (dashed line) and our finite difference code (dotted line), both using ζ = 10−3.

8.2. Hydro-magnetic evolution

In this work, we have explored different methods of obtaining the neutron and ambipolar velocities for a given magnetic field configuration, with the intention of finding a reliable method to evolve the magnetic field in time. Sadly, while we can solve the equations from Sect. 2 for analytically given magnetic field configurations using the semi-analytical approaches of Sect. 3, we have not been successful in our efforts to iterate such procedures in time to evolve the magnetic field. The reason for this seems to be related to two factors: First, the evaluation of the neutron velocity involves a large number of spatial derivatives of the magnetic field (five derivatives for vn, θ; see Sect. 3.1), which require high resolution to be solved properly. For a fixed magnetic field configuration, these can be computed to a reasonable accuracy, but in time-evolving simulations, numerical errors in their calculation accumulate. Second, for an arbitrary magnetic field, we do not have the freedom to fix boundary conditions for the velocities, whose values at the crust-core interface are completely determined by the magnetic field. Furthermore, even if the initial seed for the magnetic field is chosen to satisfy a given condition (for instance, null radial velocities), it is unclear if this magnetic field will evolve in time in such a way that the boundary conditions continue to be satisfied.

On the other hand, the FF approach offers a reliable way of evolving the magnetic field in time. Also, in the present version of the code, we have resolved some of the main caveats in the work of Castillo et al. (2020). Namely, in that version, time derivatives in the continuity Eqs. (2) and (3) were not neglected and were used to evolve the density perturbations δnn and δnc in time, which requires resolving an extremely short timescale tζp ∼ χ0tζB ∼ 10−10(B/1013G)2tζB, which is the analog of the propagation time of sound waves (p-modes) when inertial effects are taken into account. Thus, performing simulations in which we could numerically resolve both timescales, with the available computational resources, required artificially increasing the magnetic field strength up to unrealistic values B ≳ 1017G, so tζp and tζB could get closer. In the current version, however, time derivatives in the continuity equations are neglected, in practice replacing the need to follow the evolution of density perturbations in favor of directly solving for the chemical potential perturbations from the linear system of Eqs. (60). Therefore, the shortest timescale to be resolved in the new scheme is tζB, and the two relevant timescales, tζB and tad, scale ∝B−2, allowing us to perform simulations for one field strength and scale them to any other, as done by Moraga et al. (2024) for the magneto-thermal evolution in the high-temperature strong-coupling regime. Thus, in this subsection, we restrict ourselves to time-evolving simulations using the FF approach.

8.2.1. Convergence tests

The value of ζ used not only determines how close we are to the real velocities. In a time-evolving simulation, it also fixes the ratio between the dynamical timescales tad and tζB. For a star of B ∼ 1013 G we have an Alfvén time of tA ∼ 10 s. Since we have identified tζB with an Alfvén-like timescale, a realistic value of ζ that satisfies tA ∼ tζB would be ζ = tζB/tad ∼ 10−16 (in dimensionless units), making it impossible to resolve both timescales in a simulation. Therefore, in our simulations, we use much larger values of ζ so that both dynamical timescales are close enough to be resolved.

To determine the most appropriate range for ζ, we have performed simulations for different values, using magnetic field model II as the initial condition. These simulations were done over a non-homogeneous grid of resolution Nr = 60, Nθ = 91, setting u = 2/3 in Eq. (55). This is done so the grid cells become larger close to the center, yielding a less restrictive Courant–Friedrichs–Lewy condition (Courant et al. 1928), at the expense of losing numerical accuracy close to the center of the star. To facilitate comparison with the results of Castillo et al. (2020), hereafter we computed tad and tζB (Eqs. (90) and (95)) using B = ⟨B(t = 0)⟩, B = R/4, and stellar parameters (nn, nc, γcn) evaluated at the center of the star (see Table 2). The results are in Fig. 11. It can be seen in the figure that the simulations show very similar behavior. Also, as the value of ζ gets smaller, simulations appear to converge to the same curve, particularly for ζ ≲ 10−3, which suggests that this value of ζ is good enough for our purposes.

thumbnail Fig. 11.

Time evolution for magnetic field model II with background NS provided by the EOS HHJ using different values of ζ. (a) Evolution of the total magnetic energy, normalized by its initial value. (b), (c) Evolution of the rms values of the neutron velocity and ambipolar velocity, respectively. Vertical lines mark the value of tζB/tad for each simulation.

In Sect. 8.1.2, we show how, for a fixed magnetic field, the FF approach yields velocity fields close to the semi-analytical ones only when ζ ≲ 10−5, which seems to contradict our previous statement. However, there is a key difference. In our tests with a fixed magnetic field, the only mechanism to diminish the FF force compared to the real physical forces is to take a smaller value of ζ. In time-evolving simulations, however, the magnetic field will adjust on a timescale tζB to a configuration in which the FF force progressively decreases, thereby yielding velocities that more closely approximate the real velocities. To show this more clearly, we focus on the simulation with ζ = 10−4. Snapshots of the evolution can be seen in Fig. 12. In Fig. 13(a), we observe that the FF force is always weak and becomes progressively weaker compared to the other forces, except for fn, which also decreases over time due to ambipolar diffusion. Figure 13(b) shows very good agreement between the left and right-hand sides of Eq. (104), where the left-hand side is computed explicitly as the numerical time derivative of the magnetic energy.

thumbnail Fig. 12.

Evolution of magnetic field model II using ζ = 10−4. We used a grid of Nr = 60 radial steps and Nθ = 91 polar steps inside the core, NExp = 40 external multipoles, u = 2/3, and the HHJ EoS. From left to right: Configuration of the magnetic field, where lines represent the poloidal magnetic field (labeled by the magnitude of α) and colors the poloidal potential α; χn and χc, both in units of χ0 = B02/4πn0μ0; neutron velocity, vn, and ambipolar diffusion velocity, vad, where arrows represent the direction and colors the magnitude normalized to R/t0. Rows correspond to different times: t = 0, t = tζB = 10−4tad, and t = 0.1 tad.

thumbnail Fig. 13.

For the simulation of Fig. 12. (a) Time evolution of the rms force densities ⟨fB⟩, ⟨fn⟩, ⟨fc⟩, and ⟨fζ⟩, all normalized by ⟨fB(t = 0)⟩. (b) Energy conservation. All terms are in units of the total initial magnetic energy. The vertical line marks tζB/tad.

For completeness, we also include a convergence test for Nr,  Nθ, and NExp. Figure 14(a) shows a fast convergence in Nr and Nθ, indicating that the grid resolution (Nr × Nθ = 60 × 91) used for the simulations in this paper is large enough. Figure 14(b) shows no significant gain by increasing the multipolar resolution when NExp > 10; this suggests that the values used in this paper (NExp = 40 for all simulations except the one displayed in Fig. 19) are large enough.

thumbnail Fig. 14.

Differences in α(r, π/2) at t = 0.1 tad for model II using different resolutions: (a) Using a fixed number of NExp = 40 external multipoles and five different grid resolutions Nr × Nθ. To aid visualization, α*, which is α at the highest resolution used (75 × 113), was subtracted. (b) Using a fixed grid resolution of 60 × 91 and five different resolutions for the number of multipoles NExp. To aid visualization, α80, which is α at the highest resolution used (NExp = 80), was subtracted. For all simulations, ζ = 10−3 and u = 2/3.

The results described in this section apply not only to equatorially symmetric magnetic field configurations. Figure 15 shows the evolution of the magnetic energy and rms velocities for different values of ζ using the magnetic field model IV, which is more complex, as it is not equatorially symmetric and has a poloidal and a toroidal component. Here, we again see that for ζ ≲ 10−3, UB and the rms velocities appear to converge to the same curve at times larger than the value of tζB for each simulation. This is particularly evident for the toroidal part of the magnetic field, whose magnetic energy is displayed in panel (b). The rapid decay of the toroidal magnetic energy at early times, on a timescale tζB, corresponds to a rearrangement of the magnetic field in which the toroidal component of the magnetic force vanishes (see Sect. 7.1).

thumbnail Fig. 15.

Plots for magnetic field model IV using different values of ζ: (a), (b) Evolution of the poloidal and toroidal magnetic energy, respectively, normalized by the initial value of the magnetic energy of the star. (c), (d) Evolution of the rms poloidal neutron and ambipolar velocity. Vertical lines correspond to the value of tζB/tad in each simulation.

8.2.2. Long-term evolution

In Sect. 8.2.1, we have shown that the FF approach is a reliable method for performing simulations for the long-term evolution of the magnetic field under ambipolar diffusion. Here, we further describe the output of such simulations.

We focus on the evolution of magnetic field model II in a star with background density profiles obtained from the HHJ EoS. This simulation was also analyzed in the previous section, and snapshots of the evolution are given in Fig. 12. In this figure, we see that the magnetic field evolution occurs in two stages: First, there is a small adjustment to the magnetic field configuration and density perturbations on a timescale tζB, in which the FF force, which is initially small due to the chosen value of ζ, becomes even smaller [see Fig. 13(a)], indicating that the magnetic field approaches a state of quasi-equilibrium in which Eq. (12) is satisfied.

This quasi-equilibrium state is slowly eroded by ambipolar diffusion. As the charged particles move relative to the neutrons, the magnetic field and particles adjust, moving through a continuum of successive hydromagnetic quasi-equilibria and eventually reaching a final equilibrium state in which vn = vad = 0. This occurs on a timescale tB, which for the simulation shown in Fig. 12 is roughly at tB ≃ 0.1tad, as can be appreciated in Fig. 13(a). We observe in Fig. 11(b) and (c) that in this final state, the fluid velocities indeed become very small, thus halting the evolution of the field.

As discussed in Sect. 7.1, this kind of axially symmetric equilibrium is called GS equilibrium, in which α is a solution of the GS Eq. (88), χc = χc(α), and χn is uniform. This can be observed in the last row of Fig. 12 and in Fig. 16 (at t = 0.1tad), suggesting that effectively the magnetic field has evolved toward a GS equilibrium.

thumbnail Fig. 16.

For the simulation of Fig. 12: scatter plot of χn and χc versus α for t = 0, t = tζB, and t = 0.1tad.

The conclusions obtained from the time evolution of magnetic field model II remain true for more complex configurations such as model IV, which has poloidal and toroidal components that are not equatorially symmetric. Snapshots of the time evolution for this model can be observed in Fig. 17, while the evolution of the rms forces is in Fig. 18(a), and the energy conservation is shown in Fig. 18(b). We note that the magnetic field is initially not in a state of quasi-equilibrium, as it has a strong toroidal magnetic force. As expected, this toroidal force becomes progressively weaker, evolving on a timescale tζB. In Fig. 17 at t = tζB, we see how quasi-equilibrium is not yet reached as β is not a function of α. This condition is more clearly satisfied at t = 5tζB, where ⟨fB, Tor⟩/⟨fB, Pol⟩≈6 × 10−3. Here, we also see that the toroidal magnetic field is confined to regions of closed poloidal field lines, forming “twisted tori,” which is a consequence of the condition β = β(α). At this point, χn and χc are of the same order. However, as the system evolves due to ambipolar diffusion, χn becomes progressively smaller and more uniform [see ⟨fn⟩ in Fig. 18(a)]. As expected, after the GS equilibrium is reached, χc is a function of α, and the velocities are much smaller than their initial values, indicating that the system has reached its final equilibrium.

thumbnail Fig. 17.

Evolution of magnetic field model IV, using ζ = 10−3. We used a grid of Nr = 60 radial steps and Nθ = 91 polar steps inside the core and NExp = 40 external multipoles, and the HHJ EoS. From top to bottom: Configuration of the magnetic field, where lines represent the poloidal magnetic field (labeled by the magnitude of α) and colors the toroidal potential β; χn and χc, both in units of χ0 = B02/4πn0μ0; poloidal component of the neutron velocity, vn, and ambipolar diffusion velocity, vad, where arrows represent the direction and colors the magnitude normalized to R/t0. Columns correspond to different times: t = 0, tζB, 5 tζB, 0.1 tad, and tad.

thumbnail Fig. 18.

For the simulation of Fig. 17: (a) Time evolution of the rms force densities ⟨fB, Pol⟩, ⟨fB, Tor⟩, ⟨fn⟩, ⟨fc⟩, and ⟨fζ, Pol⟩, all normalized by ⟨fB, Pol(t = 0)⟩. (b) Energy conservation. The different terms are in units of the total initial magnetic energy. (c) External magnetic energy stored in multipole l, UB, l, normalized by the total initial magnetic energy, where l = 1, …, NExp. The vertical line corresponds to tζB/tad.

Figure 18(b) shows energy conservation for this simulation. There is overall good agreement between the curves of U ˙ B t $ \dot U_{B}t $, and ( L ad + L ζ + U ˙ c + U ˙ n ) t $ -(L_{ad}+L_{\zeta}+\dot U_c+\dot U_n)t $, aside from a very small mismatch around t ∼ 0.05tad, which we attribute to numerical viscosity. Compared to the simulation of Fig. 12, here we see a larger contribution of Lζ. This is because of two factors. First, in this simulation, the magnetic field is initially not in a quasi-equilibrium state. Thus, there is a noticeable initial rearrangement of the field and the fluids on a timescale tζB. During the initial rearrangement, energy is dissipated due to physical processes that involve the propagation and damping of sound and Alfvén waves, which in our model are mimicked by the FF. The rate at which this energy is dissipated is accounted for in Lζ. In this early stage, we have vn ∼ fB/(ζnn), thus Lζ ∼ ζnnvn2R3 ∝ 1/ζ. Therefore, the energy dissipated during the unwinding of the magnetic field lines is ∼LζtζB, which does not depend on ζ (as long as it is small enough). Second, after the star reaches hydromagnetic quasi-equilibrium, vn converges to the real velocity, which does not depend on ζ, and therefore Lζ ∝ ζ, which is larger in this simulation (ζ = 10−3 for the simulation of Fig. 17 and 10−4 for the simulation of Fig. 12). For completeness, Fig. 18(c) shows energy stored in each multipole of the magnetic field outside the core. We note that multipoles l ≥ 4 do not make a relevant contribution to the energy throughout the time evolution. We also note that even for more complex initial conditions such as model IV, only a small number of external multipoles is needed to properly resolve the external field evolution. Thus, the number of multipoles used in our simulations, NExp ≥ 27, is large enough.

The results presented in this section are consistent with those reported in Castillo et al. (2020). The time evolution for all simulations presented here qualitatively follows the same stages, and in all cases, the final state corresponds to a GS equilibrium. For completeness, Fig. 19 shows a comparison between the final equilibrium state for model IV, computed by the current version of the code, which, as mentioned before, can be rescaled to any realistic value of the magnetic field strength; and the results presented in Castillo et al. (2020) for the same magnetic field model, in a simulation performed for an unrealistically high magnetic field strength of B0 = 1.8 × 1017G. We see that the final equilibrium configuration reported in Castillo et al. (2020) is correctly reproduced, and it is found not to be significantly affected by the, now realistic, magnetic field strength used.

thumbnail Fig. 19.

Scatter plot of β, χn, and χc versus α for the final equilibrium configuration (at t = tad) of magnetic field model IV for two simulations, using the toy model EoS. Blue dots correspond to the results presented in Castillo et al. (2020), which are computed using B0 = 1.8 × 1017G (i.e., χ0 = 1.67 × 10−3); orange dots correspond a simulation performed with the current version of the code, using ζ = 3 × 10−3, Nr = 60 radial steps, Nθ = 91 polar steps inside the core, NExp = 27 external multipoles, and u = 1/2 (the same parameters as in Castillo et al. 2020). All quantities are normalized as described in Table 1.

8.2.3. Dependence on the equation of state

In Castillo et al. (2020), we performed our simulations using the toy model EoS, described in Sec. 5. While it is a simple analytical model, it helped us correctly analyze the impact of the stable stratification of NS matter on the magnetic field evolution. However, the question remains if using more realistic density profiles could significantly impact the evolution of the field. In particular, in real NSs, strong interactions may play a significant role, which could not be observed in the previous simulations using the toy model.

Here, as detailed in Sect. 5, we use the EoSs HHJ, BSk24, BSk25, and BSk26, all of which consider the effect of strong interactions on the chemical potentials by means of a coefficient K ≠ 0. Results for simulations using the purely poloidal magnetic field model III with ζ = 10−3 are shown in Fig. 20. Here, we see how, for all EoSs considered, the magnetic field decays and eventually reaches an equilibrium state [see panel (a)], but the time at which this occurs for each is not the same. The toy model reaches equilibrium on a timescale ∼0.1 tad, simulations using HHJ, BSk24, and BSk25 reach equilibrium in ∼0.05 tad, while for BSk26 equilibrium is reached around 0.01 tad. These results are consistent with Eq. (94), which states that the timescale for magnetic field evolution under ambipolar diffusion is shorter than tad by a factor (B/c)2. In this comparison, only c varies between EoSs, as seen in Fig. 1(c), while B remains unchanged. We note that the toy model yields the smallest value of c for all r and thus the largest estimate for tB among the stellar models studied. Regarding HHJ, BSk24, and BSk25, they yield similar values of c, while in comparison, BSk26 yields the largest value and thus the shortest estimate for tB. This is further supported by Fig. 20(b)-(d), where we see the rms velocities and their ratio ⟨vad⟩/⟨vn⟩ as functions of time. We note that this ratio remains ∼0.2 for most of the evolution when using the radial density profiles from the toy model. In contrast, for BSk26, this ratio is considerably lower (∼0.02), consistent with Eq. (93).

thumbnail Fig. 20.

Time evolution for the initial purely poloidal magnetic field model III with five different EoSs using ζ = 10−3, a grid of Nr = 60 radial steps, Nθ = 91 polar steps inside the core, NExp = 40 external multipoles, and u = 2/3. The panels show the following variables: (a) Magnetic energy in the NS core, normalized by its initial value. (b) and (c) rms neutron and ambipolar velocity, ⟨vn⟩ and ⟨vad⟩, respectively. (d) The ratio ⟨vad⟩/⟨vn⟩. For each model, the timescales tζB and tad, and the velocities are evaluated considering the stellar parameters of Table 2. The vertical line marks the dimensionless value of ζ = tζB/tad, which is fixed to be the same for all EoSs.

Results for magnetic field model IV, also using ζ = 10−3, can be seen in Fig. 21. Panels (a) and (b) show the evolution of the poloidal and toroidal magnetic energy, respectively; we again see how, for the BSk26 star, the poloidal magnetic energy decays faster than for the other stellar models. On the other hand, the toroidal magnetic field decays faster for the toy model than for all the other EoSs, all of which decay on a similar timescale. The dissipation of the toroidal energy occurs mainly due to the unwinding of the toroidal magnetic field in the regions with poloidal field lines closing outside the core (see Sect. 7.1), a process with a typical timescale tζB. This timescale is proportional to nn (see Eq. (95)), which decreases toward the surface of the star (we note that in the plots, the timescales are evaluated at the center of the star). Thus, the unwinding of the field lines close to the surface is expected to be faster. Figure 1(a) shows that close to the crust-core interface, nn is smaller for the toy model EoS than for the more realistic EoSs, explaining the faster decay of the toroidal field for that case. Also, the magnetic field in that region is stronger in model IV than in model III, making the difference in nn have a larger impact on the evolution of the magnetic energy. Thus, it is not that surprising that the toroidal magnetic energy decays faster for the simulation using the (unrealistic) toy model. Consequently, the toroidal component of the velocities is expected to be larger for the toy model; panels (c) and (d) of Fig. 21 show that, for the toy model EoS, the rms values of the neutron and ambipolar velocity are larger than for the other EoSs, as these velocity averages are dominated by the toroidal component of the velocities. We note that the curves for ⟨vad⟩/⟨vn⟩ follow a similar trend to the simulation in Fig. 20. That is, for the toy model EoS, which has the largest ratio B/c, we have the highest ⟨vad⟩/⟨vn⟩ ratio. For the more realistic EoSs – HHJ, BSk24, and BSk25 – the neutron velocity is considerably larger than the ambipolar velocity, consistent with a ratio B/c ≃ 0.07. In turn, in the simulation using BSk26, the ratio B/c is much smaller, consistent with Fig. 1(c).

thumbnail Fig. 21.

Same as Fig. 20 but for model IV. The variables shown in each panel are: (a), (b) Poloidal and toroidal magnetic energy in the NS core, respectively, normalized by the initial value of the total magnetic energy of the NS core. (c), (d) Root mean square neutron and ambipolar velocity, ⟨vn⟩ and ⟨vad⟩, respectively. (e) Ratio of ⟨vad⟩/⟨vn⟩.

9. Discussion and conclusions

The evolution of the magnetic field of an NS is probably responsible for much of its observed phenomenology. Initially, the magnetic field likely permeates the entire interior of the star. Therefore, understanding its evolution requires studying the key mechanisms driving it, both in the crust and the core. While crustal processes have been extensively studied and are largely understood, the same cannot yet be said for processes in the core.

Assuming an NS core composed only of “normal” (non-Cooper-paired) neutrons, protons, and electrons, its magnetic field is carried by a joint motion of the charged particles (protons and electrons), which is similar to that of the neutrons but crucially not identical because of the different density profiles entering their continuity equations (6) and (7). Their slight difference (ambipolar diffusion) causes a collisional friction that controls the timescale of this evolution, which is much longer than any of the dynamical timescales of the NS core, such as the periods of sound, gravity, or Alfvén waves. Thus, this two-fluid system can be considered to be always near a state of hydromagnetic equilibrium, where the inertial terms in the equations of motion can be ignored. In this regime, the velocity fields are determined from the force-balance and continuity equations for the two fluids (neutrons and charged particles).

Under the assumption of axial symmetry, the velocity fields of neutrons and charged particles were studied semi-analytically by Gusakov et al. (2017) and Ofengeim & Gusakov (2018) and calculated numerically by Castillo et al. (2020), who also used them to simulate the long-term evolution of the magnetic field in the NS core. For this purpose, a small FF force on the neutrons was introduced, which simplified the calculation of the velocity fields, allowing them to be calculated at every time step in order to follow the long-term evolution of the magnetic field. We found that this evolution ultimately always leads to an equilibrium state in which the magnetic force is balanced by the internal forces of the charged-particle fluid, thus satisfying the barotropic GS equation, while the neutrons reach a diffusive equilibrium that remains unaffected by the magnetic field.

In the present paper, we have addressed a few potential weaknesses of the simulations of Castillo et al. (2020), as stated in Sect. 1:

  1. The approach used involved two timescales that are very different for realistic magnetic fields. To capture both in the simulations, it was only possible to consider unrealistically high values of the magnetic field (≳1017G).

  2. The FF approach used in Castillo et al. (2020) is conceptually non-trivial. At first glance, it is not evident that it correctly reproduces the velocities needed to perform long-term time-evolving simulations.

  3. The toy model EoS we used (see Sect. 5) correctly captured the qualitative impact of stable stratification on the long-term magnetic evolution. However, the question of whether considering more realistic EoSs would significantly affect the results remains.

In order to address item 1 of the above list, we followed Moraga et al. (2024) in neglecting the time derivatives of the density perturbations in the continuity equations, thus eliminating a short timescale that was not interesting for the magnetic field evolution. This leaves only two fundamental timescales (tζB and tad) that are both ∝B−2, and this allows the simulation results to be scaled to any relevant magnetic field strength.

Item 2 in the same list was addressed analytically by showing that the exact chemical potential perturbations and velocity fields for a given magnetic field configuration correspond to the zeroth-order term in an expansion of the equations with FF in powers of the coefficient ζ. It was further addressed by comparing numerical calculations of the same quantities for both the exact equations (following an explicit and a pseudo-spectral approach) and those with FF using different values of ζ and finding good agreement for a small ζ. These calculations were done using our grid-based code developed in-house and compared against its equivalent implementation using the Dedalus code. Moreover, by following the evolution for different values of ζ, we also find convergence for sufficiently small values. However, we note that the FF approach allows one to impose boundary conditions at the crust-core interface so that no particle flows through the latter, whereas in the equations without FF, this is only possible for specific magnetic field configurations satisfying constraints that may not continue to be satisfied throughout the evolution.

Based on the semi-analytical velocities obtained using the explicit and pseudo-spectral approaches, we provide further evidence supporting the fact that the ambipolar velocity is typically much smaller than the neutron velocity (particularly for EoS BSk26, ⟨vad⟩/⟨vn⟩∼0.02) and that their ratio decreases for more complex magnetic fields. Accounting for neutron motion leads to a much faster dissipation of the magnetic field by ambipolar diffusion. Our timescale estimate for this process (for BSk24) is

t B 8 × ( 10 3 10 4 ) ( 10 14 G B ) 2 ( T 10 8 K ) 2 ( B 1 km ) 2 yr , $$ \begin{aligned} t_{B} \sim 8\times \left(10^{3}{-}10^{4}\right)\left(\frac{10^{14}\text{ G}}{B}\right)^2\left(\frac{T}{10^8\text{ K}}\right)^2\left(\frac{\ell _{B}}{1\,\text{ km}}\right)^2 \text{ yr}, \end{aligned} $$(105)

which roughly agrees with magnetar timescales.

Finally, item 3 of the above list was addressed by evolving the magnetic field for different state-of-the-art EoSs, as well as the toy model EoS, where we find qualitative agreement. The main quantitative difference is a faster evolution of the poloidal magnetic field for EoSs with smaller composition gradients.

In summary, this paper validates our previous work by supporting the correctness of the FF approximation and improves on it by neglecting the time derivatives of the density perturbations and including realistic EoSs. There are, however, several ingredients not considered in this paper that should be considered in future work:

  1. Temperature evolution: As the temperature evolves in parallel with the magnetic field, it gradually changes the values of microphysical coefficients such as collisional couplings, thus changing the timescale for the evolution of the magnetic field. On the other hand, magnetic dissipation mechanisms affect the thermal evolution of the neutron star. This magneto-thermal evolution in the NS core is being considered in Moraga et al. (2024) and Moraga et al. (2025).

  2. Magnetohydrodynamic instabilities: It is unclear if the GS equilibrium remains stable (or if stability is ever even reached) if full three-dimensional motions are allowed, as there are many non-axially symmetric instabilities that may destabilize such equilibria (Tayler 1973; Markey & Tayler 1973; Wright 1973; Flowers & Ruderman 1977). Moreover, in this state, the Lorentz force is balanced only by the charged-particle fluid consisting of protons and electrons, which behaves as a barotropic fluid. Numerical simulations suggest that there are no stable equilibria in barotropic stars (Braithwaite 2009; Akgün et al. 2013; Lander & Jones 2012; Mitchell et al. 2015; Becerra et al. 2022a,b) and that even axially symmetric instabilities can be triggered, destabilizing the field (Becerra et al. 2022b). These instabilities might still be triggered in the two-fluid system at hand, although slowed by the collisional friction between the two fluids.

  3. Muons: Adding additional species such as muons makes the charged-particle component non-barotropic, leading to less constrained equilibria that are not GS. Thus, even if magnetic fields in barotropic stars are always unstable, muons might stabilize them by stably stratifying the charged particle fluid.

  4. Superfluidity and superconductivity: At typical core temperatures, NS matter is expected to be both superfluid and superconducting. Numerical simulations have begun incorporating these effects in simplified models (see, e.g., Bransgrove et al. 2018, 2025); we note, however, that some of the microphysical input used in these studies has been criticized (Gusakov 2019). Nucleon superfluidity and superconductivity not only influence the kinetic coefficients governing magnetic field dissipation but also lead to the formation of quantized neutron vortices and magnetic flux tubes. These effects can significantly impact the magnetic field evolution described here, altering both the characteristic timescales and the structure of the final equilibrium configuration – if such a configuration exists (see Gusakov et al. 2020 for a discussion).

  5. The crust: Here, for simplicity, we have assumed the crust to be a perfect resistor, so its magnetic field reacts instantaneously to changes in the core. This is not physically justified, making it necessary to follow the evolution both in the crust and in the core in order to be astrophysically realistic. However, so far, there have been few attempts to do this. One work that has done so is Viganò et al. (2021), in which the magneto-thermal evolution of the crust is coupled with the evolution of the core, including ambipolar diffusion, although neutron motion is neglected. The recent work of Skiathas & Gourgouliatos (2024) takes a similar approach. However, in both cases, the treatment of the core is still simplified. Thus, more realistic simulations would be desirable. Whether the magnetic field evolution is faster in the core or crust depends mainly on the strength of the field and the compositional impurity of the crust and whether the matter in the core has undergone a superfluid or superconducting transition (Cumming et al. 2004; Pons & Geppert 2007; Gourgouliatos et al. 2016; Akgün et al. 2018). If the evolution is slower in the crust, it could stabilize the magnetic field in the core, leading to different kinds of equilibria.

Data availability

The data underlying this article will be shared on reasonable request to the corresponding author.


3

The prefactor of αaux given in Castillo et al. (2020) is not correct.

Acknowledgments

This work was supported by the CAS-ANID fund N°CAS220008 (F.C.), FONDECYT Projects 11230837 (F.C.), 1201582 (A.R.), and 1240697 (J.A.V.), and ANID doctoral fellowship 21210909 (N.A.M.). M.E.G. acknowledges support from the Ministry of Science and Higher Education of the Russian Federation under the state assignment FFUG-2024-0002 of the Ioffe Institute. N.A.M. and F.C. thank the University of Leeds for their hospitality.

References

  1. Akgün, T., Reisenegger, A., Mastrano, A., & Marchant, P. 2013, MNRAS, 433, 2445 [Google Scholar]
  2. Akgün, T., Cerdá-Durán, P., Miralles, J. A., & Pons, J. A. 2018, MNRAS, 481, 5331 [CrossRef] [Google Scholar]
  3. Armaza, C., Reisenegger, A., & Valdivia, J. A. 2015, ApJ, 802, 121 [Google Scholar]
  4. Ascenzi, S., Graber, V., & Rea, N. 2024a, Astropart. Phys., 158, 102935 [NASA ADS] [CrossRef] [Google Scholar]
  5. Ascenzi, S., Viganò, D., Dehman, C., et al. 2024b, MNRAS, 533, 201 [NASA ADS] [CrossRef] [Google Scholar]
  6. Becerra, L., Reisenegger, A., Valdivia, J. A., & Gusakov, M. E. 2022a, MNRAS, 511, 732 [NASA ADS] [CrossRef] [Google Scholar]
  7. Becerra, L., Reisenegger, A., Valdivia, J. A., & Gusakov, M. E. 2022b, MNRAS, 517, 560 [NASA ADS] [CrossRef] [Google Scholar]
  8. Beloborodov, A. M., & Li, X. 2016, ApJ, 833, 261 [NASA ADS] [CrossRef] [Google Scholar]
  9. Boyd, J. P. 2001, Chebyshev and Fourier Spectral Methods, 2nd edn. (Mineola, NY: Dover Publications), Dover Books on Mathematics [Google Scholar]
  10. Braithwaite, J. 2008, MNRAS, 386, 1947 [Google Scholar]
  11. Braithwaite, J. 2009, MNRAS, 397, 763 [NASA ADS] [CrossRef] [Google Scholar]
  12. Braithwaite, J., & Nordlund, Å. 2006, A&A, 450, 1077 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  13. Braithwaite, J., & Spruit, H. C. 2004, Nature, 431, 819 [Google Scholar]
  14. Braithwaite, J., & Spruit, H. C. 2006, A&A, 450, 1097 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  15. Bransgrove, A., Levin, Y., & Beloborodov, A. 2018, MNRAS, 473, 2771 [CrossRef] [Google Scholar]
  16. Bransgrove, A., Levin, Y., & Beloborodov, A. M. 2025, ApJ, 979, 144 [Google Scholar]
  17. Burns, K. J., Vasil, G. M., Oishi, J. S., Lecoanet, D., & Brown, B. P. 2020, Phys. Rev. Res., 2, 023068 [NASA ADS] [CrossRef] [Google Scholar]
  18. Castillo, F., Reisenegger, A., & Valdivia, J. A. 2017, MNRAS, 471, 507 [Google Scholar]
  19. Castillo, F., Reisenegger, A., & Valdivia, J. A. 2020, MNRAS, 498, 3000 [Google Scholar]
  20. Chandrasekhar, S., & Prendergast, K. H. 1956, Proc. Nat. Acad. Sci., 42, 5 [Google Scholar]
  21. Chodura, R., & Schlüter, A. 1981, J. Comput. Phys., 41, 68 [NASA ADS] [CrossRef] [Google Scholar]
  22. Courant, R., Friedrichs, K., & Lewy, H. 1928, Math. Ann., 100, 32 [Google Scholar]
  23. Cruces, M., Reisenegger, A., & Tauris, T. M. 2019, MNRAS, 490, 2013 [NASA ADS] [CrossRef] [Google Scholar]
  24. Cumming, A., Arras, P., & Zweibel, E. 2004, ApJ, 609, 999 [NASA ADS] [CrossRef] [Google Scholar]
  25. Dehman, C., Viganò, D., Pons, J. A., & Rea, N. 2023, MNRAS, 518, 1222 [Google Scholar]
  26. Flowers, E., & Ruderman, M. A. 1977, ApJ, 215, 302 [Google Scholar]
  27. Goldreich, P., & Reisenegger, A. 1992, ApJ, 395, 250 [NASA ADS] [CrossRef] [Google Scholar]
  28. Goriely, S., Chamel, N., & Pearson, J. M. 2013, Phys. Rev. C, 88, 024308 [NASA ADS] [CrossRef] [Google Scholar]
  29. Gourgouliatos, K. N., & Cumming, A. 2014a, Phys. Rev. Lett., 112, 171101 [NASA ADS] [CrossRef] [Google Scholar]
  30. Gourgouliatos, K. N., & Cumming, A. 2014b, MNRAS, 438, 1618 [CrossRef] [Google Scholar]
  31. Gourgouliatos, K. N., Wood, T. S., & Hollerbach, R. 2016, Proc. Nat. Acad. Sci., 113, 3944 [Google Scholar]
  32. Grad, H., & Rubin, H. 1958, J. Nucl. Energy, 7, 284 [Google Scholar]
  33. Gusakov, M. E. 2019, MNRAS, 485, 4936 [Google Scholar]
  34. Gusakov, M. E., Kantor, E. M., & Ofengeim, D. D. 2017, Phys. Rev. D, 96, 103012 [Google Scholar]
  35. Gusakov, M. E., Kantor, E. M., & Ofengeim, D. D. 2020, MNRAS, 499, 4561 [Google Scholar]
  36. Harding, A. K. 2013, Front. Phys., 8, 679 [Google Scholar]
  37. Heiselberg, H., & Hjorth-Jensen, M. 1999, ApJ, 525, L45 [Google Scholar]
  38. Hollerbach, R., & Rüdiger, G. 2002, MNRAS, 337, 216 [NASA ADS] [CrossRef] [Google Scholar]
  39. Hoyos, J., Reisenegger, A., & Valdivia, J. A. 2008, A&A, 487, 789 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  40. Hoyos, J. H., Reisenegger, A., & Valdivia, J. A. 2010, MNRAS, 408, 1730 [CrossRef] [Google Scholar]
  41. Igoshev, A. P., Popov, S. B., & Hollerbach, R. 2021, Universe, 7, 351 [NASA ADS] [CrossRef] [Google Scholar]
  42. Igoshev, A. P., Hollerbach, R., & Wood, T. 2023, MNRAS, 525, 3354 [Google Scholar]
  43. Jones, P. B. 2001, MNRAS, 321, 167 [Google Scholar]
  44. Kaspi, V. M. 2010, Proc. Nat. Acad. Sci., 107, 7147 [NASA ADS] [CrossRef] [Google Scholar]
  45. Lander, S. K., & Gourgouliatos, K. N. 2019, MNRAS, 486, 4130 [NASA ADS] [CrossRef] [Google Scholar]
  46. Lander, S. K., & Jones, D. I. 2012, MNRAS, 424, 482 [Google Scholar]
  47. Lander, S. K., Haensel, P., Haskell, B., Zdunik, J. L., & Fortin, M. 2021, MNRAS, 503, 875 [Google Scholar]
  48. Marchant, P., Reisenegger, A., & Akgün, T. 2011, MNRAS, 415, 2426 [NASA ADS] [CrossRef] [Google Scholar]
  49. Marchant, P., Reisenegger, A., Valdivia, J. A., & Hoyos, J. H. 2014, ApJ, 796, 94 [Google Scholar]
  50. Markey, P., & Tayler, R. J. 1973, MNRAS, 163, 77 [CrossRef] [Google Scholar]
  51. Mereghetti, S. 2008, A&ARv, 15, 225 [NASA ADS] [CrossRef] [Google Scholar]
  52. Mitchell, J. P., Braithwaite, J., Reisenegger, A., et al. 2015, MNRAS, 447, 1213 [Google Scholar]
  53. Moraga, N. A., Castillo, F., Reisenegger, A., Valdivia, J. A., & Gusakov, M. E. 2024, MNRAS, 527, 9431 [Google Scholar]
  54. Moraga, N. A., Castillo, F., Ofengeim, D. D., et al. 2025, arXiv e-prints [arXiv:2505.18733] [Google Scholar]
  55. Ofengeim, D. D., & Gusakov, M. E. 2018, Phys. Rev. D, 98, 043007 [Google Scholar]
  56. Passamonti, A., Akgün, T., Pons, J. A., & Miralles, J. A. 2017, MNRAS, 465, 3416 [Google Scholar]
  57. Pethick, C. J. 1992, in Structure and Evolution of Neutron Stars, eds. D. Pines, R. Tamagaki, & S. Tsuruta, 115 [Google Scholar]
  58. Pons, J. A., & Geppert, U. 2007, A&A, 470, 303 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  59. Pons, J. A., Miralles, J. A., & Geppert, U. 2009, A&A, 496, 207 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  60. Reisenegger, A. 2009, A&A, 499, 557 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  61. Reisenegger, A., & Goldreich, P. 1992, ApJ, 395, 240 [Google Scholar]
  62. Reisenegger, A., Prieto, J. P., Benguria, R., Lai, D., & Araya, P. A. 2005, in Magnetic Fields in the Universe: From Laboratory and Stars to Primordial Structures, eds. E. M. de Gouveia dal Pino, G. Lugones, & A. Lazarian, AIP Conf. Ser., 784, 263 [Google Scholar]
  63. Roumeliotis, G., Sturrock, P. A., & Antiochos, S. K. 1994, ApJ, 423, 847 [Google Scholar]
  64. Shafranov, V. D. 1966, Rev. Plasma Phys., 2, 103 [NASA ADS] [Google Scholar]
  65. Skiathas, D., & Gourgouliatos, K. N. 2024, MNRAS, 528, 5178 [NASA ADS] [CrossRef] [Google Scholar]
  66. Tayler, R. J. 1973, MNRAS, 161, 365 [CrossRef] [Google Scholar]
  67. Thompson, C., & Duncan, R. C. 1995, MNRAS, 275, 255 [Google Scholar]
  68. Thompson, C., & Duncan, R. C. 1996, ApJ, 473, 322 [NASA ADS] [CrossRef] [Google Scholar]
  69. Tsuruta, S., Kelly, M. J., Nomoto, K., et al. 2023, ApJ, 945, 151 [Google Scholar]
  70. Vasil, G., Lecoanet, D., Burns, K., Oishi, J., & Brown, B. 2019, J. Comput. Phys.: X, 3, 100013 [Google Scholar]
  71. Viganò, D., Pons, J. A., & Miralles, J. A. 2011, A&A, 533, A125 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  72. Viganò, D., Pons, J. A., & Miralles, J. A. 2012, Comput. Phys. Commun., 183, 2042 [Google Scholar]
  73. Viganò, D., Rea, N., Pons, J. A., et al. 2013, MNRAS, 434, 123 [CrossRef] [Google Scholar]
  74. Viganò, D., Garcia-Garcia, A., Pons, J. A., Dehman, C., & Graber, V. 2021, Comput. Phys. Commun., 265, 108001 [CrossRef] [Google Scholar]
  75. Wood, T. S., & Hollerbach, R. 2015, Phys. Rev. Lett., 114, 191101 [Google Scholar]
  76. Wright, G. A. E. 1973, MNRAS, 162, 339 [NASA ADS] [CrossRef] [Google Scholar]
  77. Yakovlev, D. G., & Shalybkov, D. A. 1991, Ap&SS, 176, 191 [Google Scholar]
  78. Yang, W. H., Sturrock, P. A., & Antiochos, S. K. 1986, ApJ, 309, 383 [NASA ADS] [CrossRef] [Google Scholar]

All Tables

Table 1.

Normalization of the relevant variables.

Table 2.

Stellar parameters for the five different EoSs studied.

Table 3.

Coefficients for the polynomial in Eq. (75).

Table 4.

Coefficients for the polynomials in Eqs. (76) and (77).

Table 5.

Root mean square velocities.

Table 6.

Analytical fit of the radial profiles for the HHJ EoS.

All Figures

thumbnail Fig. 1.

Comparison between the five different EoSs studied. (a) nn and nc, in units of nc(r = 0); (b) the ratio nc/nn; and (c) c/R, where c ≡ −[dln(nc/nn)/dr]−1 (see Sect. 7.2) and R is the core radius. All these variables are functions of the normalized radial coordinate, r/R.

In the text
thumbnail Fig. 2.

Radial functions f1(r) for model II. The coefficients for each solution are given in Table 3.

In the text
thumbnail Fig. 3.

Magnetic field configurations, relative chemical potential perturbations, and velocity fields produced by the models I, II, III, and IV. For B, lines represent the poloidal magnetic field lines labeled by the corresponding value of α. For models I–III, color represents the poloidal potential α, while in model IV, it represents the toroidal magnetic field Bϕ. For χn and χc, color represents their local value. For vn and vad, lines represent the poloidal component and color its magnitude; these are computed through the explicit semi-analytic approach described in Sect. 3.1 using the background NS model with the HHJ EoS.

In the text
thumbnail Fig. 4.

Comparison of the pseudo-spectral approach (dashed line) and the semi-analytical solution obtained using the explicit approach (continuous line) for magnetic field model I. The solution from the pseudo-spectral approach uses a polynomial fit for the relevant background radial profiles. From top to bottom: (a) χn, (b) χc, (c) vn, r, and (d) vad, r. All quantities are in code units, plotted as functions of r for θ = π/3 and θ = π/2.

In the text
thumbnail Fig. 5.

Comparison of the output of the pseudo-spectral approach (dashed line) and the semi-analytical solution obtained using the explicit approach (continuous line) for magnetic field model II. The solution from the pseudo-spectral approach uses a polynomial fit for the relevant background radial profiles. From top to bottom: (a) χn, (b) χc, (c) vn, r, and (d) vad, r. All quantities are in code units, plotted as functions of r for θ = π/3 and θ = π/2.

In the text
thumbnail Fig. 6.

Relative difference between the analytical fit of the radial profiles obtained for the HHJ EoS (see Table 6) and the data extracted from tables. That is, |xfit(r)/x(r)−1|, for x = nn, nc, μ, and γcn.

In the text
thumbnail Fig. 7.

Comparison between the explicit semi-analytical evaluation of the velocities and relative chemical potential perturbations (corresponding to ζ = 0) and the numerical calculation of the same quantities using the FF approach with different values of ζ. For vn and vad, lines represent the direction of their poloidal component and color its magnitude. This comparison is made for magnetic field model II, using the HHJ EoS. The computation is done over an equally spaced grid (u = 1 in equation (55)) of resolution Nr = 60, Nθ = 91, using an analytical expression for fB to minimize numerical errors.

In the text
thumbnail Fig. 8.

Radial component of the neutron velocity, vn, r, for θ = π/2 as a function of r for magnetic field models I, II, III, and IV, all with the HHJ EoS. The evaluation is done with the explicit approach for ζ = 0 (no FF) and numerically using the FF approach with different values of ζ > 0.

In the text
thumbnail Fig. 9.

(a) Radial and (b) polar components of the neutron velocity for θ = π/3 and θ = π/2 as functions of r for the magnetic field model I using the HHJ EoS. The evaluation is done semi-analytically (corresponding to ζ = 0; continuous line) and numerically, using the FF approach with Dedalus (dashed line) and our finite difference code (dotted line), both using ζ = 10−3.

In the text
thumbnail Fig. 10.

(a) Radial and (b) polar components of the neutron velocity for θ = π/3 and θ = π/2 as functions of r for the magnetic field model II using the HHJ EoS. The evaluation is done semi-analytically (corresponding to ζ = 0; continuous line) and numerically, using the FF approach with Dedalus (dashed line) and our finite difference code (dotted line), both using ζ = 10−3.

In the text
thumbnail Fig. 11.

Time evolution for magnetic field model II with background NS provided by the EOS HHJ using different values of ζ. (a) Evolution of the total magnetic energy, normalized by its initial value. (b), (c) Evolution of the rms values of the neutron velocity and ambipolar velocity, respectively. Vertical lines mark the value of tζB/tad for each simulation.

In the text
thumbnail Fig. 12.

Evolution of magnetic field model II using ζ = 10−4. We used a grid of Nr = 60 radial steps and Nθ = 91 polar steps inside the core, NExp = 40 external multipoles, u = 2/3, and the HHJ EoS. From left to right: Configuration of the magnetic field, where lines represent the poloidal magnetic field (labeled by the magnitude of α) and colors the poloidal potential α; χn and χc, both in units of χ0 = B02/4πn0μ0; neutron velocity, vn, and ambipolar diffusion velocity, vad, where arrows represent the direction and colors the magnitude normalized to R/t0. Rows correspond to different times: t = 0, t = tζB = 10−4tad, and t = 0.1 tad.

In the text
thumbnail Fig. 13.

For the simulation of Fig. 12. (a) Time evolution of the rms force densities ⟨fB⟩, ⟨fn⟩, ⟨fc⟩, and ⟨fζ⟩, all normalized by ⟨fB(t = 0)⟩. (b) Energy conservation. All terms are in units of the total initial magnetic energy. The vertical line marks tζB/tad.

In the text
thumbnail Fig. 14.

Differences in α(r, π/2) at t = 0.1 tad for model II using different resolutions: (a) Using a fixed number of NExp = 40 external multipoles and five different grid resolutions Nr × Nθ. To aid visualization, α*, which is α at the highest resolution used (75 × 113), was subtracted. (b) Using a fixed grid resolution of 60 × 91 and five different resolutions for the number of multipoles NExp. To aid visualization, α80, which is α at the highest resolution used (NExp = 80), was subtracted. For all simulations, ζ = 10−3 and u = 2/3.

In the text
thumbnail Fig. 15.

Plots for magnetic field model IV using different values of ζ: (a), (b) Evolution of the poloidal and toroidal magnetic energy, respectively, normalized by the initial value of the magnetic energy of the star. (c), (d) Evolution of the rms poloidal neutron and ambipolar velocity. Vertical lines correspond to the value of tζB/tad in each simulation.

In the text
thumbnail Fig. 16.

For the simulation of Fig. 12: scatter plot of χn and χc versus α for t = 0, t = tζB, and t = 0.1tad.

In the text
thumbnail Fig. 17.

Evolution of magnetic field model IV, using ζ = 10−3. We used a grid of Nr = 60 radial steps and Nθ = 91 polar steps inside the core and NExp = 40 external multipoles, and the HHJ EoS. From top to bottom: Configuration of the magnetic field, where lines represent the poloidal magnetic field (labeled by the magnitude of α) and colors the toroidal potential β; χn and χc, both in units of χ0 = B02/4πn0μ0; poloidal component of the neutron velocity, vn, and ambipolar diffusion velocity, vad, where arrows represent the direction and colors the magnitude normalized to R/t0. Columns correspond to different times: t = 0, tζB, 5 tζB, 0.1 tad, and tad.

In the text
thumbnail Fig. 18.

For the simulation of Fig. 17: (a) Time evolution of the rms force densities ⟨fB, Pol⟩, ⟨fB, Tor⟩, ⟨fn⟩, ⟨fc⟩, and ⟨fζ, Pol⟩, all normalized by ⟨fB, Pol(t = 0)⟩. (b) Energy conservation. The different terms are in units of the total initial magnetic energy. (c) External magnetic energy stored in multipole l, UB, l, normalized by the total initial magnetic energy, where l = 1, …, NExp. The vertical line corresponds to tζB/tad.

In the text
thumbnail Fig. 19.

Scatter plot of β, χn, and χc versus α for the final equilibrium configuration (at t = tad) of magnetic field model IV for two simulations, using the toy model EoS. Blue dots correspond to the results presented in Castillo et al. (2020), which are computed using B0 = 1.8 × 1017G (i.e., χ0 = 1.67 × 10−3); orange dots correspond a simulation performed with the current version of the code, using ζ = 3 × 10−3, Nr = 60 radial steps, Nθ = 91 polar steps inside the core, NExp = 27 external multipoles, and u = 1/2 (the same parameters as in Castillo et al. 2020). All quantities are normalized as described in Table 1.

In the text
thumbnail Fig. 20.

Time evolution for the initial purely poloidal magnetic field model III with five different EoSs using ζ = 10−3, a grid of Nr = 60 radial steps, Nθ = 91 polar steps inside the core, NExp = 40 external multipoles, and u = 2/3. The panels show the following variables: (a) Magnetic energy in the NS core, normalized by its initial value. (b) and (c) rms neutron and ambipolar velocity, ⟨vn⟩ and ⟨vad⟩, respectively. (d) The ratio ⟨vad⟩/⟨vn⟩. For each model, the timescales tζB and tad, and the velocities are evaluated considering the stellar parameters of Table 2. The vertical line marks the dimensionless value of ζ = tζB/tad, which is fixed to be the same for all EoSs.

In the text
thumbnail Fig. 21.

Same as Fig. 20 but for model IV. The variables shown in each panel are: (a), (b) Poloidal and toroidal magnetic energy in the NS core, respectively, normalized by the initial value of the total magnetic energy of the NS core. (c), (d) Root mean square neutron and ambipolar velocity, ⟨vn⟩ and ⟨vad⟩, respectively. (e) Ratio of ⟨vad⟩/⟨vn⟩.

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.