Evolution of Relative Magnetic Helicity: Method of Computation and Its Application to a Simulated Solar Corona above an Active Region

For a better understanding of solar magnetic field evolution it is appropriate to evaluate the magnetic helicity based on observations and to compare it with numerical simulation results. We have developed a method for calculating the vector potential of a magnetic field given in a finite volume; the method requires the magnetic flux to be balanced on all the side boundaries of the considered volume. Our method uses a fast Laplace/Poisson solver to obtain the vector potentials for a given magnetic field and for the corresponding potential (current-free) field. This allows an efficient calculation of the relative magnetic helicity in a finite 3D volume. We tested our approach on a theoretical model (Low and Lou, Astrophys. J.352, 343, 1990) and also applied our method to the magnetic field above active region NOAA 8210 obtained by a photospheric-data-driven MHD model. We found that the amount of accumulated relative magnetic helicity coincides well with the relative helicity inflow through the boundaries in the ideal and non-ideal cases. The temporal evolution of relative magnetic helicity is consistent with that of magnetic energy. The maximum value of normalized helicity, Hm/Φ2=0.0298, is reached just before a drastic energy release by magnetic reconnection. This value is close to the corresponding value inferred from the formula that connects the magnetic flux and the accumulated magnetic helicity based on the observations of solar active regions.

Magnetic helicity in a volume V can be determined as where A is the vector potential for the magnetic field B in this volume. Magnetic helicity is conserved in an ideal magneto-plasma (Chae et al., 2001). As long as the overall magnetic Reynolds number is high, however, it is still approximately conserved, even in the course of relatively slow magnetic reconnection (Berger and Field, 1984). Despite its important role in the dynamical evolution of solar plasmas, so far only a few attempts have been made to estimate the helicity of coronal magnetic fields based on observations and numerical simulations (see, e.g., Thalmann, Inhester, and Wiegelmann, 2011;Rudenko and Myshyakov, 2011). The problem with the helicity defined by Equation (1) is that the vector potential A in this formula is not directly measurable, nor is it obtainable from general numerical simulations unless they are carried out in terms of vector potential instead of electromagnetic fields. Even more -since the vector potential A is not gauge-invariant, the magnetic helicity in a closed volume has a well-determined value only when the magnetic field at the boundary have only tangential components, i.e., if B ·n| S = 0. On the other hand, Berger and Field (1984) has shown that in the case of boundaries that are instead open to magnetic flux penetration, the relative magnetic helicity (H R ), given by the Finn-Antonsen (1985) formula is gauge-invariant if the potential magnetic field is chosen as a reference field. In Equation (2) the quantities A and B are the actual vector potential and the original magnetic field, respectively, while P is the corresponding potential (i.e., current-free) magnetic field (∇ × P = 0) and A p is its vector potential. The vector potentials A and A p can be chosen to have the same gauge. For the correct calculation of H R the corresponding potential magnetic field P has to satisfy the conditions i.e., the normal component of the potential field P is equal to that of B at the boundaries. Heren| S denotes the unit vector normal to the boundary S.
In ideal magnetohydrodynamics (MHD) the rate of change of relative magnetic helicity in a given finite volume is given by the flux of relative helicity across the boundary S of this volume (e.g. Berger and Field, 1984;Berger, 1999): where V is the plasma velocity at the boundary and A p · n| S = 0. In a non-ideal plasma system, in contrast, relative magnetic helicity changes not only by the helicity flow through the boundary, but also by internal dissipation. The latter can be determined from E · B (Berger and Field, 1984), which adds a term to the evolution equation of relative helicity To calculate the evolution of the relative helicity H R of a magnetic field B in a volume, one first has to calculate the appropriate vector potential A, the corresponding potential field P and its vector potential A p and, to account for internal dissipation processes, the electric field E. Note that Equations (5) and (6) can be derived from Equation (2) if the vector potential satisfies the Coulomb gauge and the normal component of A p vanishes at the boundary (Berger and Field, 1984). A rigorous theory of vector potential in a half-space was developed by Boulmezaoud (1999). Devore (2000) suggested a simplified method for calculating the vector potential to obtain the relative magnetic helicity in a half-space. In most practical cases, however, the volume under consideration is limited in all three spatial directions. Recently, Thalmann, Inhester, and Wiegelmann (2011) presented a method for calculating the vector potential of a solenoidal magnetic field by decomposing it to the sum of a Laplacian part and a currentcarrying part according to the method of Kusano, Suzuki, and Nishikawa (1995). Rudenko and Myshyakov (2011) introduced an algorithm for calculating the gauge-invariant helicity of a magnetic field in a rectangular box. Valori, Démoulin, and Pariat (2012) employed a gauge different from that of Thalmann, Inhester, and Wiegelmann (2011) and Rudenko and Myshyakov (2011), which greatly simplified the computation of helicity in a finite volume. However, all these studies did not consider the evolution of relative magnetic helicity by comparing the accumulated relative magnetic helicity and the helicity flux through the boundary. In fact, the dissipation of relative magnetic helicity inside the considered coronal volume becomes important if non-ideal plasma processes take place, such as fast magnetic reconnection. The existing methods for calculating the relative magnetic helicity in a finite volume were tested on certain magnetic field structures such as an analytical magnetic field (Rudenko and Myshyakov, 2011;Thalmann, Inhester, and Wiegelmann, 2011) and theoretical models (Valori, Démoulin, and Pariat, 2012).
Our goal is to present a method that allows calculating the relative magnetic helicity according to Equation (2). We apply our method to an analytical field and to simulated data including both ideal and non-ideal coronal plasma processes above an active region. We also investigate the inward/outward flux of the relative magnetic helicity through the boundaries, according to Equation (5) for ideal plasmas and the loss of helicity according to Equation (6) for non-ideal plasma processes to check whether the calculation of relative magnetic helicity in a finite volume coincides with the helicity flux across the boundary.
In Section 2 we describe our new method for calculating vector potentials needed to determine relative magnetic helicity and its flux through the boundaries. In Section 3 we use the theoretical model of Low and Lou (1990) to check our method. Then, in Section 4, we apply this method to data obtained by the numerical simulation of the field and plasma dynamics above an observed active region on the Sun. The summary and discussion of our results are given in Section 5.

Calculating the Relative Magnetic Helicity in a Finite Volume and Its Flux through the Boundaries
Let us define a finite three-dimensional (3D) volume ("box") in Cartesian coordinates with a magnetic field B(x, y, z) given in this volume. Let the volume be bounded by x = [0, l x ], y = [0, l y ], and z = [0, l z ].

Determining the Boundary Values of A p and A
First one has to provide the values of A p and A on all six boundaries (x = 0, x = l x ; y = 0, y = l y ; z = 0, z = l z ). To take the bottom boundary (z = 0), for example, we define a new scalar function ϕ(x, y) that determines the vector potential A p of the potential magnetic field P on this boundary as follows: According to the condition imposed on the reference potential field (Equation (4)), the scalar function ϕ(x, y) should satisfy the Poisson equation: The value of ∂φ/∂n on the four sides of the plane z = 0 is set to zero in Equation (8). According to Equation (7), A px and A py will vanish at y = 0, l y and at x = 0, l x , respectively, on the z = 0 plane. Therefore, the corresponding magnetic flux at the boundary should also vanish because of Ampère's law.
In the examples given in Sections 3 and 4, the magnetic fluxes at the six boundaries are all close to zero and satisfy the above requirement for magnetic flux. We use a fourth-order accurate fast direct scheme according to Boisvert (1984), which is included, e.g., in the IMSL Numerical Libraries, to solve the Poisson equation (Equation (8)). By solving Equation (8)

Determining A p and A in the Volume
According to the definition of the potential field (Equation (3)), the vector potential A p of P satisfies the Laplace equation everywhere in the volume if A p satisfies the Coulomb gauge. The vector potential A of the original magnetic field B satisfies the Poisson equation where J = μ 0 j denotes the current density in the plasma system if A satisfies the Coulomb gauge. Again using the method of Boisvert (1984), we solve the Laplace and Poisson equations (Equations (9) and (10)) with the boundary conditions given in Section 2.1. The potential field P in this volume is defined as ∇ψ , which should satisfy the following Poisson equation which can be solved using the same method.

Clean the Divergence of A p and A
In calculating A p , however, finite divergence values may arise; the method cannot ensure the divergence of A p to vanish under the boundary condition (Equation (8)). To clean the residual divergence and obtain the correct solution of Equation (9), we first introduce a solenoidal modification vector ∇ × M that satisfies the condition in which the potential field P and the corresponding vector potential A p are obtained as described in Section 2.2. The components of M satisfy the three Poisson equations These Poisson equations can be solved with the same method as described in Section 2.2. The magnetic field from the modification vector ∇ × (∇ × M) will vanish at the six boundaries, so that it does not change the normal component of the magnetic field B ·n| S .
Let us consider the z-component of ∇ × M on the boundary of z = 0 or z = l z as an example. We know that Because M z = 0 at z = 0 or z = l z , the z-component of ∇ × M on the same boundary can be simplified as The quantities ∂My ∂z and ∂Mx ∂z also vanish on the boundary z = 0 or z = l z as required by Equation (13). Hence, the z-component of ∇ × M vanishes on the boundary z = 0 or z = l z . In the same way, the x-and y-components of ∇ × M also vanish on the boundary y = 0, l y and x = 0, l x , respectively. That is to say, the normal component of the magnetic field does not change on the boundary after adding ∇ × M to the vector potential A p .
Note that ∇ × M is divergence-free, although A p is not. However, the vector potential A p cannot vanish on the six boundaries after adding ∇ × M to it. Therefore, we introduce another scalar field φ(x, y, z) which satisfies the Poisson equation This Poisson equation can be solved with the same method as described in Section 2.2. The final form for the modified vector potential A p is given as In the same way, one can obtain the corrected vector potential A by replacing the right-handside term of Equation (13) with ∇ × A − B. One can confirm that the final modified vector potential A p and A satisfy the Coulomb gauge; they are also the solutions to Equations (9) and (10) given in Section 2.2. The normal component of the fields ∇ × A p and ∇ × A is equal to that of B on the six boundaries, as required by Equation (4). Now one can calculate the relative helicity in the volume according to Equation (2) as well as the change rates of relative magnetic helicity for an ideal plasma evolution according to Equation (5) and for a non-ideal evolution according to Equation (6), if additionally the electric fields and the velocity on S are known.

Testing the Method
To test the method we use the axisymmetric nonlinear force-free fields of Low and Lou (1990). We used the model labeled P 1,1 with l = 0.3 and = π/4 in the notation of their paper. We calculated the magnetic field on a grid of 64 × 64 × 64. Figure 1 depicts the original magnetic field B, the reconstructed magnetic field ∇ × A calculated according to our method, and the corresponding errors at the bottom boundary. We found that the reconstructed magnetic field is very similar to the original magnetic field. The ratio in magnetic energy between the two magnetic fields ( i |B| 2 / i |∇ × A| 2 ) is 0.998, and the corresponding vector correlation (Schrijver et al., 2006, Equation (28)) for them is 0.980. We also used the fractional flux error f i in a small discrete volume V i (with surface S i ) over all grid points to check the divergence of A and A p (Wheatland, Sturrock, and Roumeliotis, 2000), where S i is the surface area of a small volume V i . The average values of the magnitude of f i ( |f i | ) for A and A p are 6.69 × 10 −5 and 6.12 × 10 −5 , respectively. Before cleaning the divergence of the vector potential, the average value for A is 0.0055 and for A p it is 0.0038. Figure 2 shows the distribution of the fractional flux error over all grid points after cleaning the divergence. It indicates that A p and A are close to divergence-free, meaning that our method for cleaning the divergence of vector potentials is effective.

Relative Magnetic Helicity Flux in the Simulated Flaring Active Region 8210
We used a version of the photospheric-data-driven 3D MHD code LINMOD3D (Büchner, 2006a(Büchner, , 2006bSantos et al., 2008;Santos, Büchner, and Otto, 2011) to obtain the magnetic and electric field values necessary to calculate the evolution of relative magnetic helicity in a finite volume above a specific active region (AR 8210) and to compare it with the relative magnetic helicity flux through the boundaries obtained according to the method described in Section 2. For this particular case the simulation code solved the set of MHD equations together with Ohm's law and Ampère's law Here ρ denotes the plasma density, u the plasma velocity, B the magnetic field, p the thermal pressure. The set of equations is closed by assuming the adiabatic condition, i.e., p ∝ ρ γ with γ = 5/3. To numerically solve the above set of equations a discretization scheme was chosen that suppresses numerical dissipation by using second-order accurate leap-frog finite differences to solve the conservative, non-dissipative hyperbolic partial differential equations on a staggered grid and Dufort-Frankel differences to cope with the parabolic type equations that arise from the dissipative Ohm law (Equation (24)). The variables are made dimensionless by normalizing them to the following quantities: B norm = 100 G (gauss), L norm = 10 7 m, p norm = β 0 B 2 norm /(2μ 0 ) with β 0 = 0.1, ρ norm = p norm M p /2k B T norm , T norm = 10 6 K, v norm = B norm / √ μ 0 ρ norm , t norm = L norm /v norm , and the ideal gas law defines the temperature by p = 2ρk B T /M p , where k B is the Boltzmann constant and M p is the proton mass. For the normalized plasma beta value (the ratio of plasma over magnetic pressures) we used β 0 = 0.1 to represent the strong magnetic fields observed in AR 8210. The quantity u n in the momentum equation (Equation (20)) denotes the velocity of the neutral gas to which the plasma is coupled in the chromosphere. In our model the coupling via collisions and charge-exchange processes is quantified by a symbolic friction coefficient ν. In the chromosphere the plasma-neutral gas friction coefficient ν is large compared to the inverse Alfvén transit time that characterizes the propagation of magnetic perturbations. As a consequence, the plasma motion in the chromosphere is strongly coupled to the neutral gas. In contrast, in the upper solar atmosphere, the corona, the friction coefficient ν is much smaller than the inverse Alfvén transit time, i.e., plasma and neutral gas are dynamically decoupled from each other. Since we are interested mainly in calculating the evolution of relative magnetic helicity of the simulation data, radiative losses and heat conduction were neglected as well as the gravity of the Sun.
To start the simulation, first an initial potential magnetic field P is obtained by extrapolating the measured B z component of the magnetic field on the photosphere (z = 0), which is compatible with the side boundary conditions of the simulation box according to Otto, Büchner, and Nikutowski (2007). To sufficiently resolve the magnetic field gradients by the 131 3 simulation grid, all Fourier modes of the 2D photospheric magnetic field higher than eight are neglected. The resulting filtered photospheric magnetic field distribution is shown in the left panel of Figure 3. The resulting new smoothed magnetic field is relaxed to resume an equilibrium that is to be used as the initial condition for the simulation. Since solar gravity is neglected, the plasma is assumed to be initially in hydrostatic equilibrium (p = const). A horizontal plasma motion is then applied via the neutral gas coupling in the chromosphere. A rotational motion would inject helicity into the system without magnetic flux emergence through the photosphere if the velocity field satisfies ∇ · u n = 0, which inhibits the pile-up of plasma and magnetic flux in the photosphere.
For definiteness we started the simulation with the line-of-sight component of the photospheric magnetic field in active region NOAA 8210, which is well observed by SOHO/MDI (Scherrer et al., 1995) and analyzed (see, e.g., Régnier and Canfield, 2006). The photospheric plasma motion responsible for the evolution of the coronal magnetic field above NOAA AR8210 between 17:13 UT and 21:29 UT on 1 May 1998 was determined by Welsch et al. (2004), Longcope (2004), and Georgoulis and LaBonte (2006. Using the local correlation-tracking technique combined with the solution of the induction equation, Welsch et al. (2004) found for that period of time a clockwise rotation around the major negative magnetic polarity inside AR 8210. This motion produced a shear flow around the polarity inversion line, which was suggested to be responsible for the energy injection into the corona above the active region. Even before this time, a large amount of magnetic flux was injected into the solar atmosphere (see Santos, Büchner, and Otto, 2011). Furthermore, the rotational motion itself will also inject magnetic helicity into the corona. In the following we determine the injection, accumulation, and dissipation of magnetic helicity by applying the method described in Section 2 to the results obtained from the numerical simulation of electric and magnetic fields above AR 8210. For this sake a simulation run was started with the photospheric magnetic field corresponding to the one observed at 10:30:04 UT on 1 May 1998, well before the eruption. Figure 3(a) depicts the Fourier-filtered normal magnetic field B z threading the lower boundary. The coronal response to this energy and helicity inflow was simulated in a volume extending 217.5 Mm in all three (X, Y , and Z) directions above the active region. The physical quantities in this volume were calculated on a grid containing 131 × 131 × 131 grid points. Figures 3(c) -3(d) depict the velocity vortex applied to the plasma via its neutral gas interaction in the chromosphere at t = 0 s, 522 s, and 686 s. (cf. Santos, Büchner, and Otto, 2011, case 3).
While running the simulation, it appeared that for the low initial background magnetic diffusivity (η/ρ 0 ) of the code (on the order of 1 m 2 s −1 ), which corresponds to a magnetic Reynolds number on the order of Re m ∼ = 10 7 , the corona indeed evolves over 522 s like an ideal plasma system. Meanwhile, the Poynting flux through the lower boundary enhances both the magnetic energy content and, at a slower rate, also the kinetic energy generated by accelerated plasma flows in the corona. Only a very small portion of the currents that develop in the course of this almost ideal evolution of the corona is Joule-dissipated into heat (cf. Santos, Büchner, and Otto, 2011, Figure 11). The almost ideal evolution continued for 522 s. Then the enhanced currents caused the formation of strong micro-turbulence and microscopic structures, which essentially increases the dissipation, according to Elkina (2005, 2006). The anomalous resistivity is switched on when the current carrier velocity V ccv = j/n e reaches a certain threshold Elkina, 2005, 2006). After t = 522 s the background and anomalous resistivity are re-normalized based on the expected ion skin depth in the corona (Santos, Büchner, and Otto, 2011) by an increase of the anomalous current-dependent resistivity over six orders of magnitude. This substantially increases the dissipation and lowers the magnetic Reynolds number locally to the order of unity. Although the dissipation is enhanced first only locally in quasi-separatrix layers below the grid-resolution of the MHD simulation, they will finally cause fast energy conversion via large-scale 3D magnetic reconnection (cf., . In the actual simulation this transition takes place after 522 s. After this time, the magnetic energy is massively dissipated. This increases the thermal energy in the corona to more than z = 1.5, which surpasses even the kinetic energy, to which an increasing portion of the magnetic energy is also transferred by magnetic reconnection (Santos, Büchner, and Otto, 2011, Figure 11).
Using the method described in Section 2, we determined the flux of the relative magnetic helicity through the boundaries and the accumulated amount of the relative magnetic helicity during this period. Figure 4(a) shows the temporal evolution of the relative magnetic helicity in the simulation box (pluses) and the accumulated relative helicity (diamonds) based on the helicity change rate of Equation (6). The mean difference in relative magnetic helicity between the two calculations is within 4 %, which further confirms the rationality of our method. It was also found that the temporal evolution of the relative magnetic helicity is consistent with the evolution of the magnetic energy (Santos, Büchner, and Otto, 2011, Figure 11). Before t = 522 s, the relative magnetic helicity in the volume steadily continues to increase as a result of continuous driving on the boundary. The maximum accumulated relative magnetic helicity is 3.72 × 10 42 Mx 2 (Mx: maxwell) when the enhanced dissipation happened. At t = 522 s the driving is stopped and the resistivity is re-normalized. As a consequence, helicity decreases in time due to the combined effect of dissipation and outflow through the boundaries. The accumulated relative magnetic helicity in the non-ideal phase is − 8.33 × 10 41 Mx 2 , which has the opposite sign to the magnetic helicity flux across the boundaries in the ideal case before t = 522 s. Figure 4(b) shows the temporal evolution of normalized relative helicity H m / 2 , which could indicate how much the magnetic configuration is stressed . is the average of the absolute value of the magnetic flux at the bottom boundary in both magnetic polarities. The evolution of the normalized magnetic helicity is similar to the evolution of the relative magnetic helicity, and its maximum value is 0.0298 at t = 522 s at the time of the enhanced dissipation of the relative magnetic helicity. Figure 4(c) shows the temporal evolution of the helicity flux dH m /dt across the six boundaries based on Equation (5). We found that at the beginning of the ideal evolution, the change rate of relative helicity is relative low. It starts to increase later and reaches an almost stationary level due to the continued driving through the photospheric motion after about 100 s. The helicity change rate slightly decreases due to helicity back-flow to the chromosphere below the transition region. After t = 522 s, the helicity flux across the boundaries decreases significantly because the driving has been stopped; only 2.76 × 10 41 Mx 2 of the relative magnetic helicity across the boundaries. Note that the magnetic helicity flux is still positive although negative magnetic helicity is accumulated after t = 522 s. Figure 4(d) shows the temporal evolution of the helicity change rate dH m /dt including the helicity flux across the boundaries and dissipation in the simulation box based on Equation (6). We found that the difference in the profiles between Figures 4(c) and 4(d) is quite small before t = 522 s (less than 3 %), which reflects the low initial background magnetic diffusivity and negligible dissipation of magnetic helicity. After t = 522 s, significant negative magnetic helicity is accumulated in the simulation volume, i.e., positive magnetic helicity is lost from the simulation box. The first term of Equation (6) mainly contributed to the negative magnetic helicity in the simulation box. The dissipation of relative magnetic helicity, represented by the first term of Equation (6), is − 1.11 × 10 42 Mx 2 .

Summary and Discussion
In this paper we introduced a new method for determining the vector potentials in a given volume (a simulation box) in order to be able to calculate the relative magnetic helicity in the volume for applications, e.g., to the solar corona. The method requires the magnetic flux to be balanced separately on all the sides of the considered volume. We verified the reliability of our approach by applying it to a theoretical nonlinear force-free field to check whether the computed vector potentials indeed reproduce the corresponding magnetic fields and satisfy the Coulomb gauge. Using our method, we also analyzed the evolution of the relative magnetic helicity in a photospheric-data-driven MHD simulation of the active region NOAA 8210.
In the course of an ideal plasma evolution in the corona before and after an eruption, our method appropriately described the evolution of the relative magnetic helicity in both cases. The temporal evolution of the relative magnetic helicity was consistent with the evolution of the magnetic energy. When comparing the accumulated amount of relative helicity inside the volume with the time-integrated flow of relative helicity through the lower boundary and the integrated rate of dissipation inside, we obtained a good agreement (the difference is less than 4 %). The maximum value of the accumulated relative magnetic helicity is 3.72 × 10 42 Mx 2 just before the enhanced dissipation. In particular, we found that the loss of relative helicity from the coronal volume at the time of enhanced dissipation (i.e., R m locally on the order of one) cannot be neglected, as had often been assumed. The dissipation of relative magnetic helicity was −1.11 × 10 42 Mx 2 in the phase of fast energy conversion via large-scale 3D magnetic reconnection.
The efficiency of our method is such that to simulate the 131 ×131×131 electromagnetic fields used in this paper, it takes only about 5 min on an outdated Pentium IV 3.0 GHz PC processor to obtain the relative magnetic helicity for one instant of time.
The maximum normalized helicity we found is 0.0298, compared to the similar value, 0.022, of Démoulin and Pariat (2009, Figure 5). Equation (10) where a = 1.85, b = − 0.41, H 0 = 10 41 Mx 2 , and 0 = 10 21 Mx. Note that the corresponding accumulated magnetic helicity is 3.38 × 10 42 Mx 2 if one substitutes the maximum magnetic flux, 1.12 × 10 22 Mx, obtained in this study into Equation (25). This quantity differs by less than 9 % from the actual maximum accumulated magnetic helicity of 3.72 × 10 42 Mx 2 at the time of the magnetic reconnection. It is necessary to point out that the time of the reconnection is not controlled by the artificial resistivity; it is controlled by the current carrier velocity reaching a certain threshold that is physically determined by the plasma, at which strong micro-turbulence is excited and microscopic structures form that essentially enhance the dissipation. This implies that the normalized magnetic helicity (H m / 2 m ) may predict the occurrence of solar events in the solar corona. However, this still needs to be confirmed from observations and simulations in the future.