[WIP] Darwin: solve -lap(curl(curl(Z))) instead of bilaplacian(Z) - #7196
Open
RemiLehe wants to merge 2 commits into
Open
[WIP] Darwin: solve -lap(curl(curl(Z))) instead of bilaplacian(Z)#7196RemiLehe wants to merge 2 commits into
RemiLehe wants to merge 2 commits into
Conversation
The semi-implicit Darwin solver writes the vector-potential increment as
dA = curl(Z) and solves the resulting fourth-order equation for Z. That
equation was discretized with a bi-Laplacian, i.e.
bilaplacian(Z) + curl(chi curl(Z)) = 2 laplacian(B) + 2 mu_0 curl(J)
but bilaplacian(Z) is only equal to the fourth-order term -laplacian(curl(curl(Z)))
where div(Z) = 0, which nothing in the scheme imposes on Z itself (only
div(dA) = div(curl(Z)) = 0 is guaranteed, by construction). Evaluate the
curl-curl form instead, which is what the derivation actually produces:
-laplacian(curl(curl(Z))) + curl(chi curl(Z)) = 2 laplacian(B) + 2 mu_0 curl(J)
The right-hand side is unchanged. The operator reuses the intermediate
curl(Z) it was already computing for the plasma-response term, so the
evaluation is one extra curl plus one vector Laplacian, and the scratch
space it needs narrows from two ghost cells to one (every stencil in the
chain is now nearest-neighbour, with guard cells refilled in between).
Since the bi-Laplacian is no longer used anywhere, remove
FiniteDifferenceSolver::ComputeVectorBiLaplacian along with its
Cartesian/Cylindrical/Spherical variants, and the fourth-derivative
stencils Dxxxx/Dyyyy/Dzzzz/Dxxyy/Dyyzz/Dxxzz that only it used.
Both operators agree exactly on discretely divergence-free fields (the
single-pass biharmonic stencil is the square of the 3-point Laplacian
stencil, and curl curl = grad div - lap holds discretely on the Yee mesh),
so results are unchanged where the iterates stay solenoidal: the 1D and 2D
Darwin tests reproduce the previous GMRES history iterate for iterate, up
to a 1-ULP difference in one particle-momentum sum.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
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.
The semi-implicit Darwin solver writes the vector-potential increment as dA = curl(Z) and solves the resulting fourth-order equation for Z. That equation was discretized with a bi-Laplacian, i.e.
but bilaplacian(Z) is only equal to the fourth-order term -laplacian(curl(curl(Z))) where div(Z) = 0, which nothing in the scheme imposes on Z itself (only div(dA) = div(curl(Z)) = 0 is guaranteed, by construction). Evaluate the curl-curl form instead, which is what the derivation actually produces:
The right-hand side is unchanged. The operator reuses the intermediate curl(Z) it was already computing for the plasma-response term, so the evaluation is one extra curl plus one vector Laplacian, and the scratch space it needs narrows from two ghost cells to one (every stencil in the chain is now nearest-neighbour, with guard cells refilled in between).
Since the bi-Laplacian is no longer used anywhere, remove FiniteDifferenceSolver::ComputeVectorBiLaplacian along with its Cartesian/Cylindrical/Spherical variants, and the fourth-derivative stencils Dxxxx/Dyyyy/Dzzzz/Dxxyy/Dyyzz/Dxxzz that only it used.
Both operators agree exactly on discretely divergence-free fields (the single-pass biharmonic stencil is the square of the 3-point Laplacian stencil, and curl curl = grad div - lap holds discretely on the Yee mesh), so results are unchanged where the iterates stay solenoidal: the 1D and 2D Darwin tests reproduce the previous GMRES history iterate for iterate, up to a 1-ULP difference in one particle-momentum sum.