The Adaptive Sourcing Fails to Conserve Particle Exactly - Antoinehoff/personal_gkyl_scripts GitHub Wiki
All 3x2v adaptive source simulations that were meant to compensate all losses of particle showed an increase of the number of particle instead of keeping it constant. In general, the amplitude of this error is small if we compare it to the source injection rate. For example, the NT coarse case (input file ) shows a $\sim 0.1\times 10^{19}$ variation of the number of particle in $\sim 1$ ms (see figure below).
This increases represents a $10^{21}$ particle/s source which represents $<10$% of the source rate.
We observe a gap between the total particle injection rate of the source and the total particle loss through the boundary that only explains partly the increase of particle number observed as the gap is more of the order of $5$% of the total source rate.
Stage‐adapted vs. step‐adapted sourcing
We compare adapting the source at each step (end of RK stage) or at each RK stage.
We do not see an effect of adapting the source at each stages vs. each steps.
The figures below shows the source rates, boundary losses, total number of density and its time derivative with:
- step-adapted for $t<600$ $\mu s$,
- stage-adapted sources for $t\geq600$ $\mu s$.
We can compare the timings between stage-adapted and step-adapted simulations. timings_adapt_stage.txt timings_adapt_step.txt
Metric | Stage Adaptation | Step Adaptation | Difference |
---|---|---|---|
Total Time Loop | 82.24 sec | 69.31 sec | -15.7% |
Forward Euler Time | 50.61 sec (61.55%) | 51.00 sec (73.59%) | +0.8% time, +12% relative |
Sources (charged) | 17.41 sec (34.39%) | 4.13 sec (8.10%) | -76.3% |
Field Solves | 6.68 sec (8.13%) | 6.77 sec (9.77%) | +1.3% time, +1.6% relative |
Boundary Conditions | 6.51 sec (7.91%) | 6.37 sec (9.19%) | -2.1% time, +1.3% relative |
Forward Euler Calls | 882 | 890 | +8 calls |
RK Stage-2 Failures | 138 | 141 | +3 failures |
RK Stage-3 Failures | 6 | 8 | +2 failures |
Time Stepper Arithmetic | 1.78 sec (2.16%) | 1.78 sec (2.57%) | 0% time, +0.4% relative |