Skip to content

[spectre-11] Validate SPECTRE losses, classification, and full-orbit crossing #442

Description

@krystophny

Stage: SIMPLE / physics validation (milestone M3)
Source language: Fortran 2008 + Python test drivers
Manuals to read first: DOC/spectre-interface-crossing.md; src/orbit_fo_boris.f90 (full-orbit Boris, orbit_model = 7 — the in-house non-adiabatic reference); examples/golden_record.py and docs/review-policy.md (golden-record rules); SPECTRE examples/optimization/qa_vac_vol7 (the multi-volume stellarator case to convert into the validation fixture).
Depends on: #441

Goal

End-to-end validation of SPECTRE support at production scope: confinement statistics and orbit classification on a multi-volume stellarator case, cross-validation of the crossing map against full-orbit physics, and a golden-record entry that locks the behavior.

Files to edit

  • test/tests/test_spectre_losses.py: NEW. Full loss run on a low-resolution qa_vac_vol7-derived fixture.
  • test/tests/test_spectre_fullorbit_crossing.py: NEW. Boris-vs-guiding-center interface crossing comparison.
  • examples/: SPECTRE example input (simple_spectre.in) + fixture-generation provenance.
  • Golden-record integration per docs/review-policy.md.
  • DOC/coordinates-and-fields.md: final consistency pass over all SPECTRE sections added by spectre-05..10.

Acceptance scenarios (BDD)

  • Given the multi-volume stellarator fixture and a standard alpha-loss configuration, when simple.x runs with symplectic integration, then confined_fraction.dat and times_lost.dat are produced, every particle is accounted (confined + lost + crossing events consistent), and results are reproducible with fixed seed.
  • Given the same ensemble with RK45 and with symplectic integration, then confined fractions agree within two-sigma Monte-Carlo error.
  • Given trapped/passing and regular/chaotic classification enabled, then classification completes on SPECTRE fields and the trapped-passing split matches the analytic mirror criterion on sampled orbits.
  • Given a full-orbit (Boris, Cartesian evaluation through the coordinate map) ensemble crossing one interface with gyro-phase-uniform initialization, then the guiding-center Level-1 map reproduces the gyro-averaged post-crossing (v_par, position) within the gyro-scatter band, and the measured mu scatter is quantified and recorded in DOC/spectre-interface-crossing.md (validates and bounds the conserved-mu model assumption).
  • Given the golden-record runner, then the SPECTRE case passes against its committed reference.

Success criteria

make && make test TEST=spectre_losses && make test TEST=spectre_fullorbit_crossing

Non-goals

  • No performance optimization (basis-evaluation batching/splining is a separate future issue if profiling demands).
  • No free-boundary vacuum-region tracing beyond the outermost interface (future work; loss surface stays the outermost interface).
  • No optimization-loop integration (pysimple/batch API exposure is follow-up).

Verification

make test TEST=spectre_losses

Metadata

Metadata

Assignees

No one assigned

    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