Skip to content
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

Add Higuera-Cary pusher #3280

Merged
merged 7 commits into from
Jul 10, 2020

Conversation

steindev
Copy link
Member

@steindev steindev commented Jul 6, 2020

Add Higuera-Cary pusher as presented in doi:10.1063/1.4979989.
The HC method is 2nd order, structure preserving, and relativistically correct.
Compared to Vay's method, the HC method has the additional property of being structure preserving while it correctly calculates the velocity in ExB direction when E·B=0 in contrast to Boris' method.
A correction to the formulas given in the original article is applied as documented by the WarpX team: (ECP-WarpX/WarpX#320).

Further references:

Tests performed so far

  • Single particle acceleration in constant electric field

    • HC produces the exact same result as Boris
  • Single particle turning circles in a constant magnetic field

    • particle sticks closer to (expected) circular trajectory than Boris' or Vay's method
  • Single particle movement with constant velocity in a force-free field composed of constant magnetic and electric fields

    • HC performs better than Boris, but the deviation from the expected straight line motion is still large.
      Only Vay produces the expected result, but it was Vay's design goal to reproduce the correct behavior truthfully.
      HC's issue arises mainly due to insufficient precision of the input values (i.e. fields), as it relies on the cancellation of two very large equal but opposite numbers when calculating the new momentum, in this test case.
    • UPDATE: I experimented a bit with precisionCasts and finally figured how to reduce errors due to upcasting while calculating with the necessary high precision, too.
      The HC pusher now performs as good as the Vay pusher and reproduces the trajectory.
      (Therefore, I would like to spare discussions on that)
  • Kelvin-Helmholtz instability

    • Virtually no difference in electron distribution between Boris and HC at step 800. See the plot below showing where the distributions differ.
      KHI_diff_800_gimp
      Note, this picture amplifies the real difference. White pixels just mark that there is a change in that pixel, but not how large it is. Drawing the absolute difference in electron distributions results in a black void only.
    • Charge conservation: for HC is about the same as for Boris, i.e. max|d|/ρ_0=3.8e-5 and 4.0e-5, respectively, at the end of the simulation
    • Numerical heating: curves of particle energy over time relative to initial energy are identical for Boris and HC

To Do

  • figure out if HC pusher gives expected results in force-free test
  • perform many particle test (e.g. KHI)
  • add option of the new HC pusher in list of available pushers in species.param in all examples

Big THANKS to @aroeszler who implemented most of the method.

This will close #2589.

@psychocoderHPC psychocoderHPC added the component: core in PIConGPU (core application) label Jul 6, 2020
@steindev steindev marked this pull request as ready for review July 8, 2020 16:07
Copy link
Member

@PrometheusPi PrometheusPi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • A minor typo in @aroeszler name.
  • some question regrading naming
  • could you please add a comment in the pusher implementation to highlight where the floating point precision becomes an issue so that your solution is documented

include/picongpu/param/pusher.param Outdated Show resolved Hide resolved
include/picongpu/param/species.param Outdated Show resolved Hide resolved
include/picongpu/particles/pusher/particlePusherHC.hpp Outdated Show resolved Hide resolved
include/picongpu/particles/pusher/particlePusherHC.hpp Outdated Show resolved Hide resolved
include/picongpu/particles/pusher/particlePusherHC.hpp Outdated Show resolved Hide resolved
include/picongpu/particles/pusher/particlePusherHC.hpp Outdated Show resolved Hide resolved
include/picongpu/particles/pusher/particlePusherHC.hpp Outdated Show resolved Hide resolved
include/picongpu/param/pusher.param Show resolved Hide resolved
Copy link
Member

@sbastrakov sbastrakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @aroeszler and @steindev ! Just some small suggestions above on code style.

@sbastrakov sbastrakov added the component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog! label Jul 9, 2020
@sbastrakov
Copy link
Member

I asked @psychocoderHPC and he trusts our reviews of this PR. So I assume you did not plan to add anything more to this PR @steindev and we can press the merge button now?

@steindev
Copy link
Member Author

@steindev and we can press the merge button now?

Squash and merge probably, but YES you can do so. From my point of view everything is fine. Once we change the default pusher in a separate PR I will add a magnetic bottle test as suggested by @BeyondEspresso.

@sbastrakov sbastrakov merged commit f514a32 into ComputationalRadiationPhysics:dev Jul 10, 2020
@steindev steindev deleted the topic-hcpusher branch July 10, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core in PIConGPU (core application) component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants