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 classical radiation reactions for beams #974

Merged

Conversation

SeverinDiederichs
Copy link
Member

@SeverinDiederichs SeverinDiederichs commented Jun 8, 2023

This PR adds the energy loss due to classical radiation reactions of particle beams to the code.
The implementation is based on the following paper: M. Tamburini et al., NJP 12, 123005. In the paper, the implementation is discussed for a Boris pusher. HiPACE++ uses a velocity Verlet pusher for the beam particles.
This document translates the approach from the paper to a velocity Verlet pusher.

To benchmark the implementation, it was tested against the theory from the following paper: P. Michel et al., PRE 74, 026501, where the energy loss due to betatron radiation in a blowout is discussed. Using the same test case as in CI (just with more output to give a meaningful plot and more beam particles) gave the following result (similar to Fig. 1 in the paper):

RR_norm_units

  • 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 the component: beam About the beam species label Jun 8, 2023
@SeverinDiederichs SeverinDiederichs changed the title [WIP] add radiation reactions add classical radiation reactions for beams Jun 11, 2023

// Radiation reaction constant
const amrex::ParticleReal q_over_mc = charge_mass_ratio*inv_clight;
const amrex::ParticleReal RRcoeff = (2.0_rt/3.0_rt)*PhysConstSI::r_e*q_over_mc*q_over_mc;
Copy link
Member

Choose a reason for hiding this comment

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

Can you calculate RRcoeff outside of the kernel and also make it work in normalized units using plasmas.background_density_SI ?

Copy link
Member Author

@SeverinDiederichs SeverinDiederichs Jun 11, 2023

Choose a reason for hiding this comment

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

I am going to add normalized units in a separate PR, since this will require shifting the plasmas.background_density_SI to hipace.background_density_SI and I found this to be cleaner in a separate PR.

Edit: Added it already now

@AlexanderSinn
Copy link
Member

Can you include HiPACE++ with radiation reactions turned off in the plot in the PR description?

@SeverinDiederichs
Copy link
Member Author

Can you include HiPACE++ with radiation reactions turned off in the plot in the PR description?

I added it, since it is a matched beam, nothing happens without RR

@SeverinDiederichs
Copy link
Member Author

In the end, normalized units are not that much extra effort, so I included them in this PR. They work well:

RR_norm_units

@SeverinDiederichs SeverinDiederichs added the non-backward-compatible Changes the behavior of the code, old input file may give different results label Jun 13, 2023
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! See minor comments below.

examples/beam_in_vacuum/analysis_RR.py Outdated Show resolved Hide resolved
examples/beam_in_vacuum/inputs_RR Outdated Show resolved Hide resolved
src/Hipace.H Outdated Show resolved Hide resolved
src/particles/pusher/BeamParticleAdvance.cpp Outdated Show resolved Hide resolved
src/particles/pusher/BeamParticleAdvance.cpp Show resolved Hide resolved
src/particles/pusher/BeamParticleAdvance.cpp Outdated Show resolved Hide resolved
src/utils/Constants.H Show resolved Hide resolved
tests/adaptive_time_step.1Rank.sh Show resolved Hide resolved
tests/checksum/reset_all_benchmarks.sh Outdated Show resolved Hide resolved
@SeverinDiederichs SeverinDiederichs merged commit d6eafba into Hi-PACE:development Jun 14, 2023
@SeverinDiederichs SeverinDiederichs deleted the radiation_reactions branch June 14, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: beam About the beam species non-backward-compatible Changes the behavior of the code, old input file may give different results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants