Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alfven wave injection and absorption #565

Closed
fyli16 opened this issue Sep 30, 2022 · 11 comments
Closed

Alfven wave injection and absorption #565

fyli16 opened this issue Sep 30, 2022 · 11 comments
Labels
feature-request something that could be added to the code physics physical behaviour or physical modules

Comments

@fyli16
Copy link
Contributor

fyli16 commented Sep 30, 2022

I wonder if an Alfven wave can be injected into the simulation like the attached paper for Osiris. Though the low-frequency Alfven wave is normally studied with MHD and hybrid codes at ion scales, in some important cases the electron scale physics is also very important which needs the use of full PIC. The availbility of this feature would enable the study of a variety of laboratory and space plasma issues using Smilei. Thanks.

2005_Tsung_1.1832602.pdf

@fyli16 fyli16 added the feature-request something that could be added to the code label Sep 30, 2022
@MickaelGrech
Copy link
Contributor

Hello Feiyu. I had a look at the boundary conditions used in the paper by Tsung and co-workers. I think you can do something very similar in Smilei right now.

Considering a 2D geometry in Smilei we have axes (x,y) [corresponding to (z,x) in Tsung et al.] and I'll use this convention for the axes. In the y-direction, you will use periodic boundary conditions. In the x-direction, you will use:

  • in xmin: the Silver-Muller boundary conditions for the electromagnetic + a laser that should allow you to launch your Alfven wave, and particles will be thermalized (for the thermalizing temperature use the initial plasma temperature),
  • in xmax: same as xmin but no laser here.

Now, in Tsung's paper, they use a boundary condition that requires you to define the transverse electric field. In Smilei, we instead define the transverse magnetic field. I think defining a magnetic field as given by Eq. (1) of Tsung's paper should work for you. This you can do addind a "laser"

Laser(
    box_side = "xmin",
    space_time_profile = [ By_profile, Bz_profile ]
)

where By_profile and Bz_profile are function of y and time 't', e.g. you could use:

def Bz_profile(y,t):
    return E0 * numpy.exp(-(y-y0)**2/w**2) * g(t/tau) * numpy.cos(w*t+theta)

with E0, y0, w, g(t/tau) and theta defined in Tsung's paper.

@fyli16
Copy link
Contributor Author

fyli16 commented Oct 3, 2022

@MickaelGrech Hi Mickael, thanks for your response! I will try this out and update later here on the performance. It might be useful for others needing the same feature.

@mccoys mccoys added the physics physical behaviour or physical modules label Oct 4, 2022
@mccoys
Copy link
Contributor

mccoys commented Nov 9, 2022

@fyli16 Any news on your attempts? Is this issue still relevant?

@fyli16
Copy link
Contributor Author

fyli16 commented Nov 9, 2022

Will update later.

@fyli16 fyli16 closed this as completed Nov 9, 2022
@fyli16
Copy link
Contributor Author

fyli16 commented Feb 21, 2023

sorry for late update, finally got time to try this out. Following @MickaelGrech advice, by injecting the wave using the transverse B field, it looks like the wave can be successfully injected. Here is the input deck (for anyone who might be interested, and also for diagnosing potential issues):
input.txt

Here is a snapshot of the wave injection:
image

However, there is an issue. Despite using 'silver-muller' for absorption EM boundary conditions, the Alfven wave is reflected upon reaching the right boundary; see this space-time plot of the By field component:
image

This is a 1D simulation. Anyone could help with or comment on this issue, i.e. how to effectively/efficiently achieve absorption boundary conditions for an Alfven wave in the PIC code?

I also found 'PML' boundary condition is not available with 1D, otherwise, perhaps I may try increasing the 'number_of_pml_cells' to achieve a more gradual absorption of the wave, which may help?

Thanks.

@fyli16 fyli16 reopened this Feb 21, 2023
@fyli16 fyli16 changed the title Launch an Alfven wave from a boundary Alfven wave injection and absorption Feb 21, 2023
@mccoys
Copy link
Contributor

mccoys commented May 10, 2023

@fyli16 I had a new look on this issue. If I understand correctly, your normalized ion plasma frequency wpi = 1. It means that the normalized wci ~ 1/100. Thus I imagine your Alfvén wave frequency much lower than 1.

However, the current boundary conditions are made for frequencies close to 1. There is even a fixed value hardcoded here:
#src/ElectroMagnBC/ElectroMagnBC2D_SM.cpp#LL52C12-L52C17
This is in 2D but the idea is likely identical in 1D.

Is there a way you could re-scale your frequencies and plasma parameters so that the wave frequency equals 1?

@fyli16
Copy link
Contributor Author

fyli16 commented May 17, 2023

@mccoys It is possible to reccale the frequencies to have the wave frequency ~1 ref. frequency, but the resulting plasma density will be exceedingly large.

Say ref. frequency wci (Alfven wave frequency to be studied is typically ~0.5 wci), then the plasma density will be

n0 = epsilon0 * mi * wpi^2/e = (epsilon0 * me * wci^2/e) * (mi/me) * (wpi/wci)^2 ~ 10^6 * Nr, assuming reduced mass ratio mi/me ~ 100, wpi/wci ~ 100

That might be very demanding in computing, e.g. requiring very large number of particle per cell to have reasonable particle noise?

@mccoys
Copy link
Contributor

mccoys commented May 17, 2023

You don't need to have your reference frequency wr equal to wpi or wci. You can set it to whatever you like, and maybe you should chose wr equal to the wave frequency. These do not affect the computing time as you can also scale your cell length and timestep accordingly. The point is that you need your wave frequency close to 1, in normalized units.

@mccoys
Copy link
Contributor

mccoys commented May 17, 2023

Another way to put it is that you change the units system, not the physical setup

@fyli16
Copy link
Contributor Author

fyli16 commented May 17, 2023

I was just wondering if the large plasma density ( ~ 10^6 N_r) under the new frequency normalization (where wave frequency ~ ref. freq.) is numerically a concern or not for Smilei. Perhaps I can do some tests to find out.

Anyway thanks for pointing out the wave freq. ~ 1 issue in the boundary implementation @mccoys

@mccoys mccoys closed this as completed Jun 20, 2023
@fyli16
Copy link
Contributor Author

fyli16 commented Sep 9, 2024

Hello developers,
a late update: I tried setting the reference frequency wr to wci, so the launched Alfven wave frequency is 0.63 wr, very close to the ref. frequency. I still got nearly complete reflections on the right boundary.

So far, I've tried 3 scenarios:

  1. 1D, silver-muller, wr=wpi, external field for the background magnetic field Bx0
  2. 1D, silver-muller, wr=wci, external field for the background magnetic field Bx0
  3. 2D, PML in X, periodic in Y, wr=wci, prescribed field for the background magnetic field Bx0

The input for 3) is attached here:
input_quasi-1d_PML_prescribedfield.txt

The results are shown below. I don't see an improvement in wave absorption using wr=wci. Near-complete reflections are found in all 3 scenarios.

image

Is there anything else missing, other than letting the wave frequency be as close to the ref. frequency as possible? Any thoughts and suggestions for further investigations in order to realize an absorption boundary condition for Alfven waves in SMILEI? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request something that could be added to the code physics physical behaviour or physical modules
Projects
None yet
Development

No branches or pull requests

3 participants