Skip to content

In AddPlasma, fix for radial_numpercell_power#6804

Merged
RemiLehe merged 1 commit intoBLAST-WarpX:developmentfrom
dpgrote:fix_radial_numpercell_power
Apr 28, 2026
Merged

In AddPlasma, fix for radial_numpercell_power#6804
RemiLehe merged 1 commit intoBLAST-WarpX:developmentfrom
dpgrote:fix_radial_numpercell_power

Conversation

@dpgrote
Copy link
Copy Markdown
Member

@dpgrote dpgrote commented Apr 24, 2026

In AddPlasma and AddPlasmaFlux, when in a radial geometry, the radial variation of the particle weight can be adjusted by the input parameter radial_numpercell_power. The particle distribution and weights are adjusted accordingly. Though, when the minimum radius, rmin, is greater than zero, the weights of the particles was not correct. The weights did not account for the fact that the particles before the transformation are generated only in the range rmin to rmax whereas the existing formula assumed that particles were created in the range 0 to rmax (before transformation). The result is that fewer particles are generated than the weight is accounting for. Multiplying the weights by the factor rmax/(rmax - rmin) accounts for this difference.

This addresses the issue raised in #6798.

@dpgrote dpgrote added geometry: RZ axisymmetric 2D and quasi-3D component: initialization Changes related to the initialization of the simulation labels Apr 24, 2026
Copy link
Copy Markdown
Contributor

@JustinRayAngus JustinRayAngus left a comment

Choose a reason for hiding this comment

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

LGTM

@ax3l ax3l requested a review from RemiLehe April 28, 2026 16:32
@ax3l ax3l added bug Something isn't working bug: affects latest release Bug also exists in latest release version labels Apr 28, 2026
@RemiLehe RemiLehe merged commit ad31f6a into BLAST-WarpX:development Apr 28, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: affects latest release Bug also exists in latest release version bug Something isn't working component: initialization Changes related to the initialization of the simulation geometry: RZ axisymmetric 2D and quasi-3D

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: profile = constant gives wrong density in RCYLINDER / RZ when xmin > 0

4 participants