-
Notifications
You must be signed in to change notification settings - Fork 200
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 consistent BCs for J at PEC boundaries #5650
base: development
Are you sure you want to change the base?
Use consistent BCs for J at PEC boundaries #5650
Conversation
671a7d0
to
917d0d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just a few minor comments.
fcd1904
to
5adb177
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only CI test affected by this PR that had significant changes to the checksum values.
@RemiLehe , please take a look and see if it is ok.
…BC for E as required by energy conservation.
ce435f2
to
a24c7f2
Compare
@JustinRayAngus would you mind also updating this section in the documentation based on these new changes? |
This PR makes the BC handling for J at PEC boundaries consistent with that needed for energy conservation.
Currently, the boundary conditions for J at PEC (i.e. conductor) and PMC (i.e symmetry) is set to be consistent with that needed for charge conservation when using reflecting and thermal particle boundary conditions. This is the correct thing to do for a symmetry boundary, but it can results in artificial numerical heating at PEC boundaries when using shape factors larger than one.
Energy conservation demands that the boundary handling for J be consistent with the E field boundary conditions used to gather E for the pushing the particles. If an even BC is used for E_i, then J_i deposited to the ghost cells should be added to the mirror location inside the domain. Likewise, if the BC used for E_i is odd, then J_i deposited to the ghost cells should be subtracted from its mirror location inside the domain. Note that this is independent of the boundary condition applied to the particles.
The figures below show electron temperature profiles at t=0 and t = 5 ns from 1D simulations of a uniform electron-deuterium plasma in a box. The electrons and ions are initialized with uniform density ne = ni = 1e17/cc and Te = Ti = 1 eV. The time advance uses the energy-conserving implicit solver. Coulomb collisions between all species pairs are included. All simulations use reflecting BCs for particles at both boundaries and shape factor = 2. The left most figure shows results using PMC (i.e. symmetry) boundary conditions for the fields, which as described above is consistent with the current way that J is handled at the boundaries in the development branch. The electron temperature remains the same at later times for this choice of field boundary conditions. The center figure shows results using PEC field boundaries with the development branch, which shows artificial numerical heating at the boundaries. The figure on the right shows results using PEC field boundaries with reflecting particles using this PR, which shows no signs of artificial numerical heating.
Further details of how to treat boundary conditions for J (and for rho), and subtleties with using the reflecting boundary condition on non-symmetry planes for charged particles is given here WarpX_PEC_PR.pdf
Note that the changes in this PR restore energy conservation, but charge conservation at the boundaries is not maintained. This can be restored with a proper treatment of particles going in and out of the PEC boundaries. This will be done in a future PR.