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

Use parser for beam density #912

Merged
merged 5 commits into from
Apr 6, 2023
Merged

Conversation

MaxThevenet
Copy link
Member

This PR adds the option to parse the beam density, for the fixed-ppc option. To be used with caution as the fixed-ppc option may result in impractically large number of beam particles, e.g. several particles per cell in the whole simulation box. To avoid this, please make sure you limit the creation of beam particles to relevant regions, e.g.

my_constants.w = 10.e-6
my_constants.nb = 5.e23

beam.injection_type = fixed_ppc
beam.profile = parsed
beam.density(x,y,z) = nb * exp(-(x**2+z**2+y**2)/w**2)
beam.min_density = nb/100 # do not allocate beam particles where the density is <1% of the peak density
beam.radius = 200.e-6 # limit the region where beam particles are allocated, both transversely...
beam.zmin = -200.e-6 # ... and longitudinally
beam.zmax =  200.e-6

@MaxThevenet MaxThevenet added the component: beam About the beam species label Apr 6, 2023
Copy link
Member

@AlexanderSinn AlexanderSinn left a comment

Choose a reason for hiding this comment

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

At the very least the location of m_parser NEEDS to be changed so it doesn’t get transferred to the GPU.

src/particles/profiles/GetInitialDensity.H Outdated Show resolved Hide resolved
docs/source/run/parameters.rst Outdated Show resolved Hide resolved
src/particles/profiles/GetInitialDensity.cpp Show resolved Hide resolved
@MaxThevenet
Copy link
Member Author

Thanks! I addressed your comments in the last commit.

@MaxThevenet MaxThevenet merged commit 7ceaad0 into Hi-PACE:development Apr 6, 2023
@MaxThevenet MaxThevenet deleted the parsebeam branch April 6, 2023 15:40
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants