Skip to content

Fix particle boundary conditions in curvilinear geometries - #7235

Open
JustinRayAngus wants to merge 10 commits into
BLAST-WarpX:developmentfrom
JustinRayAngus:curvilinear_helpers
Open

Fix particle boundary conditions in curvilinear geometries#7235
JustinRayAngus wants to merge 10 commits into
BLAST-WarpX:developmentfrom
JustinRayAngus:curvilinear_helpers

Conversation

@JustinRayAngus

@JustinRayAngus JustinRayAngus commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This PR adds helper routines for transforming a particle’s momentum between Cartesian coordinates and the local curvilinear basis. Before calling ApplyParticleBoundaries::apply_boundaries(), particle momentum is transformed into the curvilinear basis and then transformed back to Cartesian coordinates afterward. This simplifies the logic in apply_boundaries() and fixes several bugs and oversights in particle boundary handling for RZ, RCYLINDER, and RSPHERE geometries.

Issues fixed in this PR for curvilinear geometries:

  • incorrect transform applied for reflecting particles in RSPHERE geometry (see PR Fix RSPHERE particle-boundary momentum basis #7195)
  • forward and backward transformation was applied to ALL particles when using RSPHERE geometry
  • incorrect normal and tangential velocity components passed to thermalize_boundary_particles() at radial (x) boundaries

@JustinRayAngus JustinRayAngus added bug Something isn't working geometry: RZ axisymmetric 2D and quasi-3D geometry: cylinder/sphere labels Sep 2, 2026
@JustinRayAngus JustinRayAngus added the component: boundary PML, embedded boundaries, et al. label Sep 2, 2026
Comment thread Source/Particles/WarpXParticleContainer.cpp
Comment thread Source/Particles/WarpXParticleContainer.cpp Outdated

@dpgrote dpgrote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

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

Labels

bug Something isn't working component: boundary PML, embedded boundaries, et al. geometry: cylinder/sphere geometry: RZ axisymmetric 2D and quasi-3D

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants