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

Plasma density gradient falling edge #1140

Open
Zxy-1104 opened this issue Jul 29, 2024 · 4 comments
Open

Plasma density gradient falling edge #1140

Zxy-1104 opened this issue Jul 29, 2024 · 4 comments

Comments

@Zxy-1104
Copy link

Hello, I would like to ask a question about the plasma density gradient setting
In the input file, I set a plasma density gradient falling edge, but in the output file, I don't see this falling edge.(As shown in the first image, it shows rho_electron)
And the second picture shows that at the beginning, I set the density distribution, but why is the density 0?
image
image
input.txt

@AlexanderSinn
Copy link
Member

AlexanderSinn commented Jul 30, 2024

Hello,
due to HiPACE++ using the quasi static approximation, the same plasma particles are used for all z positions inside a single time step. This means that the gradient in the z-direction can only be seen when comparing multiple time steps with z=c*t. For this, it's easiest to use the plasma in-situ diagnostic plasmas.insitu_period = 1 (see image). Here it can also be seen that the plasma density is zero on the first step. This is because the first step evaluates (z<0e-6)*3.e25+(z>320e-6)*1.e25+(z>0e-6)*(z<320e-6)*(3-(2/320e-6)*z)*1.e25 at z=0 so both (z<0e-6) and (z>0e-6) are zero. This can be fixed by using >= instead: "(z<0e-6)*3.e25+(z>320e-6)*1.e25+(z>=0e-6)*(z<320e-6)*(3-(2/320e-6)*z)*1.e25" (note that "" is required with this).

image

@Zxy-1104
Copy link
Author

Thank you for your answer. However, I'm wondering if maintaining the same density in each time dimension will affect the accuracy of the calculation. In reality, the density gradient is time-independent. If I position a Gaussian beam at the initial location of zero (considering that both the grid and particle beam have a certain size) in a non-quasi-static situation, half of it will be in a uniform plasma at the start, and the other half will be in a falling edge. In the quasi-static case, the initial time is it calculated in terms of the particles being in a uniform plasma, and I want to know does that make a difference?

@MaxThevenet
Copy link
Member

Hi @Zxy-1104,

Although a time step in HiPACE++ outputs the problem as a function of zeta (the longitudinal coordinate in your plots above) at a fixed propagation tstep (the physical time of the current time step), you could see such a quasi-static code as computing the problem as a function of time t = -zeta/c, at a fixed propagation position z = t_step*c. This explains why the density is uniform on your plot above. While both representations are correct, a plasma density varying too quickly longitudinally may very well cause violation of the quasi-static approximation.

Just being curious: could you say a few words on the use case that you are trying to model? Such a strong downramp could lead to downramp injection, but this mechanism typically violates the quasi-static approximation and cannot be modelled within HiPACE++.

@Zxy-1104
Copy link
Author

Zxy-1104 commented Aug 9, 2024

Thank you for your answer. In fact, this example is not the one we use now, but the one we used in a previous paper we investigated, calculated in EPOCH , and I tried to emulate it in HIPACE++, but I did ignore the quasi-static approximation problem, for which I am very sorry. Density gradient in my work is ((z<1.5e-1)((1/0.15)(z)(8.e22))+(z>1.5e-1)(z<1.35)8.e22+(z>1.35)(z<1.5)*(((-1/0.15). We assume the beam evolves slowly compared to the timescale of the plasma response, and this gradient does not violate the quasi-static approximation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants