The ion momenta in hdf5 files and the ion energies (pre-ionized p, ionizer on C & N) in the energy histograms are apparently wrong for at least 2D3V simulations in 0.2.3 + applied #1844 patch.
The dynamics of ions, when I look at positions over time, and the momentum/energy does not fit. For example, the test with a thin flat foil (internal repo) shows that the protons move approximately only half the distance they should according to their momentum. Carbons and Nitrogen ions also move slower, but approx. a factor 2/3.
So apparently the momentum/energy unit might be wrong.
I compared to picls (another "PIC" code) and find that the dynamics according to positions agree reasonably, so it is reasonable to assume that positions are correct and momenta are wrong and not vice versa.
To reproduce I use a single particle test and instead of 0.2.3 (+patch) the dev branch because it is easier to set up there.
A positron, a proton and a partly charged Carbon (4+) walk into a bar. They meet at the flat (2D) bar table which happens to have a checkerboard padding with 8.6e-6m x 8.6e-6m sized squares. All squares have a tiny arrow inside, constantly pointing in an axis we denote as y. Let us call the length of those arrows 100 MV/m. The particles decide to start following those arrows because they see Lorentz at the end of the table inviting them on a drink. Since the bar table is slippery with spoiled undefined goo, they do not spill charge (deposit current) as they move on it. We don't care if they reach Lorentz and stop them after making 1000 tiny (1.65e-14 s) steps to see how far they got and how much energy they gained.
p correct
p correct
p correct
@HighIander Unfortunately, I can not reproduce the issue in dev. Can you provide me a link on Hypnos to a simulation in question and a minimal python snippet that demonstrates the issue?
Just for reference: my setup and my verification script (make yours shorter pls).
My stupidity. I assumed, coming from another code where it hardwired, that a time-step in is a grid cell dimension/c. Of course, in the present case this was not the case (a factor of sqrt(2) smaller time step), so I wrongly calculated the velocity and hence energy from the motion of ions between two outputs (energy proportional to v^2, hence the factor of 2). I apologize for any inconveniences that may have occured...
No problem. Thank you for the report anyway, just add a small documented code snippet next time so we can proceed faster.
(The issue was caused by assuming a different CFL or cell to time step ratio as in directional splitting.)
Most helpful comment
My stupidity. I assumed, coming from another code where it hardwired, that a time-step in is a grid cell dimension/c. Of course, in the present case this was not the case (a factor of sqrt(2) smaller time step), so I wrongly calculated the velocity and hence energy from the motion of ions between two outputs (energy proportional to v^2, hence the factor of 2). I apologize for any inconveniences that may have occured...