Skip to content

Fix RSPHERE particle-boundary momentum basis - #7195

Open
tomzhu0225 wants to merge 2 commits into
BLAST-WarpX:developmentfrom
tomzhu0225:fix/rsphere-particle-boundary-angle
Open

Fix RSPHERE particle-boundary momentum basis#7195
tomzhu0225 wants to merge 2 commits into
BLAST-WarpX:developmentfrom
tomzhu0225:fix/rsphere-particle-boundary-angle

Conversation

@tomzhu0225

Copy link
Copy Markdown
Contributor

Summary

RSPHERE stores phi as elevation from the Cartesian x-y plane. The particle-boundary kernel instead used the spherical basis for a polar angle measured from +z. Consequently, reflecting a particle at a radial boundary changed the wrong Cartesian momentum components away from special angles.

This change:

  • uses the documented elevation-angle basis for Cartesian/local momentum conversion;
  • samples thermal re-emission in the local (u_r, u_theta, u_phi) frame, so the half-Maxwellian normal component is always directed into the domain;
  • adds native RSPHERE reflecting and thermal regressions with 32 angularly distributed particles.

Reproducer and validation

On the unmodified development branch:

  • reflecting boundary: 96/96 Cartesian momentum-component checks fail;
  • thermal boundary: 8/32 returned particles point outward.

With this commit:

  • reflecting run and component-wise analysis pass;
  • thermal run and inward-normal analysis pass;
  • Release RSPHERE build, Ruff, Python compilation, repository input-name audit, and git diff --check pass.

This is independent of #7194, which corrects Cartesian-to-RSPHERE particle position initialization. These tests use native NUniformPerCell RSPHERE initialization and directly exercise the boundary kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant