Skip to content

IGR User Guide test cases #1346

Draft
anandrdbz wants to merge 5 commits intoMFlowCode:masterfrom
anandrdbz:master
Draft

IGR User Guide test cases #1346
anandrdbz wants to merge 5 commits intoMFlowCode:masterfrom
anandrdbz:master

Conversation

@anandrdbz
Copy link
Copy Markdown
Contributor

Description

Case files and documentation for all 5 example cases used in the IGR User Guide paper.
3 new cases (2D_IGR_double_mach, 2D_IGR_isentropic_vortex and 2D_IGR_riemann_test)
3D_IGR_TaylorGreenVortex modified to include energy cascade in post_process
3D_IGR_33jet left as is with README.md

Description for all 5 cases included with a README.md in the case directory

Also included a 1-line fix for an acoustic source edge case that results in a 0-size copy from CPU to GPU (fails on amd compilers)

Fixes #(issue)

Type of change

  • [ x] Bug fix
  • [x ] New feature
  • Refactor
  • Documentation
  • Other: describe

Testing

How did you test your changes?

Checklist

  • [ x] I added or updated tests for new behavior
  • [ x] 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 triggered automatically. To request a review, comment on the PR:

  • @coderabbitai review — incremental review (new changes only)
  • @coderabbitai full review — full review from scratch
  • /review — Qodo review
  • /improve — Qodo code suggestions
  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Add label claude-full-review — Claude full review via label

@anandrdbz anandrdbz requested a review from sbryngelson as a code owner April 1, 2026 11:56
@sbryngelson sbryngelson marked this pull request as draft April 1, 2026 11:59
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add IGR User Guide test cases with Double Mach Reflection support

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Add Double Mach Reflection test case with shock boundary conditions
• Implement three new 2D IGR test cases (isentropic vortex, Riemann test, double mach)
• Add helper subroutines for 2D blending and entropy wave fluctuations
• Fix acoustic source GPU copy edge case when count is zero
• Update Taylor Green Vortex case parameters and enable FFT output
Diagram
flowchart LR
  A["Global Parameters"] -->|"double_mach flag"| B["Boundary Conditions"]
  A -->|"shock parameters"| C["Initial Conditions"]
  B -->|"reflective BC"| D["Double Mach Setup"]
  C -->|"cases 283-285"| D
  E["Blending Subroutines"] -->|"symm_2d_blending"| C
  F["Acoustic Source"] -->|"fix zero-size copy"| G["GPU Update"]
  D -->|"test cases"| H["Example Cases"]
Loading

Grey Divider

File Changes

1. src/common/m_boundary_common.fpp ✨ Enhancement +113/-20

Add double mach boundary condition initialization and reflective BC

src/common/m_boundary_common.fpp


2. src/common/include/2dHardcodedIC.fpp ✨ Enhancement +74/-0

Add three new hardcoded initial condition cases for IGR

src/common/include/2dHardcodedIC.fpp


3. src/pre_process/m_icpp_patches.fpp ✨ Enhancement +28/-0

Add blending subroutines for 2D entropy wave fluctuations

src/pre_process/m_icpp_patches.fpp


View more (30)
4. src/pre_process/m_global_parameters.fpp ✨ Enhancement +22/-0

Declare double mach parameters and initialize defaults

src/pre_process/m_global_parameters.fpp


5. src/simulation/m_global_parameters.fpp ✨ Enhancement +20/-0

Add double mach parameters with GPU declarations

src/simulation/m_global_parameters.fpp


6. src/post_process/m_global_parameters.fpp ✨ Enhancement +20/-0

Add double mach parameters to post-process module

src/post_process/m_global_parameters.fpp


7. src/simulation/m_acoustic_src.fpp 🐞 Bug fix +10/-8

Fix GPU copy edge case for zero-size acoustic source arrays

src/simulation/m_acoustic_src.fpp


8. src/pre_process/m_start_up.fpp ✨ Enhancement +1/-1

Add double_mach to namelist input reading

src/pre_process/m_start_up.fpp


9. src/simulation/m_start_up.fpp ✨ Enhancement +6/-1

Update shock position and add double_mach GPU synchronization

src/simulation/m_start_up.fpp


10. src/post_process/m_start_up.fpp ✨ Enhancement +5/-1

