Add missing term in RZ vector Laplacian for magnetostatic solver#6516
Open
RemiLehe wants to merge 4 commits intoBLAST-WarpX:developmentfrom
Open
Add missing term in RZ vector Laplacian for magnetostatic solver#6516RemiLehe wants to merge 4 commits intoBLAST-WarpX:developmentfrom
RemiLehe wants to merge 4 commits intoBLAST-WarpX:developmentfrom
Conversation
clarkse-he
suggested changes
Feb 27, 2026
| // In cylindrical coordinates (with azimuthal symmetry), the vector Laplacian operator | ||
| // along each coordinate is `del dot (sigma grad ...) - 1/r^2 ...`. | ||
| // The alpha term below adds the 1/r^2 part. | ||
| linop[adim]->setAlpha(1._rt); |
Contributor
There was a problem hiding this comment.
This should only be applied to adim of 0 and 1, this term is not in the Az equation.
The `-1/r^2` correction in the cylindrical vector Laplacian does not apply to the Az component. Guard `setAlpha(1._rt)` with `adim < 2` to avoid incorrectly applying it to Az. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…placian fix The 1/r^2 correction (setAlpha) is no longer applied to Az, changing Bt and other field values slightly. Update benchmark to reflect the corrected physics. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In RZ coordinates (assuming cylindrical symmetry), the components of the vector Laplacian are:
$[\nabla^2 \boldsymbol{A}]_r = \frac{1}{r}\partial_r r\partial_r A_r + \partial_z^2 A_r - \frac{1}{r^2} A_r$
The
This is based on discussions with @prkkumar and @clarkse (who implemented a cell-centered version of this solver here) as well as with @WeiqunZhang who pointed out the corresponding nodal version.