Add theta-implicit hybrid-PIC solver - #7208
Open
prkkumar-he wants to merge 2 commits into
Open
Conversation
prkkumar-he
requested review from
JustinRayAngus,
RemiLehe,
n01r and
roelof-groenewald
August 26, 2026 23:45
…ify field locals in ComputeRHS
Contributor
|
@prkkumar-he @clarkse-he Thanks for this PR. I most likely will not be able to do a thorough review until next FY, but I wanted to let you know that it is on my radar. |
Contributor
Author
@JustinRayAngus Thanks for letting us know! |
Comment on lines
+102
to
+103
| mutable std::array<std::unique_ptr<amrex::MultiFab>, 3> m_D; | ||
| mutable std::array<std::unique_ptr<amrex::MultiFab>, 3> m_E_work; |
Contributor
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.
This PR is a cleaned-up split of a large development branch (#6613) that implements a
theta-implicit solver for the hybrid-PIC model, broken out so that it is easier to review.
It contains only the solver core. Three follow-up PRs will complete the feature set:
equation inside the nonlinear solve with its work terms discretely paired to the ion
and Faraday energy ledgers, giving total-energy conservation to machine roundoff at
theta = 1/2 (verified on the cold-beam finite-grid-instability benchmark).
the GMRES iterations (the linear stage becomes a banded grid operation), plus
suborbit-related performance and correctness improvements.
The method is described in
Kumar, White & Clark, A theta-implicit hybrid particle-in-cell algorithm for kinetic
simulations of magnetized plasmas.
What this PR adds
A new evolve scheme,
ThetaImplicitHybrid, following the shape of the recently mergedSemiImplicitDarwin(#6293): one scheme class + enum + PICMI scheme + docs + CI tests.The fields and particles are advanced as a single coupled nonlinear system: at each
nonlinear iteration the particles are re-advanced with the iterate electric field, the
ion current and charge density are re-deposited,
Bis updated through Faraday's law,and
Eis re-evaluated from the generalized Ohm's law. The whistler-wave CFL conditionof the explicit hybrid advance does not apply, and no field sub-cycling is used.
Notes for review:
Ohm's law,
E* = E - DwithD = eta*J_p - eta_H*grad^2(J_p). Pushing with theiterate makes the residual a differentiable function of the unknown through the
particle response (the electrostatic limit is degenerate with any recomputed push
field); subtracting
Dkeeps the electron-momentum friction off the ions(Stanier et al., JCP 2019).
Dis built as the difference of two Ohm solves from thesame state, so it matches the residual's stencils and floors by construction.
rhocarries two components for this scheme, so that the density entering Ohm'slaw is a pure function of the iterate (deposited fresh from the time-centered particle
positions each residual evaluation).
solve_for_implicitflag: Faraday-mode Ohm solves retain grad(Pe) in the Newtonresidual; the explicit path is bit-identical (default argument, verified by the
unchanged checksums of all existing hybrid tests).
energy equation, mass matrices, and external vector-potential fields are asserted
unsupported and arrive in the follow-ups.
particles.max_grid_crossings = 2is required (particles that straddle a grid-boxface at the in-solve deposition need one extra rho/J guard cell).
Tests
Two CI tests, registered as an
--implicitoption of the existingmagnetized_plasma_modescase (parallel and perpendicular 1D EM modes), running at~3x the whistler CFL limit in single implicit steps. Newton converges in exactly
2 iterations/step (rtol 1e-6 -> ~5e-10). The analysis asserts the total energy drift
(2.4e-5 / 7.6e-5 measured, gate at 5e-4) — the residual drift comes from the algebraic
closure and drops to machine precision with the in-loop pressure advance of follow-up 1.
Checksums generated on CPU.
Validation
Longer runs of the same two configurations, with the dispersion overlays of
Munoz et al. (2018):
Parallel propagation (25 ion-cyclotron periods, CPU): the fluctuation power tracks
the R/L whistler branches and the ion-cyclotron resonance, at dt ~3x the whistler CFL,
no sub-cycling.
Perpendicular propagation (25 ion-cyclotron periods, CUDA, RTX 6000 Ada,
21 ms/step): fast magnetosonic/X-mode branch and the ion Bernstein ladder up to
7 Omega_i.
Validated on both OMP and CUDA builds; all existing
magnetized_plasma_modes,implicit-EM, and Ohm-solver tests pass locally with their existing checksums untouched.