# Relative magnetic field line helicity

###### Key Words.:

Sun: fundamental parameters – Sun: magnetic fields – Magnetohydrodynamics (MHD) – Methods: numerical###### Abstract

Context:Magnetic helicity is an important quantity in studies of magnetized plasmas as it provides a measure of the geometrical complexity of the magnetic field in a given volume. A more detailed description of the spatial distribution of magnetic helicity is given by the field line helicity that expresses the amount of helicity associated to individual field lines, rather than in the full analysed volume.

Aims:Magnetic helicity is not a gauge-invariant quantity in general, unless it is computed with respect to a reference field, yielding the so-called relative magnetic helicity. The field line helicity corresponding to the relative magnetic helicity has only been examined under specific conditions so far. This work aims to define the field line helicity corresponding to relative magnetic helicity in the most general way. In addition to its general form, we provide the expression for the relative magnetic field line helicity in a few commonly used gauges, and reproduce known results as a limit of our general formulation.

Methods:By starting from the definition of relative magnetic helicity, we derive the corresponding field line helicity, and we note the assumptions it is based on.

Results:We check that the developed quantity reproduces relative magnetic helicity by using three different numerical simulations. For these cases we also show the morphology of field line helicity in the volume, and on the photospheric plane. As an application to solar situations, we compare the morphology of field line helicity on the photosphere with that of the connectivity-based helicity flux density in two reconstructions of an active region’s magnetic field. We discuss how the derived relative magnetic field line helicity has a wide range of applications, notably in solar physics and magnetic reconnection studies.

Conclusions:

## 1 Introduction

Magnetic helicity is an important quantity in studies of the Sun, as well as, in any other environment where magnetohydrodynamics (MHD) is the appropriate description. This is because magnetic helicity is a conserved quantity in ideal MHD (Woltjer 1958), and is approximately conserved even in non-ideal conditions, i.e., in the presence of reconnection (Taylor 1974, and more recently, Pariat et al. 2015).

Magnetic helicity quantifies the complexity of a magnetic field, and relates to the twist and braiding of the magnetic field lines. It is clasically defined as , where is the magnetic field in the volume , and the corresponding vector potential. It therefore depends on the gauge of unless it is computed in a volume bounded by a magnetic flux surface. This condition can be too restrictive in many cases, especially when the considered volume is constrained by observational limitations as in solar observations. In order to remove this limitation, the helicity can be defined with respect to a reference magnetic field. The first such relative magnetic helicity was introduced by Berger & Field (1984), and a gauge-independent version of it was later defined by Finn & Antonsen (1985). In this definition of relative magnetic helicity, the obtained helicity values do not depend on the gauges of the vector potentials of the original and reference fields as long as the normal components of the two fields coincide on the boundary of the volume.

The importance of relative magnetic helicity (RMH) has lead to the development of many computational methods in the recent years. These include finite-volume methods in Cartesian coordinates (Thalmann et al. 2011; Valori et al. 2012; Yang et al. 2013; Moraitis et al. 2014), finite-volume methods in spherical coordinates (Moraitis et al. 2018), and methods relying on other definitions of helicity (Pariat et al. 2005; Georgoulis et al. 2012). A complete description and intercomparison of the Cartesian methods can be found in Valori et al. (2016).

Relative magnetic helicity is a global quantity that characterizes the magnetic field. There are cases however where it is desirable to be able to describe helicity more locally. This can be done with field line helicity that was introduced by Antiochos (1987), and Berger (1988). Field line helicity (FLH) of a magnetic field is simply the line integral of the vector potential (that produces the magnetic field) along a field line. The usefulness of FLH stems from the fact that its flux-weighted integral along the boundary is equal to the relative magnetic helicity. FLH can be considered as a function of the field lines, and, due to the arbitrariness of the gauge choice, has no physical meaning unless the field line is closed, in which case it expresses the flux of the magnetic field through the surface bounded by the closed field line. Alternatively, FLH can attain physical meaning under specific gauges for the vector potentials.

Field line helicity has been employed in various solar applications. As an example, Russell et al. (2015) used FLH to trace the connectivity changes caused by reconnection in a magnetic field confined between two planes, simulating coronal loops. In another example, Yeates & Hornig (2016) have applied FLH to the global magnetic field of the Sun in order to study the distribution of helicity in the solar corona. A more theoretical study of the properties of FLH can be found in Aly (2018). In most of these applications a special gauge for the vector potentials was used to simplify calculations, which lead to inaccurate helicity budgets when the flux-weighted integral of FLH along the boundary was taken. This has very recently been fixed by Yeates & Page (2018), where a relative FLH was introduced that reproduced relative magnetic helicity to a high degree when integrated over the boundary. Still, this relative FLH is in the same constrained gauge used previously. One of the purposes of this paper is to find an expression for field line helicity that accurately reproduces relative magnetic helicity, and that, at the same time, makes no assumption about the adopted gauge.

Apart from field line helicity there are other methods that employ the magnetic connectivity to compute quantities related to magnetic helicity. An example is the twist number method (Guo et al. 2017), where the twist component of helicity is computed in configurations consisting of twisted magnetic flux ropes. In an alternative method that approximates helicity through its twist, Malanushenko et al. (2011) compute RMH by matching the shapes of coronal loops with field lines of a linear force-free field.

Another method that uses the magnetic connectivity to infer a helicity-related quantity is the connectivity-based helicity flux density method (Pariat et al. 2005; Dalmasse et al. 2014). In this, the rate of helicity change in the volume () is deduced from the flux-weighted integral of a quantity along the boundary of the volume, which can therefore be considered as the helicity flux density per unit of magnetic flux. Moreover, this flux density is inferred from the connectivity of the magnetic field in a similar manner as FLH.

In this paper we define a relative magnetic field line helicity (RMFLH) whose gauge is unrestricted, and investigate its relation with the connectivity-based helicity flux density. In Sect. 2 we define RMFLH, and also express it in various simplifying gauges. In Sect. 3 we describe the magnetic field data that we use for testing our derivation. In Sect. 4 we first validate the derived field line helicity method, and then we apply and compare it to a similar method that uses the helicity flux density. Finally, in Sect. 5 we summarize and discuss the results of the paper.

## 2 Relative magnetic field line helicity

### 2.1 Definition

Relative magnetic helicity of a three-dimensional (3D) magnetic field in a simply-connected, finite volume with boundary , is given by the Finn & Antonsen (1985) formula

(1) |

Here, is a potential magnetic field that is used as reference, and , are the vector potentials of the fields , , respectively. Relative magnetic helicity does not depend on the gauges of and as long as the condition

(2) |

holds (see, e.g., Valori et al. 2012), where denotes the outward-pointing unit normal of . The relative magnetic helicity defined in Eq. (1) can be decomposed into the sum of two gauge-independent helicities, one involving only the current-carrying part of the magnetic field, , namely

(3) |

and one also involving the potential magnetic field

(4) |

These components are referred to as the non-potential and volume-threading helicities in Linan et al. (2018), respectively.

In order to derive a general expression for the field line helicity we start from relative magnetic helicity of Eq. (1), and decompose it as

(5) |

where the individual terms on the right-hand side are now gauge-dependent. The volume integrations can be performed along the field lines of the respective magnetic field if we split the volume elements according to (with both , pointing along the field lines) in the first integral, and in the second, and rearrange the dot products inside the integrals. Equation (5) then reads

(6) |

where () denotes the part of the boundary where magnetic flux enters into (leaves) the volume, defined through . The footpoints of the field lines of () are denoted as , (, ). The only assumption made in going from Eq. (5) to (6) is that each field line can be labelled with its infinitesimal flux, or in other words, that an infinitesimal flux tube can surround each field line. This assumption can always be fulfilled in regions of sufficiently smooth magnetic field.

The integrations in Eq. (6) are taken along so that each field line is counted only once, but equivalently, they can be performed along , or even along the whole boundary, , but in that case the resulting helicity should be halved. Since by construction the potential field has the same normal components along the boundaries with the given magnetic field, we can choose to start from the same footpoint in the two integrals, , so that , yielding

(7) |

By defining the relative magnetic field line helicity as

(8) |

it follows that with the elementary magnetic flux on the boundary. A similar expression results when we consider as starting points the field lines of

(9) |

where the common footpoint is now . When the whole boundary is considered, the respective RMFLH is given by the average of the latter two expressions, namely

(10) |

In all cases the RMFLH is expressed relative to the same quantity integrated along the field lines of the potential magnetic field, hence the name relative magnetic field line helicity seems appropriate. It also follows that for a potential magnetic field all RMFLH expressions, Eqs. (8), (9), and (10), vanish by definition. Inevitably, the RMFLH is a function of not only the footpoints of , but also of . Expressed differently, RMFLH depends on the way that both fields connect positive to negative footpoints.

The relative magnetic helicity can be interpreted as the helicity budget of the composing field line helicities in the whole volume, and can be expressed in all cases as

(11) |

where stands for the characters, ‘+’, ‘-’, or ‘0’, and we defined for reasons of uniformity, . This relation shows that the RMFLH can be considered as the RMH density per unit magnetic flux. Note also that, differently from the direct computation of RMH as a volume integral, its computation as a budget of RMFLH does not include the contribution from field lines that do not connect with the boundary (if any) but rather close within the volume. The RMFLH can always be computed from one of the Eqs. (8)–(10), but its flux-weighted integral given by Eq. (11) will be equal to the RMH only if all field lines are connected to the boundary at both ends, i.e., when no closed and/or ergodic field lines are present in the volume. We adopt this assumption henceforth.

In a similar manner one can also define the relative magnetic field line helicity of the components and of helicity by replacing in Eqs. (8)–(10) with , and , respectively. As an example, the relative magnetic field line helicity of the non-potential component of helicity with field lines starting from the positive polarity is

(12) |

Of course, all these RMFLHs are gauge-dependent, but their flux-weighted integrals along the (whole) boundary recover the respective gauge-independent helicity component, i.e., for Eq. (12) the budget is indeed gauge-invariant.

### 2.2 Specific gauge choices

As with any FLH defined on open field lines, all RMFLH expressions depend on the gauges of the vector potentials. The only gauge independent FLH is when field lines are closed, in which case the FLH is the magnetic flux through the surface defined by the closed field line. For the RMFLH, by setting and in Eq. (8) for example, it can easily be seen that . It would be thus useful to exploit this gauge freedom in order to derive expressions for the RMFLH that are a function of the footpoints of only one magnetic field (and preferably of ) instead of two, and, if possible, without restricting the gauge of in doing so. Here we give a non-exhaustive list of choices for the gauges that simplify the resulting RMFLH.

#### 2.2.1 Potential-free gauge

An obvious way to have a RMFLH that depends only on the footpoints of is by making the second term in Eqs. (8), (9) to vanish. By going back in the derivation to Eq. (5), and replacing in the second term the potential field with the identity , we have

The last two terms can be eliminated with the gauge combination

(13) |

The respective field line helicity is then

(14) |

It depends only on the footpoints of , and can be obtained with an arbitrary gauge for , only the gauge of is restricted.

#### 2.2.2 Berger & Field gauge

Another possibility for the gauge is given by the relation

(15) |

which involves the tangential components of the two vector potentials on the boundary, as can be seen from the sufficient condition for its validity

(16) |

This gauge can be fulfilled with the tangential components of being determined from those of , while the gauge of the latter is unrestricted. The gauge condition given by Eq. (16) was used in the original definition of relative magnetic helicity by Berger & Field (1984), where Eq. (2) then reads . This gauge is thoroughly examined in Yeates & Page (2018) where it is used to define the following relative field line helicity

(17) |

written here in our notation and for the positive polarity boundary. This relative FLH is constructed similarly to the RMFLH of this paper since both quantities are differences of FLHs along the field lines of and . Unlike the RMFLH given by Eq. (8) however, it employs a specific gauge condition, although Yeates & Page (2018) provide a recipe to impose this gauge starting from a general one.

An alternative form for the relative FLH of Yeates & Page (2018) can be obtained when helicity is written as in the same gauge (Berger & Field 1984). By splitting the volume element along and across the field lines of the magnetic field according to , we can define the respective field line helicity

(18) |

With respect to Yeates & Page (2018), this RMFLH depends on the footpoints () of the single magnetic field , and therefore requires to trace field lines for this magnetic field only. The factor of 2 comes from the flux of the respective flux tubes, , on the boundary.

#### 2.2.3 Original Berger gauge

An even more restricting gauge combination is the one originally used in Berger (1988), and more recently in Yeates & Hornig (2016). This consists of the relations

(19) |

and it also involves the gauge of , not just ’s. Relative magnetic helicity from Eq. (2) simplifies then to (see also Valori et al. 2012). By splitting the volume element along and across the field lines of , we derive the respective field line helicity

(20) |

This RMFLH involves only the footpoints of . Although the form of RMFLH in this gauge is very simple, it is difficult to use in practical implementations because of all the restrictions of Eq. (19).

## 3 Magnetic-field data

To check that the definition of relative magnetic field line helicity, given in Sect. 2, is consistent, and that it is implemented correctly, we need to compare the values of helicity obtained with the RMFLH method with those of a standard volume method. We use three MHD simulations for this comparison, so that to be able to also follow the evolution of the RMH.

Additionally, we want to examine the relation between the helicity flux density method of Dalmasse et al. (2014) with the RMFLH one. For this we use two extrapolations of the 3D magnetic field of an observed active region (AR). All magnetic field data, from simulations or from extrapolations, are described below.

### 3.1 MHD data

The first two MHD datasets that we use are from the non-eruptive (Leake et al. 2013), and eruptive (Leake et al. 2014) flux-emergence simulations that were used and described in Valori et al. (2016), and also in Pariat et al. (2017) and in Linan et al. (2018). The two simulations involve the emergence of the same twisted magnetic flux rope in the same stratified solar atmosphere, and differ only in the strength and orientation of the initial, background, coronal magnetic field. In the non-eruptive case the initial field is parallel to the emerging flux rope, while in the eruptive case it is anti-parallel (and smaller than the non-eruptive one), thus favoring magnetic reconnection between emerging and background fields.

The magnetic field in both simulations is interpolated from the original stretched grid to a uniform one, that spans the volume in the non-dimensional units of the MHD code. The resulting mesh consists of 233233174 grid points, with a pixel size of 0.859 in all directions. The simulations last from to . In the eruptive case an eruption occurs around . The morphology of the magnetic field and the way it changes during the simulation is shown in the top two panels of Fig. 1 for both simulations. There, one can see the emerging flux rope (in orange), and the overlying arcade field (in blue), and the different behavior of their interaction in the two simulations.

The third dataset that we used is based on the simulation of Pariat et al. (2009) for the formation of a coronal jet, and is described in Pariat et al. (2015) and in Linan et al. (2018). In the simulation, there is initially uniform coronal plasma around an axisymmetric null point, that is created by embedding a vertical dipole below the simulation domain, and adding a uniform volume vertical magnetic field of opposite direction in the domain. As a result, the initial field in the volume is split into two connectivity domains, one closed and one open. Photospheric twisting motions eventually destabilize the configuration and magnetic reconnection between closed and open field lines occurs, with the final outcome the generation of a jet.

The magnetic field occupies the volume (in non-dimensional units), and is discretized with 129129129 grid points, and a pixel size of 0.0938 in all directions. The simulation lasts from to , with an accumulation phase for , and a dynamical phase for that is sampled more frequently, while the non-ideal effects start to appear around . The evolution of the magnetic field morphology for this simulation is shown in the bottom panel of Fig. 1.

### 3.2 Extrapolation data

To investigate the relation of field line helicity with the connectivity-based helicity flux density, , we use the same 3D magnetic-field data as in Dalmasse et al. (2018). These comprise a potential and a non-linear force-free (NLFF) reconstruction of the 3D magnetic field of NOAA AR 11158. Both methods start from the same vector magnetogram, which is the average of the SDO/HMI ones at 06:22 UT and 06:34 UT of 14 February 2011, rebinned by a factor of two, to the resolution per pixel.

The first reconstruction produces a potential magnetic field through the scalar potential of Schmidt (1964). This method uses only the normal component of the photospheric magnetic field. The scalar potential is obtained from the numerical solution of Laplace’s equation with the Dirichlet boundary conditions along the six boundaries of the volume that are given by the actual Schmidt solution. The resulting potential field occupies the volume , which is discretized by grid points.

The second reconstruction is a NLFF one that uses a weighted optimization method (Wiegelmann 2004), after pre-processing the horizontal components of the field on the photosphere so that it becomes more compatible with the force-free assumption, and additionally smoothing of the original vector magnetogram. The resulting NLFF field occupies the volume , which is discretized by grid points. The full details on each method can be found in Dalmasse et al. (2018) and references therein. The morphology of the magnetic field for the two extrapolations is shown in Fig. 2.

## 4 Applications

In this section we present the results from the application of the field line helicity method of Sect. 2 to the magnetic field data of Sect. 3. Before that, we describe a few details of the implementation of the method.

### 4.1 Implementation details of the RMFLH method

The calculation of relative magnetic helicity with the help of relative magnetic field line helicity is an instantaneous integration method that needs as input the 3D magnetic field in the volume under study. It can thus be considered as a finite-volume method according to the classification of Valori et al. (2016), and consequently it can be computed simultaneously with any method that employs the definition of Eq. (1), although RMFLH needs additionally the computation of the field lines.

Since all the test data of Sect. 3 are in the Cartesian domain, we follow for each snapshot of the given 3D magnetic field the volume method described in Moraitis et al. (2014). We first compute numerically the potential field that satisfies the condition of Eq. (2) as a solution of Laplace’s equation. From the two magnetic fields, and , we then compute their corresponding vector potentials by adopting the DeVore gauge, for which the vertical component is assumed to be null, . This gauge was originally introduced by DeVore (2000) and was then modified by Valori et al. (2012) for use in finite volumes, and it has the advantage of being very accurate and fast to compute. Our computation of RMFLH is thus performed in the most efficient way and it does not assume any of the specific gauge choices presented in Sect. 2.2. The quantity () is then input to the field line integration part, along with the two magnetic fields.

The relative magnetic field line helicities and are computed from Eqs. (8) and (9) by calculating the two terms separately and then taking their difference. Each of the terms in these relations is obtained by an integration along the respective field lines, and so this method involves two different field line integrations, one for , and one for . For these integrations we use as a starting point the code QSL Squasher (Tassev & Savcheva 2017) which is very fast and robust, and we modify it in three ways. First, we keep only the field-line integration part and omit any squashing factor calculations. Second, we modify the starting points of the field lines to be user-supplied instead of automatically determined by space-filling Hilbert curves. Finally, we augment the system of the three equations

(21) |

that are solved by the code with one more, which describes the field line helicity change () along a field line as

(22) |

with denoting the distance along the given field line.

For the starting points of the field lines (the footpoints) we consider separately the positive- and the negative-polarity boundary. Once the field lines are obtained, we compute either or depending on whether the field lines start from the positive or negative magnetic sign domain, using Eq. (8) or Eq. (9), respectively, while for we simply take the average of these expressions as in Eq. (10). All the results presented in the following use the grid points of the given magnetic field as the footpoints for the field lines. An alternative method which gives more weight to locations of higher magnetic field is discussed in the Appendix.

### 4.2 Application to MHD data

The verification of the RMFLH-based helicity calculation method presented in Sect. 2 is done with the help of the three MHD simulations. For each snapshot of each simulation we compute the relative magnetic helicity from its definition, Eq. (1), and also through the field line method, using Eq. (11) and the RMFLH given either by Eqs. (8), (9), or (10). The resulting evolution of the relative magnetic helicity with the two methods for all simulations is shown in Fig. 3.

We notice that the agreement between the two methods is very good for all cases with the curves being practically indistinguishable. To look closer at it, we denote with the relative magnetic helicity budget calculated from Eq. (1) and the one from Eq. (11), and we define their relative difference as

(23) |

The evolution of this relative difference for all MHD simulations is also shown in Fig. 3. Except from the snapshots at the start of the simulations and a few more where helicity is very low, all differences are within . The computation of helicity with the RMFLH method thus gives results very similar with the volume method in all cases. Additionally, this is true irrespective of whether the starting footpoints belong to the positive or the negative polarity. These observations indicate that the equations derived in Sect. 2 are indeed correct, and also that they are properly implemented.

The main advantage of using RMFLH is that in addition to the value of helicity we can also infer its spatial distribution. We show that in two ways in Fig. 4 using a snapshot from each MHD simulation. On the left column of Fig. 4, we present the 3D morphology of RMFLH by plotting representative field lines colour-coded according to the value of for that field line, while the 2D distribution of on the photospheric plane is displayed on the right column.

For the non-eruptive emergence simulation in the top panel of Fig. 4, and the shown snapshot at , we notice that the emerging flux rope in the center of the image consists of field lines with high positive values of RMFLH. The flux rope is confined by the overlying arcade field which has mixed-signed, but mostly negative RMFLH of quite lower values, as can be seen in the 2D map of RMFLH on the right image.

For the eruptive emergence simulation and the snapshot at just before the onset of the eruption in the middle panel of Fig. 4, we notice a much more complex situation. The arcade field consists now mostly from positive RMFLH, again of lower values than the flux rope. Additionally, the flux rope itself has smaller values of RMFLH than in the non-eruptive case, confirming the smaller helicity budget shown in Fig. 3.

Pariat et al. (2017) showed that the non-eruptive simulation had a larger positive helicity than the eruptive one. Using a toy model and the concept of “self” and “mutual” helicities, they explain these differences by the fact that the emerging flux rope, while having the same positive helicity in both cases, was globally sharing positive helicity with the surrounding arcade field in the non-eruptive case and negative helicity in the eruptive one. Within that toy model, the eruptive simulation would possess opposite signs of helicity, i.e., positive RMFLH in the field lines of the flux rope and negative RMFLH in the field lines of the surrounding arcade field. On the contrary, the non-eruptive simulation would have a distribution of RMFLH uniform in sign, positive for both the flux rope and the arcade field.

The results obtained here with RMFLH present a different view. Both eruptive and non-eruptive simulations present positive and negative RMFLH in the arcade field surrounding the flux rope. The spatial distribution of negative and positive RMFLH in that arcade field is more complex for the eruptive simulation than for the non-eruptive one. However, the main difference lies in the intensity of the positive and negative values of RMFLH. The eruptive case has a low total relative helicity mainly because all the domain possesses a weak RMFLH intensity. The non-eruptive case on the contrary, presents a high contrast of positively and negatively signed RMFLH. This further confirms that although “self” and “mutual” helicities are interesting theoretical tools, they are not directly relevant to relative magnetic helicity, and cannot be used to predict the distribution of RMFLH. The representation of a magnetic field as a collection of flux tubes is of course valid theoretically, and the relative magnetic helicity can then be expressed through sums over the self and mutual helicities under the specific gauge conditions described in Demoulin et al. (2006). In the general case however, the approach of RMH with the self and mutual helicities is of limited practical use.

For the jet formation simulation, we show in the bottom panel of Fig. 4 the snapshot at when the non-ideal effects take in. The twisting motions on the photosphere lead to the increase of RMFLH, and also of twist, in the central structure that later reconnects with the overlying jet-like feature. The values of RMFLH are predominantly positive in accordance with the results of Pariat et al. (2009) and Linan et al. (2018).

We should mention at this point that all these conclusions depend on the chosen gauges for the vector potentials. If RMFLH was expressed in a different gauge, its magnitude and even its sign distribution could be quite different. A preliminary testing of this possibility showed that this is not the case, and that at least in intense-RMFLH areas, the sign and magnitude of RMFLH are robust to the choice of the gauge. Some evidence in favour of this result can also be found in Yeates & Page (2018).

We also note that an alternative to removing the gauge dependency of RMFLH is to specify the gauge explicitly, although this would correspond to a redefinition of relative magnetic helicity less general than the one of Finn & Antonsen (1985). Nevertheless, the resulting FLH can then be associated with a physically meaningful quantity. Such an example is given by the so-called winding gauge (Prior & Yeates 2014), which is a modified, planar Coulomb gauge. The respective FLH, that is termed the flux function in Prior & Yeates (2014), expresses the average pairwise winding between the magnetic field lines. Nonetheless, it relies on a specific setup of the magnetic field, where the lateral boundary consists only from flux surfaces, and cannot extend to the more general case considered here, where field lines starting from one side of the boundary can end in any side, lateral or not.

### 4.3 Application to extrapolation data

Here we use the extrapolation data presented in Sect. 3.2 to compare the 2D morphology of RMFLH with that of helicity flux density, , (Dalmasse et al. 2018). For the comparison to be meaningful we use the same footpoint locations in both calculations, i.e., only one method for tracing field lines is used, the one described in Sect. 4.1. Finally, only field lines starting and closing on the photosphere are considered, since is defined for closed field lines. The quantities , as described in Sect. 4.1, and , as described in Dalmasse et al. (2014), are then computed for this set of footpoints. The morphology of the two quantities on the photospheric plane for the two considered extrapolations is shown in Fig. 5. The comments in Sect. 4.2 about the gauge dependence of RMFLH also apply here, where, moreover, the two quantities examined are computed under different gauges.

For the extrapolation using the potential field assumption, by definition relative magnetic helicity should be null since the potential field is used as a reference field. We note that indeed RMFLH is insignificant in that case as shown in the top-left panel of Fig. 5. This is another indication that the RMFLH method is consistent. In practice of course helicity is not null, but very low, because the potential field computed by our method differs slightly from the extrapolated one. The helicity budget we find with the volume method is , while with the RMFLH method it is , and so the two methods show an agreement of . These values may indicate the noise level that the helicity method can estimate.

Helicity flux density on the other hand is not necessarily negligible even when the magnetic field is potential, with strong helicity fluxes possibly injecting helicity in some regions and removing it in others. The helicity flux density calculations associated with Fig. 5 were checked against those of Dalmasse et al. (2018), and they were found to be consistent, despite the different footpoints and field line integration methods considered in the two cases. This is also evident from the qualitative agreement of the 2D helicity flux density map displayed in the bottom left panel of Fig. 5, with the one presented in the top right Fig. 3 of Dalmasse et al. (2018) for a similar quantity. This further confirms the results of Dalmasse et al. (2018) that the computation of the helicity flux is robust to the selection of the starting field-line footpoints.

In the case of the NLFF extrapolation there is an intense relative helicity budget in the domain, three orders of magnitude larger than in the case of the potential field for the RMFLH method. The value obtained by the volume method is , while the RMFLH method gives . The agreement is lower in this case, with the RMFLH method overestimating helicity by . This level of agreement can still be considered acceptable given that the NLFF field is of poorer quality in terms of solenoidality as compared to the MHD ones, and solenoidal errors are the most important source of errors in helicity computations (see Sect. 7 in Valori et al. 2016).

Although is a flux, and thus a quantity of a different nature than RMFLH, we see in Fig. 5 (right panels) that the overall distributions of the two quantities agree quite well in the case of the NLFF field extrapolation. As an example, in the two central contours RMFLH and both exhibit the same sign and both are important, and so the positive helicity is increasing by the injection of more helicity there. There are regions where the two quantities are quite different of course, such as the negative RMFLH area centered at in Fig. 5, where is mostly positive and not as strong. Nevertheless, the overall agreement of the two quantities is quite good.

If the helicity flux injection had been found to be strongly different from the volume helicity distribution, it would have implied that either at this particular time the helicity flux injection was very peculiar (something possible of course, e.g., for a twisted magnetic field being untwisted), or that the helicity flux method and the RMFLH were not carrying consistent information. However, these comparative results of the relative helicity distribution and relative helicity injection draws a coherent picture of the helicity properties in AR 11158, with helicity of a given sign being injected in regions having the same sign of helicity. This behaviour reasonably fits with what is expected to occur in solar active regions, helicity flux injection being relatively homogeneous and consistent in time. This is a first demonstration, that the common use of helicity flux and RMFLH can permit to deeper study the dynamics of helicity in solar active regions.

## 5 Discussion

In this paper we defined the concept of relative magnetic field line helicity (RMFLH) and we examined some of its properties. We presented the mathematical derivation of RMFLH starting from the definition of RMH, without any assumption on the gauges of the vector potentials. A similar derivation was followed for the two gauge-invariant components of RMH, the non-potential and volume-threading ones. This decomposition of RMH has been shown to provide very interesting physical insights in the stability of magnetic structures (Pariat et al. 2015; Linan et al. 2018). All the derivations were based on the sole assumption that the magnetic field can be represented with flux tubes, a reasonable assumption for relatively smooth magnetic fields, and that these flux tubes start and end on the boundary of the volume, i.e., they do not form closed loops inside the volume.