Update shock position for post-processing with time advancement

src/post_process/m_start_up.fpp


11. src/pre_process/m_mpi_proxy.fpp ✨ Enhancement +1/-1

Add double_mach to MPI broadcast list

src/pre_process/m_mpi_proxy.fpp


12. src/simulation/m_mpi_proxy.fpp ✨ Enhancement +2/-2

Add double_mach to MPI broadcast list

src/simulation/m_mpi_proxy.fpp


13. src/post_process/m_mpi_proxy.fpp ✨ Enhancement +2/-2

Add double_mach and dt to MPI broadcast lists

src/post_process/m_mpi_proxy.fpp


14. toolchain/mfc/params/namelist_parser.py ⚙️ Configuration changes +3/-0

Register double_mach parameter in namelist parser

toolchain/mfc/params/namelist_parser.py


15. toolchain/mfc/params/definitions.py ⚙️ Configuration changes +2/-1

Add double_mach parameter definition and description

toolchain/mfc/params/definitions.py


16. toolchain/mfc/params/descriptions.py 📝 Documentation +1/-0

Add double_mach parameter description for documentation

toolchain/mfc/params/descriptions.py


17. toolchain/mfc/test/cases.py 🧪 Tests +1/-0

Add 2D_IGR_double_mach to test case list

toolchain/mfc/test/cases.py


18. examples/2D_IGR_isentropicvortex/case.py 🧪 Tests +97/-0

Create isentropic vortex IGR test case configuration

examples/2D_IGR_isentropicvortex/case.py


19. examples/2D_IGR_double_mach/case.py 🧪 Tests +83/-0

Create double mach reflection IGR test case configuration

examples/2D_IGR_double_mach/case.py


20. examples/2D_IGR_riemann_test/case.py 🧪 Tests +69/-0

Create 2D Riemann test with entropy waves configuration

examples/2D_IGR_riemann_test/case.py


21. examples/3D_IGR_TaylorGreenVortex/case.py ✨ Enhancement +7/-6

Update Taylor Green Vortex parameters and enable FFT output

examples/3D_IGR_TaylorGreenVortex/case.py


22. examples/2D_IGR_isentropicvortex/README.md 📝 Documentation +1/-0

Add documentation for isentropic vortex test case

examples/2D_IGR_isentropicvortex/README.md


23. examples/2D_IGR_double_mach/README.md 📝 Documentation +3/-0

Add documentation for double mach reflection case

examples/2D_IGR_double_mach/README.md


24. examples/2D_IGR_riemann_test/README.md 📝 Documentation +1/-0

Add documentation for 2D Riemann test case

examples/2D_IGR_riemann_test/README.md


25. examples/3D_IGR_TaylorGreenVortex/README.md 📝 Documentation +5/-0

Add documentation for Taylor Green Vortex case

examples/3D_IGR_TaylorGreenVortex/README.md


26. examples/3D_IGR_33jet/README.md 📝 Documentation +1/-0

Add documentation for 33-jet test case

examples/3D_IGR_33jet/README.md


27. docs/documentation/case.md 📝 Documentation +1/-0

Document double_mach parameter in user guide

docs/documentation/case.md


28. tests/43126861/golden-metadata.txt Additional files +154/-0

...

tests/43126861/golden-metadata.txt


29. tests/43126861/golden.txt Additional files +8/-0

...

tests/43126861/golden.txt


30. tests/E49EF7B6/golden-metadata.txt Additional files +49/-45

...

tests/E49EF7B6/golden-metadata.txt


31. tests/E49EF7B6/golden.txt Additional files +8/-8

...

tests/E49EF7B6/golden.txt


32. tests/F532C641/golden-metadata.txt Additional files +154/-0

...

tests/F532C641/golden-metadata.txt


33. tests/F532C641/golden.txt Additional files +8/-0

...

tests/F532C641/golden.txt


Grey Divider

Qodo Logo

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Claude Code Review

Head SHA: 19bd979

Files changed:

  • 33
  • src/common/m_boundary_common.fpp
  • src/common/include/2dHardcodedIC.fpp
  • src/simulation/m_global_parameters.fpp
  • src/pre_process/m_global_parameters.fpp
  • src/post_process/m_global_parameters.fpp
  • src/simulation/m_start_up.fpp
  • toolchain/mfc/params/definitions.py
  • examples/2D_IGR_double_mach/case.py
  • examples/2D_IGR_isentropicvortex/case.py

Findings:

  • Missing #ifdef MFC_SIMULATION guard on advxb access in bc_y%beg double_mach branch (src/common/m_boundary_common.fpp): In the bc_y%end (top boundary) double_mach block, the if (.not. igr) branch that writes to q_prim_vf(advxb) is correctly wrapped with #ifdef MFC_SIMULATION. The equivalent if (.not. igr) branch in the bc_y%beg (bottom boundary) double_mach block is not wrapped (the guard was only placed around the if (igr) conversion block). Since m_boundary_common.fpp is shared across all three targets and advxb is a simulation-specific advection index, this asymmetric guard is a likely semantic error in non-simulation builds and mirrors the deliberate guard pattern used consistently in the top-boundary block.

  • README vs. case.py alf_factor discrepancy (examples/2D_IGR_double_mach/): The README states "alf_factor = 2" but the case file sets "alf_factor": 10.

  • double_mach placed in the wrong documentation table (docs/documentation/case.md): The entry is inserted into the post_process output flags table (alongside cf_wrt, fft_wrt, sim_data). double_mach is a simulation IC/BC control parameter, not a post_process output flag, and should appear in a different section.

  • Unused Python variables with Fortran-style d0 exponent notation (examples/2D_IGR_isentropicvortex/case.py): epsilon = "5d0" and alpha = "1d0" are defined at the top of the file but never used in the JSON dict (the IC is driven entirely by hcid = 283). Beyond being dead code, the d0 Fortran exponent syntax is explicitly forbidden per project conventions; if these strings were ever passed as analytic IC expressions they would cause a build failure.

@qodo-code-review
Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Looking for bugs?

Check back in a few minutes. An AI review agent is analyzing this pull request.

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

This pull request introduces support for a Double Mach reflection test case across the codebase. It adds three new numerical example configurations (2D Isentropic Vortex, 2D Riemann test, and 2D/3D Double Mach) with corresponding documentation, case files, and README entries. The implementation spans multiple modules: hardcoded initial-condition cases for the three test setups, a new boundary-condition path with shock position tracking and smoothed transitions, global parameter declarations for Double Mach settings, MPI broadcast extensions, and toolchain parameter registration. Supporting changes include helper subroutines for symmetric 2D blending, GPU-guarded acoustic source updates, and test golden output files. The Taylor Green Vortex example was also updated with modified resolution, Reynolds number, and output configuration.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'IGR User Guide test cases' clearly summarizes the main change: adding test case files and documentation for IGR User Guide examples.
Description check ✅ Passed The description comprehensively covers the PR scope, listing all five cases, explaining changes to each, documenting the bug fix, and selecting appropriate change types and testing/documentation checkboxes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (4)
examples/3D_IGR_33jet/README.md (1)

1-1: Consider expanding the README with usage and setup information.

While the header provides helpful context about the case's origin and references, users would benefit from additional sections typical of example READMEs:

  • Brief description of the physical setup (geometry, flow conditions, physics)
  • Key parameters and their significance
  • Instructions to run the case
  • Expected outputs or results
  • Links to papers or detailed documentation (e.g., the ACM Gordon Bell submission, IGR User Guide)

This would improve the onboarding experience for users trying to understand and reproduce this test case.

examples/2D_IGR_isentropicvortex/case.py (2)

5-7: Unused parameters defined.

The variables epsilon, alpha, and gamma are defined but never referenced in the configuration dictionary. Consider removing them to avoid confusion, or if they're intended for the hardcoded IC (hcid=283), add a comment clarifying their purpose.

🧹 Suggested cleanup
-# Parameters
-epsilon = "5d0"
-alpha = "1d0"
-gamma = "1.4"
-
-
 # Numerical setup

17-17: Clarify time-step calculation intent.

The expression int(20 / (0.1 * mydt)) is equivalent to int(200 / mydt). If the intent is a simulation time of 200 units, consider writing it more explicitly for clarity.

📝 Suggested clarification
-Nt = int(20 / (0.1 * mydt))
+# Total simulation time: 200 time units
+Nt = int(200 / mydt)
tests/F532C641/golden-metadata.txt (1)

5-7: Consider regenerating this golden from a clean tree.

Line 7 records the baseline as dirty, which makes this metadata harder to tie back to a single source snapshot. Re-running ./mfc.sh test -o F532C641 --generate after the code is committed would make future golden diffs easier to audit.

Based on learnings, golden files are generated with ./mfc.sh test --generate and stored as binary snapshots in tests/<hash>/; do not manually edit golden files.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 910509f2-eea3-4092-868b-614243610edf

📥 Commits

Reviewing files that changed from the base of the PR and between 336487c and 18f6d38.

📒 Files selected for processing (33)
  • docs/documentation/case.md
  • examples/2D_IGR_double_mach/README.md
  • examples/2D_IGR_double_mach/case.py
  • examples/2D_IGR_isentropicvortex/README.md
  • examples/2D_IGR_isentropicvortex/case.py
  • examples/2D_IGR_riemann_test/README.md
  • examples/2D_IGR_riemann_test/case.py
  • examples/3D_IGR_33jet/README.md
  • examples/3D_IGR_TaylorGreenVortex/README.md
  • examples/3D_IGR_TaylorGreenVortex/case.py
  • src/common/include/2dHardcodedIC.fpp
  • src/common/m_boundary_common.fpp
  • src/post_process/m_global_parameters.fpp
  • src/post_process/m_mpi_proxy.fpp
  • src/post_process/m_start_up.fpp
  • src/pre_process/m_global_parameters.fpp
  • src/pre_process/m_icpp_patches.fpp
  • src/pre_process/m_mpi_proxy.fpp
  • src/pre_process/m_start_up.fpp
  • src/simulation/m_acoustic_src.fpp
  • src/simulation/m_global_parameters.fpp
  • src/simulation/m_mpi_proxy.fpp
  • src/simulation/m_start_up.fpp
  • tests/43126861/golden-metadata.txt
  • tests/43126861/golden.txt
  • tests/E49EF7B6/golden-metadata.txt
  • tests/E49EF7B6/golden.txt
  • tests/F532C641/golden-metadata.txt
  • tests/F532C641/golden.txt
  • toolchain/mfc/params/definitions.py
  • toolchain/mfc/params/descriptions.py
  • toolchain/mfc/params/namelist_parser.py
  • toolchain/mfc/test/cases.py

@anandrdbz anandrdbz marked this pull request as ready for review April 1, 2026 20:21
@sbryngelson sbryngelson marked this pull request as draft April 1, 2026 21:15
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 81.73077% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.50%. Comparing base (336487c) to head (19bd979).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/common/m_boundary_common.fpp 65.11% 15 Missing ⚠️
src/post_process/m_start_up.fpp 0.00% 1 Missing and 1 partial ⚠️
src/pre_process/m_global_parameters.fpp 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1346      +/-   ##
==========================================
+ Coverage   64.67%   65.50%   +0.82%     
==========================================
  Files          70       70              
  Lines       18249    18349     +100     
  Branches     1504     1508       +4     
==========================================
+ Hits        11803    12019     +216     
+ Misses       5491     5363     -128     
- Partials      955      967      +12     

☔ View full report in Codecov by Sentry.
📢 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.

sbryngelson added a commit to sbryngelson/figr that referenced this pull request Apr 4, 2026
- Add double_mach parameter with shock variables (xshock, cf, Mach,
  pshock, rhoshock, velshock, rho0_dm, p0_dm, u0_dm, v0_dm, xr_dm,
  theta_dm, gam_dm) across all 3 targets
- Add 3 new hardcoded IC cases in 2dHardcodedIC.fpp:
  283 (IGR isentropic vortex), 284 (2D IGR Riemann test),
  285 (2D IGR double Mach reflection)
- Add symm_2d_blending/blend subroutines in m_icpp_patches.fpp
- Add double_mach boundary conditions in m_boundary_common.fpp
  (shock tracking, ghost cell overrides, reflective wall)
- Add 3 new example cases: 2D_IGR_double_mach, 2D_IGR_isentropicvortex,
  2D_IGR_riemann_test
- Update 3D_IGR_TaylorGreenVortex example (N=127, Re=10000, V0=1.25*C0)
- All 8 existing tests pass
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