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

fix transverse beam currents for explicit solver #468

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

SeverinDiederichs
Copy link
Member

@SeverinDiederichs SeverinDiederichs commented Apr 27, 2021

This PR fixes the explicit solver in handling transverse beam currents.

Previously, the beam currents on the next slice were not added to general currents on the next slice. Additionally, the next slice was not reset, leading to a build up of transverse currents on the next slice, which caused the longitudinal derivative to be wrong.

With this PR, the predictor-corrector loop (PC) and the explicit solver show the same behavior in the strong hosing regime:

image

This shows the evolution of the tail of a hosing beam.

The input script was

amr.n_cell = 256 256 256
hipace.normalized_units=1
hipace.predcorr_max_iterations = 30
hipace.predcorr_B_mixing_factor = 0.05
hipace.predcorr_B_error_tolerance = 4e-2

amr.blocking_factor = 2
amr.max_level = 0

max_step = 10
hipace.output_period = 1
hipace.dt = 6

hipace.numprocs_x = 1
hipace.numprocs_y = 1

hipace.depos_order_xy = 2

geometry.coord_sys   = 0                  # 0: Cartesian
geometry.is_periodic = 1     1     0      # Is periodic?
geometry.prob_lo     = -8.   -8.   -6    # physical domain
geometry.prob_hi     =  8.    8.    6

beams.names = beam
beam.injection_type = fixed_weight
beam.num_particles = 1000000
beam.profile = gaussian
beam.zmin = -5.9
beam.zmax = 5.9
beam.radius = 1.2
beam.density = 200.
beam.u_mean = 0. 0. 2000
beam.u_std = 0. 0. 0.
beam.position_mean = 0. 0. 0
beam.position_std = 0.1 0.1 1.41
beam.ppc = 1 1 1
beam.dx_per_dzeta = 0.2

plasmas.names = plasma
plasma.density = 1.
plasma.ppc = 1 1
plasma.u_mean = 0.0 0.0 0.
plasma.element = electron
hipace.verbose=1
diagnostic.diag_type = xz
  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@SeverinDiederichs SeverinDiederichs added bug Something isn't working component: fields About 3D fields and slices, field solvers etc. labels Apr 27, 2021
Copy link
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Great, thanks for this PR!

@MaxThevenet MaxThevenet merged commit 1330cdc into development Apr 27, 2021
@SeverinDiederichs SeverinDiederichs deleted the explicit_transverse_currents branch May 7, 2021 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: fields About 3D fields and slices, field solvers etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants