Skip to content

IGR integration#1615

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

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

Conversation

@StevenXue98

@StevenXue98 StevenXue98 commented Jun 22, 2026

Copy link
Copy Markdown

Description

This PR integrates IGR with more of the shared RHS/Riemann infrastructure while preserving the existing IGR numerical behavior.

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 s_riemann_solver path using the LF Riemann solver.
  • Use shared RHS accumulation helpers for IGR:
    • s_compute_advection_source_term
    • s_compute_additional_physics_rhs
  • Refactor IGR-specific pieces out of the old fused s_igr_riemann_solver path:
    • s_igr_reconstruct_cell_boundary_values
    • s_igr_correct_lf_fluxes
    • s_igr_sigma
  • Preserve legacy IGR behavior where needed:
    • skip the normal LF MPP limiter for IGR, since it was not part of the old IGR path
    • skip normal LF viscous-source construction for IGR, since IGR now fills those source-flux slots itself
  • Remove the special padded rhs_vf allocation previously needed by IGR-specific direct RHS updates.

IGR-specific reconstruction, Sigma correction, and viscous source-flux construction are still present in m_igr.fpp. Subroutine s_igr_riemann_solver is also still present in m_igr.fpp, which explains the increased line count.

Type of change

  • Refactor

Testing

Local testing:

./mfc.sh test --add-new-variables --only IGR
./mfc.sh test --add-new-variables --from F926448C --to F926448C
./mfc.sh test --add-new-variables --from 18A71AB2 --to 18A71AB2
./mfc.sh test --add-new-variables --from 43B5FEBD --to 43B5FEBD
./mfc.sh test --add-new-variables --from E49EF7B6 --to E49EF7B6
./mfc.sh test --only IGR

Additional local comparison/debug checks used during development:

python3 local_check_igr_full_alpha.py --default-igr
python3 local_igr_diagnostics/scripts/compare_igr_packs.py --default-igr

The IGR golden files were updated with --add-new-variables to include the newly stored final volume fraction. Existing golden entries were preserved, and the added final-alpha fields satisfy the expected volume-fraction sum checks, which is verified by the local Python scripts.

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
  • Verified CPU only

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 StevenXue98 changed the title Igr integration IGR integration Jun 23, 2026
@StevenXue98 StevenXue98 marked this pull request as ready for review June 23, 2026 22:05
@StevenXue98 StevenXue98 requested a review from sbryngelson as a code owner June 23, 2026 22:05
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