ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
309 stars 195 forks source link

support density reflection from non-periodic boundaries from deposition for RZ #3833

Open RevathiJambunathan opened 1 year ago

RevathiJambunathan commented 1 year ago

PR #3711 includes density reflection from non-periodics boundaries for cartesian. @dpgrote mentioned to include this for RZ, which is not currently supported and would need a separate PR.

dpgrote commented 1 year ago

Note that the reflection of the charge and current are done already for axis, r = 0. It is done at the same time that the volume scaling is applied.

For the outer radius, the code added in PR #3711 does fill the guard cells, but the question is whether it is correct, does it correctly take into account the variation in the radius. Note that the similar code for the fields is not correct since it does not take the radius into account. Since it is only mirroring the fields, it fails to preserve the divergences of E and B. For example, as it is now, divE on the outer boundary is non-zero even though rho is zero there. I'm working on a PR to fix this.

A separate issue is that the setting of the fields in the guard cells below the axis had not been implemented. I'm also working on a PR to fix this as well.