Closed henry2004y closed 10 months ago
Attention: 4 lines
in your changes are missing coverage. Please review.
Comparison is base (
fd5d83e
) 47.10% compared to head (7731b61
) 52.79%.
Files | Patch % | Lines |
---|---|---|
src/pusher.jl | 94.52% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This is an exciting idea. Do you have a ToDo list? Maybe I can do something.
This is an exciting idea. Do you have a ToDo list? Maybe I can do something.
Yes! I've added a ToDo list above. After I clean up the code a bit more, feel free to directly push to this branch!
Adding the Boris method was not in my original plan for this package. I want to try this now because of some performance issue I encountered recently with a large number of test particles (> 1e7). Tsit5()
is fast, at a cost of violation of phase space conservation; Vern9()
together with a time step limitation based on local gyroperiod has much nicer conservation behavior, but it consumes a lot of memory with extremely high GC time (>70% in Julia 1.9.3 and 1.10.0-rc1). I frequently encounterd OOM errors running the trials on a cluster.
By adding a native particle pusher, the high GC time may be largely avoided.
I'm going to merge this to master in order to test the performance for a specific problem. We can further polish this part afterwards.
Have you read this paper?
PS. Perhaps you have also come across this author.
I've heard of this paper recently from a senior member of my group. By briefly scanning through the derivations, I got the impression that $|R|=1$ is based on the assumption that $\Delta t = \textrm{const}$. I will confirm this with some numerical experiments.
It's time to add some native particle pushers in the package!
Background
The Boris method is the de facto particle pusher in plasma physics, because of its excellent conservation behavior and relative simplicity. The Boris method is a second order method with discrete phase error related to the choice of fixed time step. If the time step is not fixed, this method can still be used, but the conservation of phase space trajectory will be violated.
Why do we need this?
The Boris method is specifically designed for the expression of Lorentz force. A general ODE solver in OrdinaryDiffEq.jl does not take into account the special form of the Lorentz equation, which is also the reason why the Boris method does not exist in OrdinaryDiffEq.jl. With my recent tests on multiple algorithms from OrdinaryDiffEq.jl, the default
Tsit5()
has poor conservation properties in many cases, and there are only a few options that display nice energy conservation behaviors #73. The Boris method also requires a fixed timestep for conservation, which makes it a bit harder for investigating a new problem, but we should have a version of our own in this package.Plan