© Revista de Matemática: Teoría y Aplicaciones 2021 28(1) : 95–104 cimpa – ucr issn: 1409-2433 (Print), 2215-3373 (Online)

doi: https:// doi. org/ 10.15517/ rmta. v28i1. 42135

simulation of multiple plasma eddies in 2D

simulación de torbellinos múltiples de plasma en 2D

Daniel Alvarado^{∗}  Francisco Frutos-Alfaro^{†}

Received:07/Aug/2020 Revised: 22/Oct/2020; Accepted: 30/Oct/2020

∗Costa Rica High Technology Center, San José, Costa Rica. E-Mail: dalvarado@cenat.ac.cr †University of Costa Rica, School of Physics and Space Research Center, San José, Costa

Rica. E-Mail: frutos@fisica.ucr.ac.cr

Abstract

In this contribution, we present the simulations of convective plasma cells of the Sun in two dimensions. With a simple stream function, it is possible to visualize multiple n × n convective cells. To obtain the simulation, we solve the magnetic diffusion equation with a fourth order scheme. Some applications for this simulations are also presented.

Keywords: plasmas; MHD; computer simulation.

Resumen

En esta contribución, presentamos las simulaciones de células de plasma convectivo del Sol en dos dimensiones. Con una función de flujo simple, es posible visualizar múltiples celdas convectivas n × n. Para obtener la simulación, resolvemos la ecuación de difusión magnética con un esquema de cuarto orden. También se presentan algunas aplicaciones para estas simulaciones.

Palabras clave: plasmas; MHD; simulaciones por computadora.

Mathematics Subject Classification: 82D10, 76W05, 37M05

1 Introduction

Computer simulations help us study and understand physical processes that cannot be easily manipulated in real life scenarios or even in laboratories, such as the phenomena that occurs on the stars, black holes, and other stellar objects. Thus, simulations become a catalyst of scientific discovery and contribute more and more to research as models become more complex and accurate.

The main approach of Magnetohydrodynamics (MHD) to studying plasma is based on the fact that a magnetic field induces a current on a moving conductive fluid, which in turn changes the magnetic field retroactively [2]. MHD is described by the Navier-Stokes equations of fluid dynamics and Maxwell’s equations of electromagnetism.

The first efforts at explaining the effects of a conductive fluid in the generation of magnetic fields were done by Elsasser [5], who is considered the father of the dynamo theory, which explains the earth’s magnetic field. Elsasser, Weiss [10] and Parker [7] were the first to make two-dimensional MHD simulations using symmetric velocity fields.

Advances in the field of MHD have helped develop more complex and complete models and simulations. In recent years, MHD simulations have been used to model complex systems, such as the simulation of the magnetosphere of a massive rotating star done in [9]. This was the first MHD 3D simulation of the magnetosphere of a massive star.

This program helps us study and visualize the process through which a rotating, convecting, and electrically conducting fluid can maintain a magnetic field and the way it behaves. This may help us understand processes that occur naturally in stellar objects such as the Sun.

In [4], a stream function was used to simulate one, two or three eddies. An improvement of our code by means of the parallelization was presented in [1].

In this work, we present a tool developed to simulate plasma eddies. Our program models the plasma in a stationary state, which leads to an induction problem where we must find stationary states as solutions to the induction equation. We use a MHD approach for modeling the plasma due to the model’s simplicity. This method describes the material as a single fluid and models the interaction between magnetic fields and the motion of the conductive fluid. The stream function used here generates n × n eddies. The parallel code was employed for the simulations.

2 Plasma model for the eddies

For this simulation we use a stream function, which is a function used to describe incompressible flows (divergence-free) in two dimensional spatial coordinates. This helps us determine the components of velocity by differentiating the function with respect to the given coordinates.

The stream function used is described below in equation 5 and can be observed in Figure 1. It can be seen that we created 4 bands of 4 eddies each so that we can observe them interact with each other and observe the different phenomena that happens in this kind of configurations.

To describe the convective cells in the Sun we employ the induction equation which is deduced from the Maxwell equation, it is

\frac{∂B}{∂t} = ∇ × (v × B) + η∇^{2}B,  (1)

with a fourth order scheme, where η is the magnetic viscosity. By using the following vector potential form

B = ∇ × A = (\frac{∂A}{∂y}, −\frac{∂A}{∂x}, 0) ,  (2)

Figure 1: Visualization of the stream function.

where A = Ak, we get

\frac{∂A}{∂t} = −u · ∇A + \frac{1}{R_{m}} ∇^{2}A,  (3)

where R_{m} is the magnetic Reynolds number. This number is a parameter commonly used in MHD models. It is analogous to the Reynolds number used in classic hydrodynamics, which determines the turbulence of a fluid. This number gives an estimate of the relative effects of the induction of a magnetic field given by the movement of a conductive medium with respect to magnetic diffusion, as given by

R_{m} = \frac{UL}{η},  (4)

where U is the flow velocity, L is the characteristic length y η is the magnetic viscosity [3] with a fourth order scheme. Now, we are interested in simulating convective cells in the Sun, to reach this goal, one needs the stream function for n × n cells (n band of eddies with n eddies) which is given by

Ψ = \frac{1}{4π} sin (nπx) sin (nπy).  (5)

The velocities in the x and y directions are obtained from u = −k × ∇Ψ with k a unit vector pointing in the +z direction

u_{x} = \frac{∂Ψ}{∂y} = \frac{n}{4} sin (nπx) cos (nπy)  (6)
u_{y} = −\frac{∂Ψ}{∂x} = −\frac{n}{4} cos (nπx) sin (nπy).

The streamlines are closed and the velocity field fulfills ∇·u = 0. Therefore, equation 3 can be written as follows

\frac{∂A}{∂t} = ∇ · [−Au + \frac{1}{R_{m}} ∇A] .  (7)

For simplicity, it is assumed that the plasma is an isotropic, homogeneous medium of constant conductivity. We solve equation 3 by means of a fourthorder difference scheme in two-dimensional cells that have perfect conducting upper and lower walls (the magnetic field lines always remain tied to them) and periodic conditions at the lateral walls. It is assumed that the cell is surrounded by similar cells.

Figure 2: Graphic output of the initial conditions set for the simulation.

3 Program method and visualization

We used the program ParaPCell [1] for this simulation. The discretized spatial grid and boundary conditions are the same as the original program PCell [4] in which this software is based. ParaPCell calculates the value of the induction equation on a grid of points that has a size defined by the user. On each time step, a matrix of spatial points is defined and the induction equation is calculated for each point based on the state of the plasma from the previous iteration.

Since the method used to discretize the spatial dimensions of the partial differential equations that the program solves creates a spatial dependency among each point and its four surrounding ones, border conditions also had to be defined at the beginning of the simulation. On each time step the values used to calculate each point in an iteration are the values from the previous iteration, so this allows the program to parallelize the spatial calculation since all the values needed to obtain the current ones are present and stored in a matrix.

Figure 3: Graphic output of the program that shows the magnetic field of the eddies.

The initial magnetic field configuration is defined as an homogenous state of the magnetic field in which the field lines go straight from top to bottom and are equally spaced between each other as is shown in Figure 2. After this initial state is defined, the program begins to iterate over the spatial grid defined. On each point the stream function is calculated for the x and y coordinates, then the induction equation, this is repeated once per time iteration to a maximum also defined by the user.

After all the iterations are over, the program generates data files that contain the values of the induction equation for each point of the grid. A file is generated for each time iteration. These data is the one used for the visualization of the evolution of the magnetic field of the eddies, as shown in Figure 3.

4 Application

This program helps us study certain phenomena such as magnetic reconnection. This is a naturally occurring process that happens in highly conducting plasmas (such as the ones in the Sun) and reorganizes the magnetic field lines into configurations with lower energies [6].

Figure 4: Magnetic reconnection simulated with our program.

Magnetic reconnection occurs when oppositely directed magnetic field lines break and reconnect. It is a process where magnetic field lines from different magnetic sources are spliced to each other and thus, change the patterns with respect to their source. The magnetic energy is then converted into kinetic and thermal energy of the plasma, this sometimes create massive ejections of material at very high speeds, such as the ones observed in the Sun.

Magnetic reconnection is involved in phenomena that occurs in certain stellar objects such as solar flares. Understanding these phenomena is key to understanding the behaviour of these objects, such as our Sun. Solar flares and other processes related to magnetic reconnection affect life on Earth, since space weather depends on the solar conditions and it affects telecommunications and electrical grids all around the globe [8].

Our program allows us to observe and simulate this phenomenon as shown in Figure 4. It can be seen that parts of the magnetic field lines present reconnection, leaving some of the lines isolated. In a real physical environment, these isolated parts of the material are the ones that would show the energy change from magnetic to thermal and kinetic.

This program also helps us observe the steady states that result from the simulation of the magnetic field. A steady state is achieved when the variables that define the behaviour of the field no longer change in time. This helps us determine the amount of time in which the system achieves a steady state, provided no external source of energy is introduced. In Figure 4 the reconnection of magnetic field lines occurred, for example, in all bands in the down eddies and in the second and fourth bands upper eddies, while Figure 5 presents the steady state,

Figure 5: Steady state of the simulation.

it is when the eddies magnetic fluxes are expelled. This marks the end of the simulation, since there will either be minimal or no changes at all during the rest of the simulation.

A comparison with other visualization [4], i.e. other stream functions shows that the evolution is different, but the magnetic reconection and the steady state are present.

5 Conclusions and future work

5.1 Conclusions

We presented simulations of 2D convective cells in the Sun. A simple stream function was used to get the simulations. The magnetic diffusion equation was solved by means of a fourth order scheme. The simulations showed that reconnection in every cell occured as expected. This reconnection mechanism is also present in a series of phenomena, like helmet streamers and coronal mass ejection in the Sun. To have a complete view of the helmet streamers and coronal mass ejections, one needs to understand the processes started from the convection zone, i. e. these convection cells in the Sun.

The simulation is configurable, for simplicity, we used a 4 × 4 band of eddies, but changing the stream function to include more eddies could be easily done. So far, the simulation domain is restricted to square forms, i. e. n × n eddies per cell, but this does not impose a restriction on the observation of the effects of magnetic reconnection and the behaviour of the magnetic fields of the plasma.

The simulation showed that reconnection happened more often where lines change polarity and that high magnetic field density makes it more probable that reconnection happens. This is consistent with what is expected of these kind of systems in nature.

5.2 Future work

We would like to parallelize the PCell program even more, since as of this work, the program only uses OpenMP as a parallelization strategy. We would like to include Message Passing Interface (MPI) also so it can scale even more on distributed architectures.

Some other ways in which to improve our program are:

• Visualization of other stream functions.

• Implementation of three dimensional cells.

• Changing to other shapes like hexagonal cells.

• Exploration of chaotic behaviors.

Acknowledgements

Thanks to the referees for their constructive and valuable observations that allowed an improvement of the manuscript.

Funding

The second author was supported by the Research Vice-Rectory of the University of Costa Rica.

References

[1] D. Alvarado, A. De la Ossa, F. Frutos-Alfaro, E. Meneses, Parallelization of a magnetohydrodynamics model for plasma simulation, IEEE 38th Central America and Panama Convention, San Salvador, 2018, pp. 1–6.

    Doi: 10.1109/ CONCAPAN. 2018. 8596448

[2] C. Birdsall, A. Langdon, Plasma Physics via Computer Simulation, Series in Plasma Physics and Fluid Dynamics, CRC Press, Boca Raton FL, 2004.

    Doi: 10.1201/ 9781315275048

[3] R. Carboni, F. Frutos-Alfaro, PCell: a 2D program for visualizing convective plasma cells, Computing in Science and Engineering 6(2014) no. 4,

101–104. Doi: 10.1109/ MCSE. 2004. 18

[4] R. Carboni, F. Frutos-Alfaro, Computer simulation of convective plasma cells, Journal of Atmospheric and Solar-Terrestrial Physics, 67(2015), no.

17-18, 1809–1814. Doi: 10.1016/ j.jastp. 2004. 11.014

[5] W.M. Elsasser, Hydromagnetic dynamo theory, Reviews of Modern Physics 28(1956) no. 2, 135–163. Doi: 10.1103/ RevModPhys. 28.

135

[6] A. Jafari, E. Vishniac, Introduction to magnetic reconnection, arXiv, 2018.

http:// arxiv. org/ abs/ 1805. 01347

[7] E.N. Parker, Kinematical hydromagnetic theory and its application to the low solar photosphere, Astrophysical Journal, 138(1963), 552–575.

Doi: 10.1086/ 147663

[8] V.S. Titov, G. Hornig, P. Démoulin, Theory of magnetic connectivity in the solar corona, Journal of Geophysical Research: Space Physics 107(2002),

no. A8, 1–13. Doi: 10.1029/ 2001JA000278

[9] A. ud-Doula, J.O, Sundqvist, S.P. Owocki, V. Petit, R.H.D. Townsend First 3D MHD simulation of a massive-star magnetosphere with application to Hα emission from θ^{1} Ori C, Monthly Notices of the Royal Astronomical Society 428(2013) no. 3, 2723–2730. Doi: 10.1093/ mnras/ sts246

[10] N.O. Weiss, The Expulsion of magnetic flux by eddies, Proceedings of the Royal Society A (1966), 310–328. Doi: 10.1098/ rspa. 1966. 0173