Skip to content

Add missing term in RZ vector Laplacian for magnetostatic solver#6516

Open
RemiLehe wants to merge 4 commits intoBLAST-WarpX:developmentfrom
RemiLehe:cylindrical_magnetostatic
Open

Add missing term in RZ vector Laplacian for magnetostatic solver#6516
RemiLehe wants to merge 4 commits intoBLAST-WarpX:developmentfrom
RemiLehe:cylindrical_magnetostatic

Conversation

@RemiLehe
Copy link
Copy Markdown
Member

@RemiLehe RemiLehe commented Jan 23, 2026

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$

$[\nabla^2 \boldsymbol{A}]_t = \frac{1}{r}\partial_r r\partial_r A_t + \partial_z^2 A_t - \frac{1}{r^2} A_t$

$[\nabla^2 \boldsymbol{A}]_z = \frac{1}{r}\partial_r r\partial_r A_z + \partial_z^2 A_z$
The $1/r^2$ term was missing in the main branch of WarpX.

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.

@RemiLehe RemiLehe changed the title Add missing term in RZ vector Laplacian for magnetostatic solver [WIP] Add missing term in RZ vector Laplacian for magnetostatic solver Jan 23, 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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should only be applied to adim of 0 and 1, this term is not in the Az equation.

RemiLehe and others added 3 commits May 8, 2026 12:07
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]>
@RemiLehe RemiLehe changed the title [WIP] Add missing term in RZ vector Laplacian for magnetostatic solver Add missing term in RZ vector Laplacian for magnetostatic solver May 9, 2026
@RemiLehe RemiLehe requested review from clarkse-he, prkkumar and prkkumar-he and removed request for prkkumar May 9, 2026 12:49
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.

2 participants