Skip to content

KIM: revive Fourier-space solver via enforced radial periodicity (localized solutions) #175

Description

@krystophny

Goal

Deliver one verified electrostatic Fokker-Planck periodic-Fourier solver for KIM. Markus continues from feature/kim-forced-periodicity at d4ac12b0; the independent PR stack #177-#184 remains comparison and reuse material. The accepted implementation must preserve CGS units, the Fourier phase exp(+i(m theta+n phi)), species composition, collision-model dispatch, and the existing hat solver.

Current evidence

The branch builds and its focused tests exit zero, but it is not ready to merge:

  • test_periodic_vs_global reports raw relative L2 0.8434, periodic/global peak ratio 0.2321, and DC-removed relative L2 1.3449 for the static (m,n)=(-6,2), q=3, constant-B_r, m_phi=0 case. The test only warns.
  • N_rg and M refinement converge to 7.63e-4 and 1.02e-12, respectively. The window-deformation sequence is non-monotone and ends at relative L2 0.7836, but the test still exits zero.
  • The production window uses plasma%spec(0)%rho_L. At r_m=36.8 cm, the same case has rho_Le=0.0038313 cm and rho_Li=0.23217 cm, a factor 60.6. The current window and comparison interval therefore resolve electron rather than ion FLR scales.
  • Multi-ion reconstruction assigns n_s=n_e Z_s/sum Z, which does not satisfy sum Z_s n_s=n_e in general, and copies one ion-temperature profile to every ion.
  • The off-diagonal FP kernel defaults to dropping k_s^2; its tests mostly share or duplicate the implementation algebra. Production uses only m_phi=0 without a measured tail.
  • The periodic solve reconstructs full delta Phi with periodic edges, while hat bc_type=3 uses the aligned-potential boundary. Design decision R1 to solve psi=delta Phi-Phi_MA is not implemented. The physical status of a helical -k_s^2 Poisson term is unresolved.
  • zgesv reports singularity only. There is no condition estimate or scaled backward residual.
  • No accepted Vaclavik comparison, periodic golden record, E_perp comparison, or layer-current comparison exists.

Branch and PR relation

Work Role after this audit
feature/kim-forced-periodicity Primary FP implementation. Continue here through children #185-#190.
37-add-parallel-flow-to-x2-in-kim-fp, 152bf013 Historical implementation of #37. Rebase or reimplement for current x2(:,m_phi).
#177 Historical continuous Krook kernels. Use for Fourier/Debye convention comparisons, not as the FP source.
#178 Independent C-infinity periodizer. Compare seam and derivative behavior with Markus's periodizer.
#179 Independent Krook Fourier assembly and dense solve. Reuse only generic verified infrastructure.
#180 Run-type/config seam and per-species background feed. Strongest reuse candidate after convention review.
#181 Packaged comparison harness plus the negative result that Krook is not a converged reference.
#182 Collision-frequency sensitivity control. It is not an FP validation mechanism.
#183 Valid hat-path repair: recompute derived Krook z0 after primitive interpolation. Keep independent of FP acceptance.
#184 Prevents a Krook periodic kernel from being labeled FP. Retain until the verified FP dispatch replaces that unsupported path.

PRs #177-#184 must not be merged mechanically into Markus's branch. #191 decides which pieces are retained, superseded, or remain independent after the physics gates pass.

Atomic split

Verification sequence

  1. Fix physical scale and multispecies state ([kim-fp-01] Size the periodic window from active-species Larmor radii #185, [kim-fp-02] Preserve multispecies profiles in periodic backgrounds #186).
  2. Establish the independent kernel and Poisson equations ([kim-fp-03] Verify the off-diagonal Fokker-Planck Fourier kernel #187, [kim-fp-04] Match the periodic and hat electrostatic boundary-value problem #188). Do not tune factors against the 84% discrepancy.
  3. Add numerical trust diagnostics and hard gates ([kim-fp-05] Make periodic convergence and solve checks hard gates #189).
  4. Run the matched hat/periodic/Vaclavik benchmark ([kim-fp-06] Establish a matched Fokker-Planck shielding benchmark #190).
  5. Reconcile duplicate branches and open the final integration PR ([kim-fp-07] Integrate the verified Fokker-Planck periodic solver #191).

The benchmark pre-registers its gates: roundoff-scaled oracle agreement; backward residual below 1e-10; self-convergence below 1e-3 relative L2; periodization error below 1%; and matched observables within 5% or their tighter combined uncertainty. A failed gate exits nonzero.

Acceptance

This tracker is closed now that every child has been filed as an independently reviewable implementation issue. The children remain open and assigned to Markus. Reopen this tracker only to change the split; use #191 for final integration status.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions