SmileiPIC / Smilei

Particle-in-cell code for plasma simulation
https://smileipic.github.io/Smilei
344 stars 121 forks source link

Alfven wave absorption boundary conditions #743

Open fyli16 opened 2 months ago

fyli16 commented 2 months ago

Looks like the old issue #565 was closed, not sure if my latest update to that issue was drawing any attention, so I am trying to reopen the case with a new issue here. Basically I'd like to achieve absorption boundary conditions for low-frequency Alfven waves. I had tried both silver-muller in 1D and PML in 2D and used a reference frequency close to the Alfven wave frequency, and these didn't work. I'd be happy to explore other options with the developers and SMILEI community to realize the absorption feature.

mccoys commented 2 months ago

Hi, the issue here is that actually we don't really know what is happening at the boundary in your case. A close analysis of the field evolution would be necessary in the first place.

I might be wrong, but I believe that the Silver-Muller conditions implicitly assume a wave that goes at the speed of light. Could it be the issue here? Maybe this could be tested using parameters that make the Alfven wave phase velocity close to c? Like very large B.

Maybe another idea would be to slowly damp the wave in a plasma gradient (I guess density should decrease slowly).

fyli16 commented 2 months ago

Hi @mccoys, thank you for your response and suggestions.

  1. what kind of 'close analysis of the field evolution' do you have in mind? Do you mean the field evolution inside the absorption layer? Are these fields exposed to regular diagnostics?
  2. I will try large B0 to confirm if the 'light speed' assumption is the key to this issue. Meanwhile, could you point to me any resources/materials about how Silver-Muller is implemented in SMILEI?
  3. I am also thinking of implementing a field mask to SMILEI, e.g. based on Eq. 4 of this paper: 2001_Umeda_masking.pdf would you think this is feasible? Thanks.
Z10Frank commented 2 months ago

The philosophy of Eq. 4 of the paper you attached is similar to the one in PML (compare Fig. 3 with Fig. 1 in https://arxiv.org/abs/2409.06287). Can you check what happens when you increase the number_of_pml_cells?

mccoys commented 2 months ago

@fyli16

  1. With the Silver-Muller conditions, I meant to check the value of the field in the last few cells, and their evolution. Check that it follows Maxwell + Silver-Muller (see for instance https://people.frib.msu.edu/~lund/uspas/sbp_2018/lec_em_pic/A1b_EM_Waves.pdf) and try to understand what makes it reflect the wave.
  2. Yes I think the wave phase velocity is really an issue for the silver-muller conditions. The implementation in smilei is really the same as I sent in the link
  3. As mentionned by @Z10Frank the technique by Umeda does not sound very different from PML. Instead, I suggest to try to make some space in the simulation for a plasma buffer.
Z10Frank commented 2 months ago

Also, you have particles at the borders, with thermalise boundary conditions: this may not be physically consistent, but to understand its effect can you try to use a large box to leave some cells of vacuum at the borders?

fyli16 commented 2 months ago

@mccoys @Z10Frank Thank you both for the comments and insights.

As a first step, I tried to increase the number_of_pml_cells and leave a small vacuum gap at the borders or not. Looks like these are not helping. A strange observation is that when I use larger number_of_pml_cells (i.e. 640 as opposed to 64), the resulting wave amplitude is significantly smaller as shown below. I don't understand how number_of_pml_cells would affect the wave amplitude. (all other parameters kept unchanged)

1) No vacuum gaps

image

2) Including a vacuum gap of 3 di on either side

image

Next I will test with larger wave speed and will post later.

fyli16 commented 2 months ago

Now I can confirm that by increasing the Alfven speed (through reducing wpi/wci = c/v_A) from 0.01c to c, the reflectivity is reduced from near 100% to ~35%, as illustrated in the following plot. Green-color 'S-' is the Elsasser component indicating left-going reflections, and blue/orange curves are respectively the Alfven wave magetic field and velocity field. These are quasi-1D simulations (a few cells in Y with periodic boundary conditions, while X adopts PML, and the plasma fills in the whole domain).

image

This test might confirm that the wave speed is playing an important role here, but the reflectivity does not go to 0 under wpi/wci=c/v_A = 1. Additionally, large wpi/wci (e.g. on the order of 100) is of physical interest to me, so the question of how to improve the PML absorption under large wpi/wci (or small wave speeds) remains. I will look more into how PML is implemented in SMILEI. Meanwhile, any insights are welcome and appreciated.

mccoys commented 2 months ago

My point about the wave speed concerned Silver muller conditions only. Have you tried it?

Also have you tried setting up a density gradient to damp the wave?

fyli16 commented 2 months ago

1D SM conditions under wpi/wci=1 gives very similar results as quasi-1D PML; see below.

image

Regarding the density gradient, do you mean sth like this? I don't see why a density gradient would cause the wave to damp. @mccoys

image
mccoys commented 2 months ago

Concerning the density gradient, I was just thinking that there might be some wave coupling that would convert the Alfven wave into some other kind of wave (maybe EM) that could more efficiently get absorbed.

Guilleaumes commented 1 month ago

Hi! If I understand your problem and what Alfven waves are, you need two ingredients: An external magnetic field ( B_0 ) whose direction will be that of the future waves. And you also need a plasma.

I might be wrong, but there exists a feedback loop for these waves: Transverse ionic current planes to ( B_0 ) that seed a perturbation of the ( B_0 ) field. A Lorentz force appears, changing the direction of the current planes, which generates the magnetic field perturbation.

According to Maxwell, this creates a small ( E ). So, we have a ( k, E, B ) wave that moves in the direction of ( B_0 ) and needs the support of the plasma.

No support, no magnetic perturbation, no wave.

So, by playing with the mobility of the ions or their presence, you should attenuate the wave. Or perhaps gradually cutting ( B_0 ) might work?

Numerically, this decrease in density and/or external field must be gradual to avoid reflections due to the “abrupt” nature.

Moreover, a simulation where the plasma is far from the edges should help us better understand. Because in fact I don't know if this wave can go outside of the plasma and can these waves propagate in a vacuum?

Good to know : The PML implementation does not consider any plasma in the PML region.

fyli16 commented 1 month ago

@Guilleaumes Thanks for your comments!

The fact that the PML does not contain plasma may be a key issue for this problem. As shown in my previous reply, the wave does get reflected at the right end of the plasma (not the right boundary of the box) when I introduce a small vacuum gap (3 di in that case) in the simulation.

Previously @Z10Frank mentioned that PML is not very different from Umeda's field mask technique. Now I guess the key difference is Umeda's field mask can involve plasmas.

So, a quick question is --- can we involve plasma in the current PML design?

mccoys commented 1 month ago

In the current implementation, there is no way to have plasma in the PML. This would be a very significant change. In my opinion, it could be easier to modify the silver-muller conditions: I believe they can be modified to emulate the permittivity of a medium instead of vacuum.

fyli16 commented 1 month ago

@mccoys Thanks! I'll look into silver-muller and see how this may be modified.

Meanwhile, could you comment on the feasibility of implementing Umeda's field mask as illustrated in sketch (a):

  1. put wave injection (vertical dashed line) inside the plasma
  2. leave a finite thickness plasma layer on each side of the simulation box as wave absorption layers, where the wave is aggressively damped by masking the Maxwell equations, following Eq. 4 of Umeda's paper.
  3. we may also consider a non-uniform background B0 field in the mask layers to slow down the wave, so that the wave undergoes more iterations of damping as it traverses the absorption plasma, as sketched in (b). This may help reduce the thickness of absorption plasma layers and hence computation. This would be similar to the factor 'beta' introduced in Eqs. 21-24 of Umeda's paper.

image

In fact, I had done this with a hybrid code (kinetic ions, massless electron fluid): Eqs. 1-2 of this paper, and Fig. 1b of this paper. I assume SMILEI is much more complicated than the hybrid code I used, so I'd like to see approximated efforts needed in doing the same with SMILEI.