Skip to content

KIM: guard WKB and FLR2 collision-normalized paths when collisions_off is enabled #267

Description

@krystophny

Finding

collisions_off now correctly makes the background collision frequency zero before derived quantities are assembled (tracked by #256). Several optional consumers still divide by that zero collision frequency directly:

  • KIM/src/dispersion/wkb_dispersion.f90 (three response terms)
  • KIM/src/dispersion/fun_input.f90 (two response terms)
  • KIM/src/asymptotics/flr2_fourier_kernel.f90
  • KIM/src/asymptotics/FLR2_asymptotics.f90
  • KIM/src/flr2/flr2_response.f90
  • KIM/src/diagnostics/kim_qldiff_mod.f90

The main configuration validation rejects collisions_off=.true. with collision_model='FokkerPlanck', but Krook/WKB and optional diagnostic/asymptotic combinations can still reach code that contains factors such as 1/nu or 1/(omega_c*nu). Zeroing unused susceptibility arrays in background construction therefore does not by itself make these downstream expressions finite.

Risk

Depending on the selected optional mode, a nominally collisionless run can produce IEEE divide-by-zero/invalid values or NaNs in WKB, FLR2, or quasilinear diagnostics.

Recommended resolution

  1. Define which optional response/diagnostic modes are supported with collisions_off.
  2. Reject unsupported combinations during configuration validation.
  3. For supported collisionless limits, implement the analytically combined finite limit rather than evaluating separately divergent 1/nu factors and zero susceptibility moments.
  4. Add mode-level regressions that enable collisions_off and assert finite outputs/no IEEE exceptions.

Scope note

This was found while reviewing #256. It is intentionally not folded into that bounded background-ordering PR because each consumer requires a model-specific collisionless-limit decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions