-
Notifications
You must be signed in to change notification settings - Fork 31
Gauss 3D Space Charge Pusher #1127
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
Conversation
Add the new Gauss 3D space charge pusher.
- replace with new file name in doc - move into own section in CMake
| amrex::ParticleReal & AMREX_RESTRICT pz = part_pz[i]; | ||
|
|
||
| //field integrals from a 3D Gaussian bunch | ||
| int const nint = 401; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the integration, do you want to make the integration steps nint user configurable or is 401 a generally good number for everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and its a bit slow. We probably want to relax the default value a bit and expose it to the user.
| * ``"Gauss3D"`: Calculate 3D space charge forces as if the beam was a Gaussian distribution. | ||
| This model is supported only in particle tracking mode (when ``algo.track = "particles"``). | ||
| Ref.: J. Qiang et al., "Two-and-a-half dimensional symplectic space-charge solver", LBNL Report Number: LBNL-2001674 (2025). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you already have a link / DOI for the paper? I cannot find it on google scholar yet.
- avoid temporary arrays - integrate in one go
Only used for particles. Ref orbit asserts well, too.
cemitch99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks.
|
This looks ready to me. I will do a follow-up adding another example or two. |
| pintex = sum0ex / 3_prt; | ||
| pintey = sum0ey / 3_prt; | ||
| pintez = sum0ez / 3_prt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs an end-point correction. Fixed in #1168
| amrex::ParticleReal const push_consts = dt * charge * inv_gamma2 / pz_ref_SI | ||
| * 2_prt * asp * (sigx * sigx * sigz * std::sqrt(2_prt * pi)) | ||
| * bchchg * rfpiepslon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need a separate constant per x,y,z, which I accidentally removed when refactoring.
Fixed in #1168
add SC kicks from a 3D Gaussian density distribution.
Checklist
Follow-Up PRs
nintparameter and pick a good (fast and precise enough) default (e.g., 50? 100?)