Skip to content

Conversation

@bclyons12
Copy link
Member

@bclyons12 bclyons12 commented Jan 19, 2026

Summary

This PR improves the sawteeth source modeling and makes related API cleanups.

Sawteeth Source Improvements

  • Configurable flattening: Expose flat_factor parameter (default 0.5) to control the degree of profile flattening inside the inversion radius, rather than using a hardcoded value
  • Better inversion radius detection: Use dd.sawteeth.diagnostics.rho_tor_norm_inversion when available, falling back to q-profile based detection
  • Correct source exclusions: When computing the total source to flatten, exclude intrinsic sources, which should not be flattened because they are computed from the kinetic profiles themselves (e.g., bootstrap current should not be flattened).
  • Include sawteeth in j_non_inductive: The sawteeth source represents redistribution of other non-inductive sources within the mixing radius, so it should be included in j_non_inductive (previously excluded)

Intrinsic Sources Changes

  • Renamed sources!intrinsic_sources! (BREAKING) : More accurately describes that this function calculates intrinsic sources (collisional exchange, bremsstrahlung, fusion, bootstrap, ohmic) as opposed to externally-driven sources
  • Reordered calculations: Fast ion densities are now updated before bootstrap (which depends on them) for consistency

Plotting Fix

  • Sources with large magnitudes but near-zero integrals (like sawteeth, which redistribute rather than add energy) are now correctly displayed by using the integral of absolute values for the visibility threshold

Companion to ProjectTorreyPines/FUSE.jl#1045

Sawteeth source represents the relaxation of other noninductive sources, so it should be included here
- Expose flat_factor: degree of flattening
- Use dd.sawteeth.diagnostics.rho_tor_norm_inversion if available
- Don't flatten sources in index_no_sawteeth
@bclyons12 bclyons12 merged commit 46569f1 into master Jan 20, 2026
2 checks passed
@bclyons12 bclyons12 deleted the update_time-dep branch January 20, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants