fbpic / fbpic

Spectral, quasi-3D Particle-In-Cell code, for CPU and GPU
http://fbpic.github.io
Other
173 stars 71 forks source link

CALDER-CIRC and FBPIC results mis-match #611

Closed koesterf closed 1 year ago

koesterf commented 2 years ago

Hi,

Great work !!

I am wondering if there is some bench marking available with already published results or not. Recently, I found that some results strongly mis-match with published one using CALDER-CIRC code.

I guess, FBPIC is somewhat similar to CALDER-CIRC. I also think that the results from both code should not differ very much. But seems that this is not the case and there is quite big difference sometime.

Could you please see the attached pdf file where I tried to reproduce one particular results with FBPIC code. This is not the only case, but would like to know what do you think about such differences. How to check which is more correct.

Best, F. Koester

Bench_mark_calderCirc.pdf

RemiLehe commented 2 years ago

Sorry for the late reply and thanks for your interest in the code.

Calder-Circ and FBPIC are indeed similar, but they also have important differences. In particular, Calder-Circ has a finite-difference Maxwell solver, whereas FBPIC has a spectral solver. (You can find more discussion of these differences on this page and in the original FBPIC paper.) In practice, the differences between finite-difference and spectral solvers can occasionally lead to significant differences in simulations, especially for the injected electron beam (see figure 6 of the original FBPIC paper).

For the issue that you described in the above PDF, could you confirm that the differences that you are worried about are indeed concentrated on the injected electron beam (esp. its detailed shape)?

Also: I would recommend to re-run this simulation with the exact same parameters as in the paper that you are trying to reproduce. In particular, the numerical parameters (resolution, etc.) are summarized in the Methods section. Of particular importance is the number of particle per cell: the authors indicate that they use 48 particles per cell ; for FBPIC I would recommend to achieve this with p_nr = 2, p_nz = 2, p_nt = 12 (i.e. p_nt = 4*Nm as recommended in the FBPIC documentation)

I hope the above helps clarify the issue. Of course, feel free to let me know if you have additional questions on the above.

RemiLehe commented 2 years ago

Hi, Thanks a lot for sharing these additional details. The fact that the injection varies so much with the particle shape is indeed quite intriguing. Would you be willing to share your full input script so that I could have a more detailed look at this issue? Thanks.

koesterf commented 2 years ago

Thanks for quick response. But, the python file cannot be uploaded on github (no option to upload such files).

I will send you by email (I don't understand why I cannot upload the file when trying to upload).

Sorry for the inconvenience.

koesterf commented 1 year ago

Hi Remi,

Did you get some time to check the script ? Is it OK or I did something wrong ?

Thanks.

RemiLehe commented 1 year ago

Hi,

The script looks valid. The fact that the distribution of the beam is different with linear and cubic is indeed strange. I guess I have a few more questions:

koesterf commented 1 year ago

Hi,

Thanks for the suggestion. You are right, when I increased the axial resolution from λ/32 to λ/64 the injection process starts converging to cubic one.

Before I close the issue, could you suggest, like n_pt = 4*Nm, what is the good value of Nm, n_pr, and n_pz one should consider in the simulation to be sure that the results are physical and less prone to numerical heating / error.

Thanks.

RemiLehe commented 1 year ago

Hm, I not sure that there are any good rule of thumb, but I usually use n_pr = 2, n_pz = 2. Regarding Nm: it really depends on the physics being simulated. For instance, PWFA with an axisymmetric driver and witness beam can be simulated with Nm = 1. But for LWFA, one usually needs Nm = 2 or Nm = 3 (when simulating self-injection). In some special cases, one may need even higher Nm.

koesterf commented 1 year ago

OK. Thanks. sometimes I also see differences in injection process with Nm=2 and Nm=3 (for rest of the things same). But may be I will discuss about it later. Thank you very much for the discussion.