Repository navigation
Add mainline magnetic reconnection example - #34
Open
rogeriojorge wants to merge 4 commits into
Open
rogeriojorge wants to merge 4 commits into
rogeriojorge wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
rogeriojorge
marked this pull request as ready for review
July 17, 2026 20:26
rogeriojorge
force-pushed
the
agent/reconnection-mainline-example
branch
from
September 26, 2026 21:35
e3bae28 to
3a35d7a
Compare
This was referenced Sep 26, 2026
…c current, per-population tails The growth rate is now a least-squares fit over an explicit --fit-window (default: second half of the run) of the observable the docstring names, with the fit residual and the per-half rates printed. The movie shows the kinetic current J_z/Omega_ce instead of curl B, which also contains dE_z/dt. Hermite tails use hermite_tail_fraction per population (needs #9). The convergence table is labelled as measured with the previous peak fit and the assumed second-order extrapolation is removed.
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.
Problem
Main has no magnetic-reconnection example on the rFFT solver.
Change
One file,
Examples/2D_magnetic_reconnection.py: periodic double Harris sheet with the Camporeale et al. (2006, sec. IV.C) parameters (m_i/m_e=16,omega_pe/Omega_ce=3,T_i=T_e,rho_i/a=2, guide field 5). Harris pressure balance givesv_th,e = sqrt(2)/6 cand hencea = sqrt(2) d_e; thermal speedsa/6,a/24and drifts±1/(6a)follow. Evolves in chunks, fits the half-sheet magnetic-mode growth, and writes a growth/flux plot, aJ_zmovie withA_zcontours and an npz file.--perturbation 1e-4is the linear diagnostic,0.1a finite-seed nonlinear island.Effect (CPU, shared 36-core node)
The rate converges in nx (the sheet needs nx >= 257 in this box); extrapolating nx (second order) and H gives about 5.25e-3, 1.5 % below the paper. The docstring records the table.
Tests
Example only, no solver change; full suite 7 passed (also with
JAX_ENABLE_X64=1).Update 2026-10-03 (head 87c4cf7)
--fit-window(default: second half of the run). The output also has the fit rms log residual and the rates of the two halves of the window, as a check that the window is in a single exponential phase. The earlier fit through local maxima for t >= t_max/4 is gone.J_z/Omega_cefrom the Hermite moments (plasma_current). It is not labelled curl B, which also containsdE_z/dt.hermite_tail_fractionper population (from Fix odd-grid RFFT energy weights; add a Hermite boundary diagnostic #9) replaces the unweighted all-species sum without Parseval weights. Depends on Fix odd-grid RFFT energy weights; add a Hermite boundary diagnostic #9. With main's two-populationdCkbookkeeping, populations 3 and 4 keep their k=0 background, so the tail fractions are exact only after Fix multispecies perturbation bookkeeping #12.--fit-window 10 40, both finite, on main + Fix odd-grid RFFT energy weights; add a Hermite boundary diagnostic #9 (4.6 s and 10.5 s on a laptop CPU). These short runs are transient, not tearing growth: the rms residual is 0.46 and 0.98, so the new output flags them.V = v_th^2/(Omega_ce a)=1/(6a)andJ_z/Omega_ce = (curl B)_z = sech^2/awitha = sqrt(2) d_e. This example uses the exact1/3, 1/48constants.