-
Notifications
You must be signed in to change notification settings - Fork 115
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
Magnetic field in TrackParticle and ParticleBinning diagnostics #717
Comments
Just a precision: the magnetic field is shifted by half a timestep compared to its value from Field diagnostics. Right? Is this what you meant? |
Not exactly. It is shifted by half a timestep and half a spatial step. In particular, if particle moves along x direction inside the plane wave, which is propagating in -x direction, then the vector of the transverse magnetic field (B_y,B_z) in TrackParticles/ParticleBinning diagnotics is rotated by the angle phi=timestep*(1+v_x)/2 |
I don't understand how there could be a spatial shift. Is it due because of the wave displacement during that half timestep? |
I think it is due to the particle displacement during the half timestep, since there is the term timestep*v_x/2 |
But what do you compare it with? The field diagnostic? If yes, i believe those are not properly aligned (by half a cell) in happi |
No, actually I calculate the longitudinal component of the Lorentz force ([v x B]_x, for circular polarization it is also the ponderomotive force), and I know that (at least for rare plasma) the integral over time of it should be equal to zero. It is zero ideed after the rotation I described above. |
@egelfer Could you try your test using the option |
Actually I used the option keep_interpolated_fields=["Ex","Ey","Ez","Bx","By","Bz"]. Do you want me to run the test without it? |
yes that would be good. Now your result is puzzling. Those fields are supposed to be exactly those calculated for pushing particles |
Yes, I also assumed it and was very much surprized :) |
Yes, I suppose that might be the source of the shift |
Did you manage to test without |
Did you test without |
I made some changes in the documentation in branch develop. Please reopen if necessary |
Sorry, I forgot to answer. In this case the simulation crushes. I also wanted to ask, is it possible to output the magnetic field in a way similar to when the force acting on a field is calculated (https://smileipic.github.io/Smilei/Understand/algorithms.html#the-pic-loop), i.e. (B_p^{(n+1/2)}+B_p^{(n-1/2)})/2 ? Unfortunately my method to recover the correct field is valid only for a plane wave, and it is not always the case. |
|
That's what I assumed! :) But it is not, what I've got. Here is the plot of average longitudinal momentum (darkred, obtained from the ParticleBinning diag) in the collision of electron-positron bunch with a pulse plane wave. Magenta curve corresponds to the integral of the (averaged over the particles) force F_x= [v x B]_x+E_x with the E and B fields obtained from TrackParticles diag. Orange curve corresponds to the integral of F_x'= [v x B']_x+E_x, where B' is B shifted by a half step. However, as I wrote above, it works only for a plane wave field. |
Are you using the velocity from tracked particles as well? As the fields and velocities differ by half a timestep that might be the problem |
Yes, the velocities are taken from TrackParticles diag as well |
Well then there you have it. It is not the fields that are out of phase. It's the velocities |
Hi! It seems that TrackParticle and ParticleBinning diagnostics output the magnetic field, which is half step shifted (both in space and time) from the particle. Is it possible to shift it back? Or maybe at least it would make sense to point it out in the documentation?
The text was updated successfully, but these errors were encountered: