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

@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. This is an intermediate integration milestone, not the final IGR architecture. It intentionally preserves the existing IGR reconstruction/Sigma/viscous-source behavior while moving RHS accumulation, RK update behavior, state layout, and LF Riemann dispatch toward shared MFC 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 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
  • Split the old fused s_igr_riemann_solver behavior into smaller IGR-specific routines called from the shared RHS 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.

Deferred follow-up work:

  • replace IGR-specific face reconstruction with the standard reconstruction path
  • move IGR viscous source-flux construction onto the normal viscous pipeline
  • revisit compatibility with MHD and other currently prohibited physics

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. The updated IGR tests match the previous conserved-variable outputs to machine-level roundoff, aside from the newly added final volume-fraction fields.

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
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.87895% with 157 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.94%. Comparing base (f181a6b) to head (8359606).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/simulation/m_igr.fpp 90.05% 5 Missing and 63 partials ⚠️
src/simulation/m_rhs.fpp 71.34% 20 Missing and 27 partials ⚠️
src/simulation/m_time_steppers.fpp 31.11% 15 Missing and 16 partials ⚠️
src/simulation/m_riemann_state.fpp 11.11% 6 Missing and 2 partials ⚠️
src/simulation/m_riemann_solver_lf.fpp 0.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1615      +/-   ##
==========================================
- Coverage   60.49%   57.94%   -2.55%     
==========================================
  Files          83       83              
  Lines       19902    20570     +668     
  Branches     2951     3001      +50     
==========================================
- Hits        12040    11920     -120     
- Misses       5868     6679     +811     
+ Partials     1994     1971      -23     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@StevenXue98 StevenXue98 marked this pull request as draft June 24, 2026 01:01
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