Skip to content

Relativistic feedback discharge mechanism (Færder et al. 2026) - #15

Merged
rmrsk merged 5 commits into
mainfrom
rfd-faerder2026
Oct 21, 2026
Merged

rmrsk merged 5 commits into
mainfrom
rfd-faerder2026

Conversation

@rmrsk

@rmrsk rmrsk commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the relativistic fluid model of Færder et al. (2026, doi:10.22541/essoar.15010550/v1) for the relativistic feedback discharge (RFD) in thunderclouds, as the mechanism mechanisms/air/rfd/. No solver change: it runs on the per-group photon directions added in #14.

Background

Relativistic runaway electrons (RREs) avalanche along the field and emit bremsstrahlung forward and backward. Forward photons make RREs and positrons; positrons and backward photons run back and make new RREs. Above a field E_s(L), set by the length L of the high-field region, this loop sustains itself with nothing coming in. The paper models it with four 1-D continuity equations whose coefficients were fitted to GEANT4, and finds E_s(L) by normal-mode expansion.

Solution

  • Mapping. RREs are the mechanism's electron (+c̃, c̃ = 0.89 c); positrons drift −c̃ and must vanish at the far end, so they are its positive ion. One "forward" and one "backward" photon group. Every yield is zero, so the feedback closes entirely in the gas and the inception condition is the paper's self-sustained condition: incept1d pdiv gives E_s(L).
  • Coefficients (supplementary eqs. S1–S9), every value identical to the authors' published code. No parameter is fitted or tuned here. Off sea level the mechanism scales as their code does: avalanche length U_R/(E − ñE_d) with the branch at ñE_t, every other coefficient its sea-level fit at the field E, times ñ. ñ = N/N0 with their N0 = 2.688e25 m⁻³ (config key sea_level_density); the example runs at it (--p 1.01371 --T 273.15). Photon attenuation lengths are configuration keys; radius.json holds the paper's two radii, R = 5 km (the paper's "R ≫ L", whose attenuation lengths come from GEANT4 at R = 5 km) and R = 100 m.
  • Docs. configuration/examples/rfd.rst (model eq_rfd_model, mapping table, coefficients, normal modes eq_rfd_normal_modes, limits); examples/rfd.rst + examples/rfd/README.md + a row in examples/README.md; one default figure docs/figures/rfd.tex (Incept1D for both radii, 10 m – 12 km; with the reader's paper.dat it adds the paper's results and a difference panel); [Faerder2026b] reference.
  • Tests. tests/closed_form_rfd.py: the normal-mode solution, transcribed independently of the solver. tests/test_rfd_mechanism.py (23 tests, ~2.5 s, plus RFD9 when the paper's data is supplied), including RFD6: at half the sea-level density, the solver against the normal modes of the authors' scaling.
  • Comparison with the paper's published results. The authors' code and results are on Zenodo (doi:10.5281/zenodo.22983026, CC-BY 4.0). examples/rfd/paper_comparison.py reads their E_s(L) from the reader's unpacked archive, solves the same thresholds with Incept1D at the same L, and writes examples/rfd/paper.dat (git-ignored; their data is not redistributed). make -C docs/figures rfd then includes it; RFD9 asserts the like-for-like case when the file is present.

Evidence (sea level, R = 5 km), solver vs the independent normal-mode transcription:

L E_s, incept1d E_s, normal modes rel. diff.
25 m 2747.443 kV/m 2747.443 kV/m 1e-11
100 m 835.325 kV/m 835.325 kV/m 1e-10
500 m 403.659 kV/m 403.659 kV/m 2e-10
5 km 305.554 kV/m 305.554 kV/m 7e-11

Both criteria (Riccati and det Q); the tests assert 1e-8 for both radii. E_s reaches 3 MV/m at L = 22.9 m (paper: "≈ 23 m") and falls toward 305.4 kV/m (Bhabha onset, just above E_t = 284 kV/m) at large L. An 80-point sweep for both radii, 10 m – 12 km, takes under two seconds.

Against the paper's published results, at their 100 L values from 10 m to 12 km:

Their result vs Incept1D
Normal modes, R = 5 km (100 V/m search grid) ≤ 0.05 kV/m (1.5e-4) for L ≤ 5 km; ≤ 6e-4 to 12 km
Time-dependent fluid model, R = 5 km −0.05 … −1.9 % for L ≤ 4.7 km
Time-dependent fluid model, R = 100 m −0.08 … −1.9 % for L ≤ 4.7 km

The normal modes are the like-for-like comparison: same model, same coefficients, same steady-state condition, agreeing to their grid resolution. Their time-dependent model sits the same 0.1–2 % below their own normal modes, and beyond ~5 km drops to E_t, below the 305.4 kV/m floor of any steady-state threshold; that is a property of their finite-time growth test, not of the model.

Points found in the paper

  • S15 sign. The (γ↑, γ↑) entry of M is printed as +λ_a↑⁻¹; eq. 5/S12 and S18 give −λ_a↑⁻¹. The model equations are used, and the authors' own normal-mode code uses −λ_a↑⁻¹ too, so this is a typo in the supplement only.
  • Fig. S10 vs Fig. 1. S10's marked thresholds are lower (≈ 755 kV/m at L = 100 m) than Fig. 1's (≈ 835); this implementation matches Fig. 1 and the archive's final results. The archive's photon-only normal-mode file gives 743.5 kV/m at L = 99 m, so S10 likely shows an intermediate model.
  • P_cp limit. The main text gives P_cp → 2×10⁻² m⁻¹ toward 3 MV/m; the fit S3 gives 3.3×10⁻² (consistent with Fig. S2). The fit is used.

Choices and limits

  • Positron attenuation is held at its 305.4 kV/m value below 305.4 kV/m instead of diverging at 259.1 kV/m, the only departure from the authors' code. Below 305.4 kV/m there is no Bhabha production, so positrons feed nothing back and their loss cannot change any threshold.
  • Charge layers as electrodes. The high-field region lies between two layers of opposite charge inside the cloud; the gap's electrodes stand for them. They set the field and the voltage, but particles cross them and are lost beyond, which in this one-way, diffusion-free model is an absorbing electrode with every yield zero. The model is 1-D like the paper's: R enters only through the photon attenuation lengths, and the R = 5 km lengths are used over all L up to 12 km, as in the paper.
  • Altitude. The paper publishes sea-level results only; off sea level this is the authors' model, unchecked against published data.
  • Growth rates. incept1d growth retards photons by λ/c; the model moves them at c̃. The threshold (λ = 0) is unaffected.
  • Non-uniform --field applies the coefficients locally; not checked against GEANT4.
  • No alpha/eta, so incept1d ionization and --streamer-criterion do not apply.
  • Data rights. The coefficients are formulae from a CC-BY 4.0 preprint, cited in the mechanism file and the docs; no tables, figure data or archive files from the paper are included. The comparison reads the authors' archive from the reader's disk.

PR-review checklist

Mandatory:

  • I have run pre-commit run --all-files (black, flake8, Sphinx) and it passed. reuse lint fails locally only on an untracked .claude/worktrees checkout that is not part of the repository.
  • I have run the test suite and made sure that it passed. 681 passed, including slow (RFD9 runs only with paper.dat present).
  • I have added all relevant user documentation to Sphinx, and make -C docs html builds without warnings. Dummy builder with -W; the figure builds with make -C docs/figures rfd, with and without paper.dat.
  • I have added NumPy-style docstrings to all new public functions and classes.
  • I have added appropriate labels to this PR.
  • I have added/revised proper licensing and copyright information.
  • I have run a PR review using @claude review.

If this PR changes the physics or the numerics:

  • I have cited the corresponding equation label or table in docs/source/theory/ in the commit message or docstring, and updated the theory page if the model itself changed. No solver or theory change; the model's own equations are labelled on its configuration page.
  • I have checked the closed-form limit with mechanisms/air/pancheshnyi/paschen.json and it still reproduces the standard Paschen law. Not applicable: no shared code changed.
  • I have included before/after inception curves (or equivalent evidence) for a case the change is expected to affect. New mechanism: table above, and the figure.
  • I have confirmed that cases the change is not expected to affect are unchanged. No package code changed.

🤖 Generated with Claude Code

@rmrsk rmrsk added enhancement New feature or request do not merge Blocked: must not be merged yet labels Oct 20, 2026
@rmrsk rmrsk self-assigned this Oct 21, 2026
@rmrsk rmrsk changed the title [DO NOT MERGE] Relativistic feedback discharge mechanism (Færder et al. 2026) Relativistic feedback discharge mechanism (Færder et al. 2026) Oct 21, 2026
The relativistic fluid model of Færder et al. (preprint,
doi:10.22541/essoar.15010550/v1, and its supplementary material) as an
incept1d mechanism: runaway electrons drifting forward and positrons
drifting backward at 0.89 c, one forward and one backward photon group
(PHOTON_DIRECTIONS), and nothing emitted at either end, so the feedback
closes entirely in the gas.  With every yield zero the inception
condition is the paper's self-sustained condition, and incept1d pdiv
gives E_s(L).  The mapping onto the interface, the coefficients (S1-S9)
and the normal-mode solution are documented in
configuration/examples/rfd.rst (eq_rfd_model, eq_rfd_normal_modes).

Each coefficient is the paper's function of the sea-level-equivalent
field E/n~ times n~: the paper's expression at n~ = 1, and a function of
E/N only, so the curve depends on N d alone.  The sea-level reference
density (1 atm, 293.15 K by default) and the photon attenuation lengths
are configuration keys; radius.json holds the paper's two radii.

tests/closed_form_rfd.py transcribes the normal-mode solution
independently of the solver.  Both criteria match it to 1e-8 for
L = 25 m - 5 km and both radii (observed agreement ~1e-10); E_s reaches
3 MV/m at L = 22.9 m, as the paper states (~23 m), and falls toward
305.4 kV/m, the onset of Bhabha production, at large L.  The S15
matrix prints the forward-photon attenuation entry with the wrong sign;
the model equations (and S18) give -1/lambda_a,up, which is used.

New example examples/rfd/ and default figure docs/figures/rfd.tex
(solver against normal modes; builds in seconds).

Depends on PHOTON_DIRECTIONS (#14).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmrsk
rmrsk changed the base branch from ccr-f58c9c8e-j7qtz7 to main October 21, 2026 06:25
The authors publish their code and E_s(L) results on Zenodo
(doi:10.5281/zenodo.22983026, CC-BY 4.0).  examples/rfd/paper_comparison.py
reads their normal-mode and time-dependent results from the reader's
unpacked archive, solves the same thresholds with Incept1D at the same L,
and writes both to examples/rfd/paper.dat (git-ignored: their data is not
redistributed).  The opt-in figure `rfdpaper` plots it, and RFD9 asserts the
like-for-like case when the file is present.

Result: Incept1D matches their normal modes to within their 100 V/m search
grid (<= 0.05 kV/m, 1.5e-4) for every L from 10 m to 5 km, and to 6e-4 up
to 12 km.  Their time-dependent model lies 0.1-2 % below both, and drops to
E_t beyond about 5 km, where its finite-time growth test departs from the
steady-state threshold.  Their code also uses -1/lambda_a,up in the mode
matrix, confirming the sign the mechanism uses.

Also black-formats tests/closed_form_rfd.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmrsk rmrsk removed the do not merge Blocked: must not be merged yet label Oct 21, 2026
@rmrsk

rmrsk commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@claude review

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 28s —— View job


Review of PR #15: RFD mechanism (Færder et al. 2026)

I read mechanisms/air/rfd/air_rfd.py and config.py against the PR description and CLAUDE.md. I did not read the docs, tests, example scripts or figure sources, and I did not run pre-commit or pytest. The test and pre-commit results below are the ones you report in the PR body.

Overall: no blocking issues in the files I read. The mapping is consistent with the solver's conventions.

Mapping checks that hold up

  • Positron row. The steady-state row in mode_matrix is dn_pos/dz = n_pos/λ_a,pos − P_pp n_up. The solver reaches the same sign through A = R V⁻¹ with V = −c̃ and R[1,1] = −c̃ n / λ_a,pos, so get_R, get_V and mode_matrix agree.
  • Photon groups. With PHOTON_DIRECTIONS = ["forward", "backward"], get_B is (2×2) and get_C has its source column only on the RRE. This matches the interface. The yields are all zero, so inception reduces to the paper's self-sustained condition, as the PR argues.
  • Row selectors. Π_- has shape (0, 2). Please confirm that _build_A_aug, riccati_criterion and inception_det handle zero-row selectors on every path, including the compound-matrix fallback. The reported agreement to about 1e-10 for both criteria suggests they do.
  • Independence. tests/closed_form_rfd.py is a separate transcription, as CLAUDE.md requires. Please confirm it does not import air_rfd.mode_matrix, because the mechanism file also contains mode_matrix and normal_mode_threshold.

Minor points (non-blocking)

  1. Scalar-only helpers. _fit (air_rfd.py:101) and inv_avalanche_length branch on if E <= E_d / E >= E_T, so they only accept scalars. That is fine for the current callers, which pass a scalar EN. A vectorised caller such as chombo tables, or a future mechanism helper, would fail with an ambiguous-truth-value error. Consider noting "scalar E" in the docstrings or using np.where.
  2. Unused function. E_field (air_rfd.py:149) looks unused in the mechanism. If only the docs or the example use it, that is fine. Otherwise drop it.
  3. Config docstring. config.py:8 says "Three parameters can be set". The dataclass has four settable fields besides label: two attenuation lengths, sea-level pressure and sea-level temperature.
  4. air_config.py. CLAUDE.md says each air config.py subclasses air_config.py, which restricts the accepted keys. This config.py is standalone and re-implements the unknown-key check in from_dict. That is reasonable, because the RFD keys have nothing in common with the chemistry keys. A one-line note in the docstring would stop a later reader from "fixing" it.
  5. Default T. The interface defaults are T=293.0, while the sea-level reference is 293.15 K. So relative_density() at its defaults is not exactly 1 (about 5e-4 off). This only matters for direct calls, since the CLI passes T explicitly. A comment would help.
  6. Discontinuity at E_T. inv_avalanche_length jumps at E = E_T because E_d switches from 320 to 276 kV/m. This matches the paper's piecewise definition. A short comment in the code would show it is intentional. The scan for roots above 285 kV/m is unaffected.
  7. Positron attenuation floor. The 305.4 kV/m hold in inv_positron_attenuation is only harmless if P_bb = 0 at and below the same threshold. It is, because _fit_BB's E_d is 305.4e3 and _fit returns 0 for E <= E_d. The two thresholds are linked only through _FIT_BB[2]. Your docstring says this, so no change is needed.

Docs and licensing (from the PR description only)

  • Reading the authors' Zenodo archive from the reader's disk, with paper.dat git-ignored, follows the CLAUDE.md rule against redistributing third-party data.
  • The coefficients are formulae cited from a CC-BY 4.0 preprint, which is consistent with that rule.
  • Please run reuse lint on a clean checkout. You noted it fails locally only because of the untracked .claude/worktrees directory, so CI should confirm.
  • The "Points found in the paper" section (the S15 sign, the Fig. S10 vs Fig. 1 discrepancy, and the P_cp limit) is useful. I suggest also recording it in docs/source/configuration/examples/rfd.rst if it isn't there already, so it survives the PR.

Checklist

  • The only unchecked item is "run a PR review using @claude review", which this comment covers.
  • The Paschen-limit checkbox is correctly marked not applicable, since no shared code changed.

rmrsk and others added 3 commits October 21, 2026 09:19
… figure

Off sea level the mechanism now solves the authors' system
(doi:10.5281/zenodo.22983026) rather than an extrapolation of ours: the
avalanche length is U_R/(E - n~ E_d) with the branch at n~ E_t, and every
other coefficient is its sea-level fit at the field E itself, times n~
(previously each was evaluated at E/n~, which made the curve depend on pd
only but is not what the authors do).  The sea-level density is theirs,
2.688e25 m^-3 (config key sea_level_density, replacing
sea_level_pressure/temperature); the example runs at it,
--p 1.01371 --T 273.15.  At sea level, where every published result is,
nothing changes: the thresholds move by <= 1.4e-9, and the agreement with
the paper's normal modes stays <= 0.05 kV/m to 5 km.

RFD6 now checks half the sea-level density against the normal modes of the
authors' scaling, transcribed in the test, instead of pd invariance.

One figure, rfd: Incept1D for both radii over the paper's 10 m - 12 km;
with the reader's examples/rfd/paper.dat it adds the paper's results and a
difference panel.  The normal-mode overlay (examples/rfd/normal_modes.py,
the mechanism's own mode_matrix / normal_mode_threshold) and the opt-in
rfdpaper figure are removed; solver vs normal modes stays in the tests
(tests/closed_form_rfd.py, RFD1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The attenuation lengths of the case the paper calls R >> L come from its
GEANT4 runs at R = 5 km, and are used over the whole range of L, up to
12 km, where R >> L no longer holds.  The configuration, figure and docs now
call it R = 5 km and note the paper's name for it.

The example page gains a section on what the gap is here: the high-field
region, with open ends where nothing enters, which are the boundary
conditions of the secondary-emission chapter with every yield zero; and on
how R enters (only through the photon attenuation lengths).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The high-field region lies between two layers of opposite charge inside the
thundercloud; the gap's electrodes stand for them.  They set the field and
the voltage, but particles cross them and are lost beyond, which in this
one-way, diffusion-free model is an absorbing electrode with zero yield.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmrsk
rmrsk merged commit 502ea30 into main Oct 21, 2026
7 checks passed
@rmrsk
rmrsk deleted the rfd-faerder2026 branch October 21, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant