Skip to content

IGR integration#1615

Draft
StevenXue98 wants to merge 14 commits into
MFlowCode:masterfrom
StevenXue98:igr-integration
Draft

IGR integration#1615
StevenXue98 wants to merge 14 commits into
MFlowCode:masterfrom
StevenXue98:igr-integration

Conversation

@StevenXue98

Copy link
Copy Markdown

Description

This draft PR begins integrating IGR with the shared RHS/Riemann infrastructure.

Main changes:

  • Store the final volume fraction for IGR so the IGR state layout matches the normal model-equations layout more closely.
  • Route IGR face states through the shared LF Riemann solver path.
  • Use the shared advection-source RHS accumulation path for IGR.
  • Split remaining IGR-specific Sigma and viscous RHS logic into separate helper routines.
  • Keep legacy IGR numerics where needed, including an IGR-gated LF MPP limiter behavior to preserve previous IGR results.

This is intended as a first integration step. IGR-specific reconstruction, Sigma correction, and viscous correction logic are still present in m_igr.fpp.

Type of change

  • Refactor

Testing

Tested with local IGR regression comparison:

./mfc.sh test --only IGR
./mfc.sh test -j 1 --debug --from F926448C --to F926448C
./mfc.sh test -j 1 --debug --from 18A71AB2 --to 18A71AB2
./mfc.sh test -j 1 --debug --from 43B5FEBD --to 43B5FEBD
./mfc.sh test -j 1 --debug --from E49EF7B6 --to E49EF7B6
python3 local_check_igr_full_alpha.py --default-igr
python3 local_igr_diagnostics/scripts/compare_igr_packs.py --default-igr

All new outputs match the golden files to machine precision except for case E49EF7B6. E49EF7B6 uses a looser existing tolerance, so I also compared against a regenerated upstream/reference pack.txt. That comparison passed with max relative difference around 2.6e-11.

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

@StevenXue98

Copy link
Copy Markdown
Author

Small status note for this draft PR:

This is still a work in progress. The current version is intended to show the first IGR integration step: routing IGR through the shared LF Riemann solver (now calling s_riemann_solver) and shared advection RHS accumulation (now calling s_compute_advection_source_term) while preserving legacy IGR results.

A few things are still intentionally unfinished:

  • The line count is currently larger because some legacy IGR logic is still present while the new path is being validated.
  • IGR-specific reconstruction, Sigma correction, and viscous correction are still in m_igr.fpp.
  • The next cleanup target is to reduce duplicated IGR viscous/reconstruction logic and move more RHS accumulation through existing shared helpers (e.g. s_compute_additional_physics_rhs, and later potentially s_get_viscous, which requires changing the custom IGR logic).
  • Some official test failures are expected due to the expanded final-volume-fraction output/golden-file line count mismatch rather than numerical mismatch. The IGR-specific test cases are currently verified through a local comparison script while we decide how to handle goldens.

I’ll keep pushing smaller cleanup/refactor commits as each piece is validated.

@StevenXue98 StevenXue98 changed the title Igr integration IGR integration Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant