-
Notifications
You must be signed in to change notification settings - Fork 121
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
Possible typo in Projector/ProjectorAM2Order.cpp #642
Comments
Hi developers, I've been continuing my study of On line 251, we find:
In this bug report, we will take the correct form of Where
Thus, when we combine all terms, we end up with the expression: where cell volume If I am correct, this typo can be easily fixed by changing
This should not affect the subsequent code, as this Cheers, |
Hello, |
Hi Stuart You are correct on both points. Nevertheless, these corrections should be introduced. I'm just going to run a couple more tests and you should see them appear soon in the development branch. I'd like to thank you very much for the very careful reading of the code and for reporting your findings to us in a crystal clear post. Congratulations to you and I really look forward to reading your next suggestions to improve the code quality :-) Cheers P.S: I'll close the issue when the corrections are available. |
Hi @beck-llr Thanks for the reply, it's good to know that my understanding of the code is correct! I have now finished my review through the code, and I think I understand all the equations which are relevant to the core cylindrical-PIC algorithm. During this review I found a few more points which could also be potential bugs and typos, and I'm happy to share my findings with you. Initially I tried typing this out here, but I hit some kind of limit on the GitHub markdown service. The response became so long that equations stopped formatting correctly! As a workaround, I'll provide a link to the report on Overleaf, as I can't seem to attach the PDF here. Smilei bug report: https://www.overleaf.com/read/hptynqbzzrpj Thanks for all the help, |
Hi @Status-Mirror The mode 0 of a given current density Note that the Cheers |
Let's move to point 3, boundary condition of First of all, note that the Then, it is important to understand that the so called "below axis" (see https://smileipic.github.io/Smilei/Understand/azimuthal_modes_decomposition.html) boundary conditions are not determined by physics but are simple practical recipe so that conditions on axis actually work. Let's take your example of Let's assume that this macro particle is sitting on axis (or very close to it) at position You agreed that I hope this is clear enough. Again let me know if you see any objections to that argument. |
On point 2, I agree - I've discovered a contradiction in my argument. The macro-particles have no "shape" in the I see your approach to point 3 is provided in your documentation, but I would argue there is an inconsistency between the treatment of the fields and the current densities (see my bug 6 discussion). Your conditions are correct for the goal: "If you want Following current density logic, I think the interpolator should give: where, from the geometry of the physical space, Using this interpolation method would make everything consistent, but maybe there's a reason you've chosen not to use it? I see that for a particle with exactly Ultimately I think point 3 is an implementation choice, and I don't think the differences in our approach would radically change the output of the simulation. Cheers, |
For the point 4.1 you are correct, the minus sign must be replaced by a plus. Congrats for spotting this one out ! |
@beck-llr anything left to do in this issue? |
Yes I'm not done yet. Unfortunately this takes time and I haven't had time to prepare a proper answer to the interesting points raised here. |
@Status-Mirror About point 4.2: missing currents in the Buneman boundary conditions. First please note that the boundary conditions on particles are applied before current deposition. Therefore a particle crossing r=rmax would be removed or reflected before it has a chance to deposit currents as far as you suggest. Moreover the Buneman boundary conditions are not derived with the objective to solve locally Maxwell's equations but to analytically try to force minimum reflections of outgoing waves back into the domain. In order to do so you have to assume some conditions on the state of the plasma "outside" the simulation domain and that assumption is that there is no current. Of course if there is a strong current at the boundary this assumption becomes false and this is a limitation of this method. |
@Status-Mirror About point 4.3: you are correct the P.S: In the case of the spectral solver the fields do not have exactly the same size and require that this -1 is used. So instead of having a different implementations of the Buneman conditions for Rmax, we decided to keep the spectral version, including this -1, since for the FDTD solver we favor using the PML boundary conditions instead. Agreed this is a lazy implementation. Maybe we'll try to improve this sometime. |
@Status-Mirror About 5.1 you are absolutely correct. I've run some basic tests and this correction has some impact on the Bl component of the reflected laser on the xmax boundary. Again, congratulation for spotting it and thanks a lot for reporting it. 5.2 is obviously an ugly typo :-) |
@beck-llr is there anything left to do in this issue or we can close it? |
Somme additional comments have been addressed but I haven't had time to answer here yet. Let's keep it open. |
Hi all,
I've been going through the source-code trying to understand the cylindrical-PIC algorithm, and there's a line in
Projector/ProjectorAM2Order.cpp
which looks wrong to me. On lines 140 and 834, we find:From the comment, I would guess this is trying to average the radial particle position before the particle push, and the radial position after. My understanding of these terms are as follows:
(jpo + j_domain_begin_)*dr
: Radial position of closest cell-edge to the particle position before the most recent push.deltaold[1*nparts]
: Radial distance from this cell-edge to the old particle position, divided by dr.rp
: Radial position of the particle after the push.I think this line is attempting to work out$\bar{r}=(r_{old} + r_{new})/2$ , but I don't believe this is doing it. Should the line instead read:
I'm still working through the source-code and my understanding is incomplete. There could be a good reason why the line is as it is, but I think it's likely there's a typo/bug here.
Cheers,
Stuart
The text was updated successfully, but these errors were encountered: