The unified model of prominence formation

In this passage, I will introduce a little more about the ‘prominence formation’ project.

  • Solar Prominence

Solar prominences are cool and dense plasma suspending in the solar corona. Like the picture here.

They are usually 100 times cooler and 100 times denser than the surronding environment.

Then, a straightforward question is, why such a heavy blob of plasma could float in the corona?

You might say that, well, it is similar with clouds floating in the air.

But actually it is different.

Although clouds are composed of water, their density are typically lower than the surronding atmosphere.

However, for solar pormineces, they are really heavy, 100 times denser. Why they can still float in the corona?

Nowadays, it is believed that, solar prominence are supported by the Lorentz force. On the earth, the magnetic field is weak. We cannot feel the effect of Lorentz forece in most situations. But on the sun, magnetic field is so stronge that the plasma could be supported by the Lorentz force. Especially in the solar corona, everything is dominated by the magnetic field, and the plasma is trapped inside the magnetic field. Suppose I have a magnetic line, like shown in the figure below. Then, plasma can only move along such a magnetic line, or we can call it a magnetic flux tube.

Then, it is easy to image that, if the magnetic field line has a upward dip, it is possible to support the heavy plasma, e.g., solar prominence.

However, here comes another question. Where does the (plasma forming the) prominence come from? How is these heavy plasma transported into the tenuous corona?

  • Evaporation–condensation model

Well, you must know that the cloud on the earth is formed by evaporation and condensation. While for the prominence, though we have many mechanisms to explain that, one of the most popular mechanism is call evaporation and condensation model.

As shown in the GIF below. If I have a strong heating (caused by some activities in the lower atmosphere usually in the photosphere or chromosphere), at the footpoints of the magnetic field lines, plasma will be evaporated and then accumulated at the top of the magnetic field line. Here, condensation might happen because of a physical process called thermal instabiliy. So that we can see the formation of a cool and dense solar prominence.

So, what is thermal instabiliy?

Briefly, plasma will loose their energy, always everywhere. But note that we have a global heating in the corona (so that corona is always hotter than chromosphere, but the phycial essence of this global heating is still under debate), they can usually make a balance between the loss and the gain of the energy.

However, plasma at different temperature will lose their enery with different speeds. See the figure below. The dashed (or solid) curve, called cooling curve, describes how much energy plasma at a certain temperature will lose per second.

Solar corona is usually at a temperature of 1 MK, e.g., 106 K. Then, suppose that plasma at 1 MK is suffered from some perturbation, and its temperature dropps to 0.99 MK. From the curve, you can see that it will lose more energy, while at the same time, the energy it gains from the global heating is (almost) not changed. So the balance is broken. It will lose more and more energy and become cooler and cooler. Such a catastrophic process is call thermal instabiliy.

  • Injection model

Another model, the injection model, is more straightforward. In this model, we also have an energetic event happens at the footpoint. But this time, the energetic event provides the plasma more momentum instead of thermal energy. Then, the cool plasma in the lower atmosphere is pushed up into the corona instead of being evaporated, as shown in the GIF below.

  • Unified model

From the previous description, we can find that, these two models are pretty similar. They both first have a heating/energetic event at the footpoint. And then, the plasma located in the chromosphere moves upward into the corona. The difference only existes in how much the energy is converted into kinetic energy or thermal energy.

In recent work, a unified model is proposed. It points out that, these two models should be the same while the difference is that, in the evaportation–condensation model, the heating source is a little bit higher than in the injection model. That means, if the small energetic event happens in the lower corona or the higher chromosphere, it would more likely to be an evaportation–condensation prominence while an injection prominence would more prefer to a lower chromosphere energy source.

However, in their paper, the authors only provide two successful case with two paticular sets of parameters to demostrate their idea. We still want to check the model in a more detailed parameter space. For example, when keeping other paramters fixed, (the location of the energy source) from which height to which height, it would be an injection model, while from which height to which height, it would be an evaportation–condensation model; Or for a fixed height of energy source, whether the scale or duration of this will change the physical scenario. This is the idea of this project.

  • Run the test simulation in AMRVAC

In AMRVAC, we have a test code for the formation of solar prominece, based on the evaporation–condensation model.

Note that, again, everything happens in a 1D rigid tube, and plasma now could be understand as normal hydrodynaic fluid instead of MHD, a 1D hydrodynamic simulation is enough to simulate such a physcial process.

This code works in two stages.

First step, the code start from an hydrostatic equilibrium initial state, we only have a background global heating. We relax it to a thermal dynamic equilibrium state. This stage is from t=0 to t=200.

Second step, after we get an equilibrium tube, we start to add the strong heating at footpoint so that evaporation could happen. This stage is from t=200 to `time_max’ you input to the code (see below).

In the folder amrvac/tests/hd/prominence_formation_1D, you can find the mod_usr.t file and amrvac.par.

Copy them to your own folder, and use setup.pl to get the makefile and use make to complie it.

You can now run the code directly with the command mpirun -np 2 amrvac (here -np 2 means using 2 cores, you can use other numbers depending on your laptop). But before that, we have to change two lines in the amrvac.par file: time_max and refine_max_level. time_max = 400 is enough for this default setting. refine_max_level = 3 is already good enough, setting it to 4~6 would have a better result but will spend much more time.

Save the amrvac.par file and run the code.

Now you can check the result with ParaView, OK and Apply (botton on the left side).

Use the plot over line tool, Apply.

And then, on your left side, you can see all the avaliable variables. Here we choose Te, means temperature in the unit of 1 MK. (rho is number density in the unit of 10^9 / cm^3, p is pressure with the unit of 0.317 erg / cm^3, and v1 is velocity with the unit of 116.45 km/s.). Untick other variables.

Then, on the right side, you can see the initial temperature distribution (along this 1D simulation domain, or this 1D rigid tube).

Find the time box on the top of the tool. Change it to 40. Since in the code, we save our snapshots every 5 time unit (controlled by the parameter dtsave_dat = 5.d0), the 40th snapshot should be t=40*5=200, e.g., the end of our first stage.

Here is the temperature profile at t=200, quite different with the initial one.

Then, in the second stage. With continous heating, you will find the temperature changes dramatically. And at the 52nd snapshot, you can already see that the temperature at the center drop down to 0.01, or 104 K. We have successfully got the prominence in the simulation.

  • Run the simulation of the injection model

As mentioned above, the test code is written for the evaporation–condensation model. If we want to simulate the injection model, we have to change the settings a little bit.

The most relavent part should be the subroutine getlQ (means get localized heating) in the mod_usr.t file.

You can read through this part and modify it according to the reference paper so that you can have a prominence formation using the injection model.

Remeber that, everytime you changed anything in mod_usr.t, you have to recompile the code (make again). While after changing amrvac.par, it is not necessary to do that.

  • Run the simulation of the injection mode

After reproduce what have already been done in the reference paper, we can move on to do a parameter survey, mainly on the height of the heating source (lH0), the duration of the heating source, the size of the heating source (lambda), the strength of the heating source (lQ0), etc. To see how these parametes will influence the formation mechanism.

Write down your resuls in your final report.

P.S. You can set the parameter dtsave_dat smaller to have more output snapshots.

P.S.2 ParaView is convenient, but Python can do more things. If you are familiar with Python, you can check the following links to see the Python tools in AMRVAC.

http://amrvac.org/md_doc_python_datfiles.html

http://amrvac.org/md_doc_python_vtkfiles.html

Good luck ~

a 2D MHD simulation on solar flare

In this passage, I will introduce a little bit more about the ‘solar flare’ project.

  • Background

Solar flares are eruptive phenomena which often happen in the solar atmosphere, with up to 10^32 ergs of energy released within minutes. In a solar flare event, energy stored in coronal magnetic fields is directly or indirectly converted to thermal energy of plasma in the solar corona. Such a physical process is usually described by a standard flare model called CSHKP model (contributed by Carmichael, Sturrock, Hirayama, Kopp and Pneuman).

Horizontal convection beneath the photosphere will change the topology of coronal magnetic fields, e.g., the kinetic energy is turned into magnetic energy stored in the magnetic field. The energy could be release in many ways. One of these ways is magnetic reconnection.

Sometimes, the magnetic field in the solar corona can form a structure named current sheet, a thin current-carrying layer across which the magnetic field changes either in direction or magnitude or both. The current sheet is not stable, as ohmic heating efficiently dissipates magnetic field inside it, the topology of magnetic field would be changed, as shown in the following cartoon. Such a physical process which breaks and reconnects of oppositely directed magnetic field lines in a plasma is called magnetic reconnection.

Magnetic reconnection is the crucial part of the CSHKP model. The released energy will generate a upflow and a downflow. The upflow is sometimes associated with an eruptive solar prominence/filament or CME. While the downflow jet will first hit the apex of the loop system beneath the current sheet, creating a bright hard X-ray source. And subsequently the downflow continuously goes down following the loop until down to the chromosphere, leading to a bright X-ray source at the footpoint. Such an energy flow will again cause evaporations in the chromosphere, which will heat the solar corona as well as the loop.

As many other physical processes happening on the Sun, magnetic reconnection could be described by both magnetohydrodynamic (MHD) models and kinetic models. Here, we will use only the MHD model for simplicity. In the MHD model, magnetic reconnection is mainly related to the induction equation, which could be derived from Faraday’s equation in combination with Ampere’s law and Ohm’s law, and you can see many other equivalent forms of this equation in literatures.

The ohmic heating is resulted from eta, the magnetic resistivity or magnetic resistivity, in right hand side of the equation. It is an interesting parameter. For a collisional plasma with strong magnetic field but a relatively weak electric field, the magnetic diffusivity is approximately given by Spitzer’s formula (see Spitzer 1962, Schmidt 1966).

 

However, measurements in laboratory experiments and computer simulations have shown that under certain conditions, the resistivity of a plasma tends to be much higher than the Spitzer resistivity. We call them anomalous resistivity. And from observations, we can neither know the detailed value of resistivity. So, in numerical simulation, we can only use values according to our experience.

In this project, we will run a typical numerical simulation on magnetic reconnection during solar flares, based on the work of Yokoyama & Shibata in 2001. And see what will happen with different resistivities. Usually, a lower resistivity will result in a slower reconnection, a low temperature of the reconnected loop, etc.

  • Run the simulation

After you have correctly installed AMRVAC (for the installation of AMRVAC, you can check http://amrvac.org/ or the passage The Installation of AMRVAC in this site), you can run some 1D tests in the tests folder.

Then you can start the simulation.

I will give you 2 files, mod_usr.t and amrvac.par.

Create a new folder anywhere. And move these 2 files in this new folder. It would be your working directory.

mod_usr.t contains some subroutines for this project. In principle, it is not necessary to change anything in this file. But remember that once you have changed anything in this file, you use use the make command before you run a new simulation.

amrvac.par file contains some parameters used in the simulation. I will introduce a little bit more about the parameters here.

base_filename is the output directory and name of the output .dat files. By default, the output files would be in the current directory. Rename it for different cases. If you want to output the files somewhere else, like ‘/volume/mysimulation/flare/case1_’, do remember that this directory should exist before you run the simulation.

time_max = 5.d0 means the simulation will run from t= 0 to t=5 unit_time. By default, 1 unit_time in the code corresponds to 85.875s, so 5 unit_time is 429s. You can change it if necessary.

autoconvert=.true. means AMRVAC will also output a .vtu file besides .dat files. .vtu fies could be visualized easily with Paraview (or other tools).

dtsave_dat = 0.1d0 means AMRVAC will save the output files every 0.1 unit_time. If time_max=5.0, you will get 51 output .dat files.

xprobmin1=-7.5 and xprobmax1=7.5 (and also xprobmin2/xprobmax2) give the computational domain, e.g., x ranges from -7.5 to 7.5 unit_length while y goes from 0 to 15.0. By default, unit_length is 10 Mm. That means the domain is 150 Mm x 150 Mm.

domain_nx1=128 means you have 128 level 1 grid cells in the x direction in the simulation. That means your base resolution in the x direction would be 150 Mm/128=1172 km. Note that here we say level 1 grid. AMRVAC can adaptively refine the grids, the maximum refine level is set by refine_max_level. If refine_max_level=2, your effective resolution would be 1172 km/2=586 km, and if refine_max_level=3, it would be 586 km/2=293 km, etc. In this project, I think refine_max_level=3 or 4 is OK.

mhd_eta is the magnetic resistivity. You need to change this value and run different simulation. I recommend first trying these 5 values: 0.00002, 0.0002, 0.002, 0.02, 0.2.

Busr in this mhd_list controls the magnetic field strength. If necessary, you can also play with it.

OK, I think that’s all necessary information for this project.

Then, you can compile the these two files as you did with the tests, using the following commands:

setup.pl -d=2 -arch=default

make

After successfully compiling the code, you can run it by

mpirun -np 4 amrvac

The parameter 4 after -np means using 4 cores. You can change it according to your machine.

  • Analyze the results

You can have a quick look on the result by using Paraview (or other tools like Visit if you are more familiar with them).

Load the .vtu files and Apply (on the left side).

You can then choose the physical parameter you want to check through the pull-down menu. Te is temperature, b1/b2/b3 are magnetic field bx/by/bz, j1/j2/j3 are corresponding current density, p is thermal pressure, rho is density and v1/v2/v3 are velocity vx/vy/vz.

By default,

Te is in unit_temperature = 1 MK

p is in unit_pressure = 0.317538 dyn / cm**3

rho is in unit_density = 2.341668e-15 g / cm**3

v1 is in unit_velocity = 116.45 km/s

b1 is in unit_magneticfield = 2 G

Usually, we will first pay attention to temperature in this case. So choose Te and you will see the distribution of temperature.

Note that you can change between different snapshots by change the “Time” on top of the menu bar.

So, here is temperature distribution at another time. We can see the formation of the reconnected hot loop.

After you finish one case, you can change mhd_eta and run another case. In this way, you can have results for different cases. Compare the results and come to the conclusion. For example, the time evolution of the temperature at the reconnetion region should be quite different for different mhd_eta. Anyway, with the results, there are many things worth analyzing further.

ParaView is convenient, but Python can do more things. If you are familiar with Python, you can check the following links to see the Python tools in AMRVAC.

http://amrvac.org/md_doc_python_datfiles.html

http://amrvac.org/md_doc_python_vtkfiles.html

Good Luck.

Coronal Rain: 1D hydrodynamic simulation

In this passage, I will introduce a little bit more about the ‘1D corona rain’ project.

  • Background

First, some physical background about coronal rain.

You can see some videos to get some impression on it, like https://www.nasa.gov/mission_pages/sdo/news/coronal-rain.html. This might be the most famous video about coronal rain.

So, what is coronal rain ? How does it form ?

On our earth, rain is a very common phenomena. Liquid water is heated and evaporated into water vapor. Water vapor will then condenses to form clouds and precipitates back to earth in the form of rain and snow.

Coronal rain forms in a similar way. Plasma in the low atmosphere is cool and dense. It will be heated and evaporated up into the high corona. In the hot and tenuous corona, it will condense, becoming cool and dense again, and then fall back to the low atmosphere due to gravity.

The main difference between rain and coronal rain is the mechanism during the condensation. On the earth, water vapor condenses into clouds. That is simply because it is cooler in the high atmosphere than on the ground. But on the sun, the situation is different. The higher atmosphere, e.g., the solar corona, is much hotter than the low atmosphere, e.g., the chromosphere. The condensation is not directly due to the change of temperature.

Then, what is the mechanism for its condensation? That’s because of the radiation. Hot plasma will lose it energy due to radiation (usually noted as Λ(T), as function of temperature). In the equilibrium state, radiation is balanced by the continuous heating transferred from the low atmosphere. We call this heating background heating, which can help maintain the temperature of the solar corona. However, such an equilibrium is fragile. The following figure shows the radiation or the energy loss per unit volume, e.g., Lambda, as a function of temperature T. We can see that in the typical corona temperature (~1 MK), cooler plasma will lose more energy, which is different from our common sense.

If we give the system a small perturbation, the temperature will drop a little bit. It becomes cooler. So it will lose more energy and becomes even cooler. Such a catastrophic process is the `thermal instability’. Thermal instability plays an important role in many phenomena in the solar corona, like coronal rain, solar prominences or some eruptive fall back blobs.

  • Thermal Instability and Coronal Rain

We know that the sun has a much stronger magnetic field than the earth. In the solar corona, magnetic Lorentz force is much larger than some thermal forces like gas pressure. Consequently, MHD theory will tell us that motions in the solar corona is constrained or guided by the magnetic field line. Plasma can only move along the magnetic field lines, but cannot go cross. And its motions will have little influence to the magnetic field.

Given the above backgrounds, we can conclude the physical process into the following cartoon.

Here shows some magnetic field lines. We give some heating at the footpoints of the field lines. Plasma will then be evaporated into the high corona, cause a density perturbation in the corona. When the density is high enough or strictly the perturbation is high enough, thermal instability so that condensation will happen. The cool and dense plasma blob will form and then fall back to one of the footpoints of the field lines.

  • Previous simulations

Such a mechanism has been demostrated by some recent 2D or 3D simulations. The following figures are from 2D and 3D simulations, respectively.

Remeber that plasma will always move along the magnetic field lines while their affect to the magnetic field lines is minor. Motions in different field lines are independent. Especially in the 2D case, you can see this very clearly. Thus, to explain such a physical process, we only need to pick out a single magnetic field line (which is called a magnetic flux tube) and simulate the motions inside the one-dimensional (1D) flux tube, like the cartoon here.

Actully, this kind of 1D simulation has been used for more than 20 years. Although nowadays, 2D or even 3D simulations of coronal rain are available. 1D simulations are still useful because in 1D simulations the resolution could be very high. We can look into some details.

  • Problems and solutions

In 2D or 3D simulations, we often find that even after we add the heating for a long time, the condensation does not seem to happen. While for 1D simulation, the condensation can easily happen in most cases. Why?

Previous works found that it should be related to the resolution. The following figure show how temperature evolves with height, starting from photosphere. Between the chromosphere and the corona, there is a thin layer called transition region (TR). In the TR, temperature increase quickly, which means the temperature gradient is large. And this region is crucial for the evaporation process. If the resolution is not enough, temperature gradient cannot be calculated correctly, the energy (strictly, enthalpy) conducted by thermal conduction will be wasted in the even lower chromosphere. And the final consequence is the evaporation will be underestimated, or in other words, the perturbation in the solar corona cannot be strong enough. As a result, thermal instability will fail to happen in some simulations.

But in 2D or 3D simulations, such a high resolution as 1D is currently not affordable. So can we still have a physically `correct’ result using a low resolution setting? Recent research made it possible. We can artificially broaden the TR by setting a global cutoff temperature T_c (typically ~250, 000 K). For the region where is cooler than T_c, thermal conduction and radiative cooling will be modified artificially. The result of such a modification will broaden the TR without significantly changing the coronal properties. And by such a broadening, even with a low resolution (that is available by current 2D or 3D simulations), the evaporation could be calculated correctly. We will call it TFix method hereafter.

But there is a small drawback for the TFix method, as pointed out by some recent works. In some cases, the characteristic temperature of the TR can change dramatically during the simulation, making it unclear how suitable a fixed value of T_c is for capturing the dynamic evolution of the system that are impulsively heated. That is why they proposed another method, called the TRAC (transition region adaptive conduction) method.

In the TRAC method, cutoff temperature T_c is determined dynamically with the evolution of the system, making the result more reliable. However, it also suffers from a problem that the TRAC method is originally designed for 1D simulation only. If we apply it in 2D or 3D simulations, we have to calculated different T_cs for different field lines, which needs plenty of computation and will slow down the simulation.

To conclude, the TFix method can handle some problems, and has the advantage of simple and quick. While the TRAC method is more precise in the cost of more time (in multi-dimensional simulations).

  • Aim of the project

So, here is our question and the aim of the project. We want to know, in what kind of heating events, the TFix method can give reliable / acceptable results? While in what kind of heating events, the results given by the TFix method will deviate obviously from the result given by the TRAC method?

I will give you tens of different heating cases, corresponds to different types of heating, like steady heating, impulsive heating or even explosive heating. You should run each case by the TFix method and the TRAC method, respectively. And compare their results to see in which cases, two methods show similar results while in which cases, two methods show significately different results. For example, you can organize the results in a table:

No correction TRAC TFix
(T_c=200,000 K)
TFix
(T_c=300,000 K)
TFix
(T_c=500,000 K)
case 1
case 2
case 3
case 4
case …
  • Run the simulation

After you have correctly installed AMRVAC (for the installation of AMRVAC, you can check http://amrvac.org/ or the link mentioned in the first email), you can run some 1D tests in the tests folder.

Then you can start the simulation.

I will give you several files.

You need to

Move setdt.t and mod_global_parameters.t into amrvac/src/

Move mod_trac.t into amrvac/src/mhd/

Move mod_hd_phys.t into amrvac/src/hd/

To replace the files there.

Then, there are still 2 files, mod_usr.t and amrvac.par.

Create a new folder anywhere. And move these 2 files in this new folder. It would be your working directory.

mod_usr.t contains some subroutines for this project. In principle, it is not necessary to change anything in this file. But remember that once you have changed anything in this file, you use use the make command before you run a new simulation.

amrvac.par file contains some parameters used in the simulation. I will introduce a little bit more about the parameters here.

base_filename is the output directory and name of the output .dat files. By default, the output files would be in the current directory. Rename it for different cases. If you want to output the files somewhere else, like ‘/volume/mysimulation/coronalran/case1_’, do remember that this directory should exist before you run the simulation.

time_max = 600.d0 means the simulation will run from t= 0 to t=600 unit_time. By default, 1 unit_time in the code corresponds to 85.875s, so 600 unit_time is 14.3 hrs. I think it should be suitable for most of the cases. You can change it if necessary.

autoconvert=.true. means AMRVAC will also output a .vtu file besides .dat files. .vtu fies could be visualized easily with Paraview (or other tools).

dtsave_dat = 2.d0 means AMRVAC will save the output files every 2.0 unit_time. If time_max=600, you will get 301 output .dat files.

Here, iprob corresponds to different cases. iprob=1 corresponds to case 1, iprob=2 corresponds to case 2, etc. As mentioned in the previous email, cases are select from Table 1 in Johnston et al. 2019, A&A 625, A149. Do read the paper before you run the simulation.

xprobmin1=0 and xprobmax1=18 give the computational domain, e.g., x ranges from 0 to 18 unit_length. By default, unit_length is 10 Mm. That means x is from 0 to 180 Mm.

domain_nx1=360 means you have 360 level 1 grid cells in the simulation. That means your base resolution would be 180 Mm/360=500 km. Note that here we say level 1 grid. AMRVAC can adaptively refine the grids, the maximum refine level is set by refine_max_level. If refine_max_level=2, your effective resolution would be 500km/2=250 km, and if refine_max_level=3, it would be 250 km/2=125 km, etc. In this project, I think refine_max_level=1 or 2 should make the resultco resolution used in 3D simulation. Level 3 is not necessray.

If hd_trac is false, the simulation will not use any correction.

If it is true, you have to set hd_trac_type. In this project, you have two choices, hd_trac_type=1 means using the TRAC method; hd_trac_type=6 means using the TFix method. And when using TFix method, you have to tell the code the fixed cutoff temperature T_c by setting Fixed_tcoff. By default, unit_temperature=1 MK. That means if you want to sett T_c=250,000 K, you have to set Fixed_tcoff=0.25.

OK, I think that’s all necessary information for this project.

Then, you can compile the these two files as you did with the tests, using the following commands:

setup.pl -d=1 -arch=default

make

After successfully compling the code, you can run it by

mpirun -np 4 amrvac

The parameter 4 after -np means using 4 cores. You can change it according to you machine.

  • Analyze the results

You can have a quick look on the result by using Paraview (or other tools like Visit).

Load the vtu files and Apply (on the left side).

Using the tool “Plot Over Line”, and Apply.

This tool will plot the distribution of some physcial quantities along the 1D coordinate. You can choose between Te (temperature), p (gas pressure), rho (density) and v1 (velocity). They are all shown as dimensionless quantities.

By default,

Te is in unit_temperature = 1 MK

p is in unit_pressure = 0.317538 dyn / cm**3

rho is in unit_density = 2.341668e-15 g / cm**3

v1 is in unit_velocity = 116.45 km/s

Take temperature for example, you can see the initial distribution of temperature.

Note that you can change between different snapshots by change the “Time” on top of the menu bar.

So, here is temperature distribution at another time.

ParaView is convenient, but Python can do more things. If you are familiar with Python, you can check the following links to see the Python tools in AMRVAC.

http://amrvac.org/md_doc_python_datfiles.html

http://amrvac.org/md_doc_python_vtkfiles.html

Anyway, after you finish one case, you can change iprob, hd_trac and hd_trac_type. In this way, you can have results for diffrent cases. Compare the results and come to the conclusion.

Good Luck.

one-dimensional(1D) hydrodynamic(HD) simulation: formation of solar prominences

In this passage, I will introduce how to use AMRVAC to do a 1D HD simulation.

First, I will give some background information of the physics behind the simulation.

Solar prominences are cool and dense plasma suspending in the solar corona. Like the picture here.

They are usually 100 times cooler and 100 times denser than the surronding environment.

Then, a straightforward question is, why such a heavy thing could float in the corona?

You might say that, well, it is similar with clouds floating in the air.

But actually it is different.

Although clouds are composed of water, their density is close to the air, only a bit heavier. So that most of the clouds are actually going down with a very low speed.

However, for solar pormineces, they are really heavy, 100 times denser. Why they can still float in the corona?

Nowadays, it is believed that, solar prominence are supported by the Lorentz force. On the earth, magnetic field is weak. We cannot feel the effect of Lorentz forece. But on the sun, magnetic field is so stronge that the plasma could be supported by the Lorentz force. Especially on the solar corona, everything is dominated by the magnetic field, and the plasma is trapped inside the magnetic field. Suppose I have a magnetic line, like shown in the figure below. Then, plasma can only move along such a magnetic line.

Then, it is easy to image that, if the magnetic field line has a upward dip, it is possible to support the heavy plasma, e.g., solar prominence.

However, here comes another question. Why is the prominence come from?

Well, you must know that the cloud on the earth is formed by sort of evaporation and condensation. While for the prominence, though we have many mechanisms to explain that, one of the most popular mechanism is call `evaporation and condensation’ model.

As shown in the GIF below. If I have a strong heating (caused by some activities in the lower atmosphere usually in the photosphere or chromosphere), at the footpoints of the magnetic field lines, plasma will be evaporated and then accumulated at the top of the magnetic field line. Here, condensation might happen because of a physical process called `thermal instabiliy’. So that we can see the formation of a cool and dense solar prominence.

Then, what is `thermal instabiliy’ ?

Well, briefly, plasma will alway loose their energy, all the time everywhere. But note that we have a global heating in the corona (so that corona is always hotter than chromosphere), they can usually make a balance between the loss and the gain of the energy.

However, plasma at different temperature will lose their enery with different speeds. See the figure below. The dashed (or solid) curve, called cooling curve, describes how much energy plasma at a certain temperature will lose per second.

Solar corona is usually at a temperature of 1 MK, e.g., 10^6 K. Then, suppose that plasma at 1 MK is suffered from some perturbation, and its temperature dropps to 0.99 MK. From the curve, you can see that it will lose more energy, while at the same time, the energy it gains from the global heating is not changed. So the balance is broken. It will lose more and more energy and become cooler and cooler. Such a catastrophic process is the `thermal instabiliy’.

In AMRVAC, we have a test code for the formation of solar prominece.

Note that, everything happens in a 1D rigid tube, and plasma now could be understand as normal fluid, a 1D hydrodynamic simulation is enough to simulate such a physcial process.

This code works in two stages.

First step, the code start from an hydrostatic equilibrium state, we only have a background global heating. We relax it to a thermal dynamic equilibrium state. This stage is from t=0 to t=200.

Second step, after we get an equilibrium tube, we start to add the strong heating at footpoint so that evaporation could happen. This stage is from t=200 to `time_max’ you input to the code (see below).

In the folder amrvac/tests/hd/prominence_formation_1D, you can find the mod_usr.t file and amrvac.par.

Move them to your own folder, complie it. Then, everything you need to do is in the amrvac.par file.

You can now run the code directly with the commend `mpirun -np 2 amrvac’ (here -np 2 means using 2 cpus, 2 or 4 is recommended for these test code). But before that, I recommend to change two lines in the amrvac.par file: time_max and refine_max_level. Time_max = 400 is enough for most cases. Refine_max_level = 3 is already good enough, setting it to 4~6 would have a better result but will spend much more time.

Save an exit the .par file and run the code.

With my ten-years-ago ancient mechaine, it is finished in 10 minutes. I guess it would be faster in your Macbook or desktops.Now you can check the result with ParaView, OK and Apply (on the left side).

Use the `plot over line’ tool, Apply.

And then, on your left side, you can see all the avaliable variables. Here we choose `Te’, means temperature in the unit of 1 MK. (rho is number density in the unit of 10^9 / cm^3, p is pressure with the unit of 0.317 erg / cm^3, and v1 is velocity with the unit of 116.45 km/s.). Untick other variables.

Then, on the right side, you can see the initial temperature distribution.

Find the time box on the top of the tool. Change it to 40. Since in the code, we save our snapshots every 5 time unit (controlled by the parameter dtsave_dat = 5.d0), the 40th snapshot should be t=40*5=200, e.g., the end of our first stage.

This is what temperature profile looks like at t=200, a nice curve.

With continous heating, you will find the temperature changes dramatically. And at the 52nd snapshot, you can already see that the temperature at the center drop down to 0.01, or 10^4 K. We have successfully got the prominence.

Note that, by default, we use the cooling curve called `JCcorona’.

In the amrvac.par file, you can find it.

Well, it is a good curve and has been used in many simulation works. But there are many other cooling curves calculated from different assumptions. In AMRVAC, you can set the coolcruve parameter to Hildner, FM, RP, DM, MB, MLsolar1, cloudy_solar, SPEX, SPEX_DM. You can find them in amrvac/src/physics/mod_radiative_cooling.t file.

The above mentioned curves are all calculated based on solar metallicity. But the results could be different. For example, we see the formation of prominence at the 51st snapshot (or 51*5=255 time unit) with the default JCcoroan curve, but using other curves might give you different results.

You can also quantify some other phsycial quantities and include them in your results. For example, with cooling curve A, the formation happens at t1=280, after 100 time unit, e.g., t2=380, the prominence has a denisity of xx, temperature of yy, the length of the promince is zz. But for cooling curve B, the formation happens at t1’=310, the, at t2’=410, you can measure its density xx’, temperature yy’ and the length zz’. They should also be different from curve to curve.

P.S. You can set the parameter `dtsave_dat’ smaller to have more output snapshots.

P.S.2 ParaView is convenient, but Python can do more things. If you are familiar with Python, you can check the following links to see the Python tools in AMRVAC.

http://amrvac.org/md_doc_python_datfiles.html

http://amrvac.org/md_doc_python_vtkfiles.html

Good luck ~

The Basic Knowledge of AMRVAC – 2. LASY

Actually, all the .t files in AMRVAC are wrote in Loop Annotation Syntax(LASY). then, when you do the “make” commend, .t files will converted to .f files, which are standard F90 files, through a tool in AMRVAC called vacpp.pl. then, the compiling are done with this .f files. So you AMRVAC is basically a Fortran code, you can write your own part, meaning mod_usr.t, in Fortran Syntax, that is no problem. But at least, I think you should know some basic idea of LASY, which would be much more convenient. 继续阅读“The Basic Knowledge of AMRVAC – 2. LASY”

The Basic Knowledge of AMRVAC – 1. Equation & Dimension

In this note, I will introduce basically what you should do to play with AMRVAC. As a highly modularized code, for most cases, users only need to write/modify two files according to their own questions, namely, the mod_usr.t and amrvac.par file. mod_usr.t is the user code for this problem (defining e.g. initial conditions) while amrvac.par is a text file saving all kinds parameters. 继续阅读“The Basic Knowledge of AMRVAC – 1. Equation & Dimension”

The Installation of AMRVAC

In this note, I will introduce how to install the code AMRVAC on your own PC or laptop. Actually you are suggested to have some basic knowledge of Unix-like operating system (OS). If you are quite familiar with Linux or macOS, you can go through this note quickly. If you haven’t too much experience, you can also simply follow me step by step. But there is a possibility that you might not be able to solve the problems that might happen during the installation. While for servers, the administrators or somebody like that should provide you the required environment, you can skip directly to the last part to install only AMRVAC.

继续阅读“The Installation of AMRVAC”