The developed RMFLH does not pose any restriction on the vector potentials’ gauge and so it can use the simplest possible gauge and/or the most economic in computational resources. By exploiting this flexibility in the choice of the gauge, we presented a fast and robust method for calculating RMFLH. We showed that the developed RMFLH can reproduce the system’s relative magnetic helicity budget to high accuracy by using three different MHD simulations, and comparing with the results of a finite volume method of known good performance.

A number of possible gauge combinations that simplify the resulting RMFLHs at the cost of more restrictive conditions for the computations of the vector potentials were also given. Within this framework, the recently proposed relative FLH of Yeates & Page (2018) is derived as a particular choice.

Computations of RMFLH are performed for each snapshot separately as in any volume method. The computational cost for RMFLH is larger than a finite-volume method with the same gauge assumptions however, since it involves additionally the tracing of the field lines of two magnetic fields, original and potential. The information gained is also higher though, since RMFLH indicates the locations where helicity is more important, instead of providing a single value for the entire considered domain.

In the MHD simulations examined in this work for example, RMFLH reaffirmed the difference in the helicity budgets between the non-eruptive and the eruptive case, while in the jet case, more photospheric twisting lead to localized higher positive values for RMFLH in the region of twist injection. These results, and most notably the sign of RMFLH, are a function of the gauge of course, since RMFLH is a gauge-dependent quantity. Preliminary testing with different gauge combinations shows that locations of higher absolute values of RMFLH are unaffected by the gauge choice. This is also supported by the results of Yeates & Page (2018, Figs. 4 and 7). More detailed examination of this dependence goes beyond the aim of this paper which is to introduce the quantity RMFLH. However, a representation and/or visualization of RMFLH that is less-, or non-related from the gauge is something worth exploring in the future.

In a first application of the developed RMFLH method to solar observations, relative magnetic field line helicity was shown to relate to helicity flux density. In a NLFF reconstruction of the magnetic field of a solar active region the two quantities showed similar overall photospheric spatial distribution, although local differences were also observed. The examination of RMFLH in similar future studies may thus provide additional information on the physical conditions of solar active regions.

Consequently, the concept of relative magnetic field line helicity has important potential for use in plasma applications. Field line helicity seems as a promising tool to apply especially to situations such as the flux ropes of coronal mass ejections (Green et al. 2018), where magnetic helicity is known to play an important role.

###### Acknowledgements.

EP and KM acknowledge the support of the French Agence Nationale pour la Recherche through the HELISOL project, contract n ANR-15-CE31-0001. GV acknowledges the support of the Leverhulme Trust Research Project Grant 2014-051. This work and KD were supported by the French Centre National d’Etudes Spatiales. The authors acknowledge access to HPC resources of CINES under the allocations 2016â046331, A0010406331 and A0040406331 made by GENCI (Grand Équipement National de Calcul Intensif). We also appreciate the support of the International Space Science Institute for the international team “Magnetic Helicity in Astrophysical Plasmas”.## References

- Aly (2018) Aly, J.-J. 2018, Fluid Dynamics Research, 50, 011408
- Antiochos (1987) Antiochos, S. K. 1987, ApJ, 312, 886
- Berger (1988) Berger, M. A. 1988, A&A, 201, 355
- Berger & Field (1984) Berger, M. A. & Field, G. B. 1984, J. Fluid. Mech., 147, 133
- Dalmasse et al. (2014) Dalmasse, K., Pariat, E., Démoulin, P., & Aulanier, G. 2014, Sol. Phys., 289, 107
- Dalmasse et al. (2018) Dalmasse, K., Pariat, É., Valori, G., Jing, J., & Démoulin, P. 2018, ApJ, 852, 141
- Demoulin et al. (2006) Demoulin, P., Pariat, É., & Berger, M. A. 2006, Sol. Phys., 233, 3
- DeVore (2000) DeVore, C. R. 2000, ApJ, 539, 944
- Finn & Antonsen (1985) Finn, J. & Antonsen, T. 1985, Comments Plasma Phys. Control. Fusion, 9, 111
- Georgoulis et al. (2012) Georgoulis, M. K., Tziotziou, K., & Raouafi, N.-E. 2012, ApJ, 759, 1
- Green et al. (2018) Green, L. M., Török, T., Vršnak, B., Manchester, W., & Veronig, A. 2018, Space Sci. Rev., 214, 46
- Guo et al. (2017) Guo, Y., Pariat, É., Valori, G., et al. 2017, ApJ, 840, 40
- Leake et al. (2014) Leake, J. E., Linton, M. G., & Antiochos, S. K. 2014, ApJ, 787, 46
- Leake et al. (2013) Leake, J. E., Linton, M. G., & Török, T. 2013, ApJ, 778, 99
- Linan et al. (2018) Linan, L., Pariat, É., Moraitis, K., Valori, G., & Leake, J. 2018, ApJ, 865, 52
- Malanushenko et al. (2011) Malanushenko, A., Yusuf, M. H., & Longcope, D. W. 2011, ApJ, 736, 97
- Moraitis et al. (2018) Moraitis, K., Pariat, É., Savcheva, A., & Valori, G. 2018, Sol. Phys., 293, 92
- Moraitis et al. (2014) Moraitis, K., Tziotziou, K., Georgoulis, M. K., & Archontis, V. 2014, Sol. Phys., 289, 4453
- Pariat et al. (2009) Pariat, É., Antiochos, S. K., & DeVore, C. R. 2009, ApJ, 691, 61
- Pariat et al. (2005) Pariat, É., Démoulin, P., & Berger, M. A. 2005, A&A, 439, 1191
- Pariat et al. (2017) Pariat, É., Leake, J. E., Valori, G., et al. 2017, A&A, 601, A125
- Pariat et al. (2015) Pariat, É., Valori, G., Démoulin, P., & Dalmasse, K. 2015, A&A, 580, A128
- Prior & Yeates (2014) Prior, C. & Yeates, A. R. 2014, ApJ, 787, 100
- Russell et al. (2015) Russell, A. J. B., Yeates, A. R., Hornig, G., & Wilmot-Smith, A. L. 2015, Physics of Plasmas, 22, 032106
- Schmidt (1964) Schmidt, H. U. 1964, NASA Special Publication, 50, 107
- Tassev & Savcheva (2017) Tassev, S. & Savcheva, A. 2017, ApJ, 840, 89
- Taylor (1974) Taylor, J. B. 1974, Physical Review Letters, 33, 1139
- Thalmann et al. (2011) Thalmann, J. K., Inhester, B., & Wiegelmann, T. 2011, Sol. Phys., 272, 243
- Valori et al. (2012) Valori, G., Démoulin, P., & Pariat, É. 2012, Sol. Phys., 278, 347
- Valori et al. (2016) Valori, G., Pariat, É., Anfinogentov, S., et al. 2016, Space Sci. Rev., 201, 147
- Wiegelmann (2004) Wiegelmann, T. 2004, Sol. Phys., 219, 87
- Woltjer (1958) Woltjer, L. 1958, Proceedings of the National Academy of Science, 44, 489
- Yang et al. (2013) Yang, S., Büchner, J., Santos, J. C., & Zhang, H. 2013, Sol. Phys., 283, 369
- Yeates & Hornig (2016) Yeates, A. R. & Hornig, G. 2016, A&A, 594, A98
- Yeates & Page (2018) Yeates, A. R. & Page, M. H. 2018, ArXiv e-prints, arXiv:1811.02306

## Appendix A Dependence of RMFLH on the choice of the footpoints

As mentioned in Sect. 4.1 the default method for choosing the footpoint locations is by the grid points (GP) of the given magnetic field. Here we give an alternative method that assigns more footpoints to areas of stronger magnetic field strength. We refer to this method as the flux-based (FL) method.

In this, the magnetogram under study is first divided into weak and intense magnetic field areas. Typically, the division corresponds to the absolute value of above which of the flux in the magnetogram is taken into account. In the weak-field areas, a footpoint is assigned to each pixel as in the GP method. In the intense-field areas however, the footpoints assigned per pixel are proportional to the flux in that pixel. The lateral and top boundaries where the magnetic field is normally much weaker are treated as weak-field areas. We note also that this procedure results in the footpoints having similar values of magnetic flux, which is determined from the threshold value of . As an example, we show in Fig. 6 the photospheric footpoints obtained with the two methods for the snapshot at of the non-eruptive emergence simulation, and the positive-polarity boundary. The number of footpoints in the GP case are , while in the FL case almost three times that, .

The resulting helicity budget using these footpoints for the same simulation is shown in Fig. 7. For simplicity we have only considered the footpoints starting from the photospheric boundary. We notice in the bottom panel of Fig. 7 that the relative (to the volume method) differences are very small, for both cases. This means that the GP method that is mainly used in this paper works equally well as the more accurate FL one, and so the choice of the former as more convenient, is justified. Moreover, the differences in the form of the RMFLH computed with the two methods are very small, as is shown in Fig. 8.

To further examine the differences between the GP- and FL-based methods for choosing footpoints, we use the much more complex NLFF field reconstruction of AR 11158. In the top panel of Fig. 9 we show the form of the RMFLH computed with the footpoints given by the FL method for the threshold between weak and intense magnetic field areas. The differences with the top right Fig. 5 where the footpoints are given by the GP method are very small, as the bottom panel of Fig. 9 confirms.