Extrusion v3#1349
Conversation
Review Summary by QodoAdd premixed flame IC cases and refactor extrusion workflow with configurable paths
WalkthroughsDescription• Add two new hardcoded IC cases (271, 272) for premixed flame simulations - Case 271: Premixed flame vortex interaction with dual counter-rotating vortices - Case 272: Premixed flame instability with sinusoidal front perturbation • Refactor IC extrusion workflow to use configurable files_dir and file_extension parameters - Replace hardcoded path and filename pattern with user-configurable parameters - Improve MPI communication for new parameters via broadcast • Add three reference example cases with complete configuration files - 1D flamelet case with San Diego mechanism - 2D premixed flame vortex interaction case - 2D premixed flame Landau instability case • Update parameter definitions and test suite for new IC extrusion examples Diagramflowchart LR
A["Hardcoded IC Cases<br/>271, 272"] -->|"Vortex & Instability<br/>Perturbations"| B["2D Premixed<br/>Flame Simulations"]
C["Configurable<br/>files_dir & file_extension"] -->|"Replace hardcoded<br/>init_dir"| D["Flexible IC<br/>Extrusion"]
E["Reference Examples<br/>1D, 2D cases"] -->|"Complete setup<br/>with case.py"| F["User-friendly<br/>Workflow"]
D --> B
F --> B
File Changes1. src/common/include/2dHardcodedIC.fpp
|
Code Review by Qodo
1.
|
📝 WalkthroughWalkthroughThis pull request introduces a new 1D flamelet example case and updates related documentation. A 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.gitignore (1)
57-57: Redundant ignore pattern (no functional change).Line 57 is already covered by
examples/**/*.dat(Line 64), so this new rule is a no-op. Consider removing it to keep ignore rules minimal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 96117184-e389-41b7-b7bb-97731b0c2155
⛔ Files ignored due to path filters (42)
examples/1D_flamelet/IC/prim.1.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.10.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.11.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.12.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.13.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.14.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.2.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.3.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.4.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.5.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.6.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.7.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.8.00.000000.datis excluded by!**/*.datexamples/1D_flamelet/IC/prim.9.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.1.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.10.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.11.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.12.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.13.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.14.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.2.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.3.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.4.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.5.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.6.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.7.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.8.00.000000.datis excluded by!**/*.datexamples/2D_premixed_flame_vortex/IC/prim.9.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.1.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.10.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.11.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.12.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.13.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.14.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.2.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.3.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.4.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.5.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.6.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.7.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.8.00.000000.datis excluded by!**/*.datexamples/2D_premixed_landau_insta/IC/prim.9.00.000000.datis excluded by!**/*.dat
📒 Files selected for processing (17)
.gitignoredocs/documentation/case.mdexamples/1D_flamelet/case.pyexamples/1D_flamelet/sandiego.yamlexamples/2D_premixed_flame_vortex/case.pyexamples/2D_premixed_landau_insta/case.pysrc/common/include/2dHardcodedIC.fppsrc/common/include/ExtrusionHardcodedIC.fppsrc/pre_process/m_global_parameters.fppsrc/pre_process/m_mpi_proxy.fppsrc/pre_process/m_start_up.fpptests/0D1E22F3/golden-metadata.txttests/0D1E22F3/golden.txttoolchain/mfc/params/definitions.pytoolchain/mfc/params/descriptions.pytoolchain/mfc/params/namelist_parser.pytoolchain/mfc/test/cases.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1349 +/- ##
==========================================
- Coverage 64.75% 63.68% -1.08%
==========================================
Files 71 71
Lines 18721 18861 +140
Branches 1551 1555 +4
==========================================
- Hits 12123 12011 -112
- Misses 5640 5788 +148
- Partials 958 1062 +104 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code Review by Qodo
|
| #:enddef | ||
|
|
||
| #:def HardcodedReadValues() | ||
| if (.not. files_loaded) then | ||
| max_files = merge(sys_size, sys_size - 1, num_dims == 1) | ||
| do f = 1, max_files | ||
| write (file_num_str, '(I0)') f | ||
| fileNames(f) = trim(init_dir) // "prim." // trim(file_num_str) // ".00." // zeros_default // ".dat" | ||
| fileNames(f) = trim(files_dir) // "/" // "prim." // trim(file_num_str) // ".00." // trim(file_extension) // ".dat" |
There was a problem hiding this comment.
1. files_dir undefined in simulation 📘 Rule violation ≡ Correctness
ExtrusionHardcodedIC.fpp now references files_dir and file_extension, but the simulation-side m_global_parameters/namelist/MPI broadcast do not define or distribute these parameters. This can break simulation compilation or cause rank-to-rank mismatches at runtime when using extrusion-based ICs.
Agent Prompt
## Issue description
The new parameters `files_dir` and `file_extension` are used by code included in the simulation build (`ExtrusionHardcodedIC.fpp`), but they are only declared/bound/broadcast in `src/pre_process`. Simulation must also declare them in `m_global_parameters`, read them from `simulation.inp` via the `user_inputs` namelist, and broadcast them to all ranks.
## Issue Context
`src/simulation/m_ib_patches.fpp` includes `ExtrusionHardcodedIC.fpp`, which now constructs file names using `files_dir` and `file_extension`.
## Fix Focus Areas
- src/simulation/m_global_parameters.fpp[24-35]
- src/simulation/m_start_up.fpp[84-114]
- src/simulation/m_mpi_proxy.fpp[58-70]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Code Review by Qodo
|
Claude Code ReviewPR #1349 — Extrusion v3 Critical Issues1. 2D index calculation is constant — all cells read the same data row
idx = i + 1 + global_offset_x - index_xsimplifies to 2. The offset is calculated inside 3. logical :: files_loaded = .false.Fortran 2008 §5.2.4: a local variable with an initializer implicitly has the Important Issues4. Asymmetric deallocation of
5.
6. Both construct 7. Both 2D example case files reference Suggestions
Strengths
The 2D extruded IC (hcid 270/271/272) is currently broken due to issue #1: every cell gets the same row of data, producing a uniform field. Issues #2 and #3 compound this. These must be fixed before merge. |
|
Persistent review updated to latest commit 4e5a51f |
1 similar comment
|
Persistent review updated to latest commit 4e5a51f |
Code reviewFound 4 issues:
MFC/src/common/include/ExtrusionHardcodedIC.fpp Lines 48 to 51 in 4e5a51f
MFC/src/common/include/ExtrusionHardcodedIC.fpp Lines 44 to 47 in 4e5a51f
MFC/src/common/include/ExtrusionHardcodedIC.fpp Lines 100 to 103 in 4e5a51f
MFC/examples/2D_premixed_flame_vortex/case.py Lines 7 to 14 in 4e5a51f 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…d unused Cantera imports
…acation to HardcodedDeallocation
…orm compatibility
CI failure:
|
The hardcoded array had O/O2 swapped (positions 3-4), H2O/HO2/H2O2 in wrong order (positions 6-8), and Ar/N2 swapped (positions 9-10). Corrected to match sandiego.yaml species order: [H2, H, O2, O, OH, HO2, H2O2, H2O, N2, Ar]. Also corrected Ar mass from 39.95 to 39.948 and added _wp precision suffixes.
This reverts commit 0210586.
Description
Summarize your changes and the motivation behind them.
IC Extrusion: The workflow for extending Initial Conditions to higher dimensions has been simplified. The updated methodology is now more robust and user-friendly.
Documentation & Examples: To assist users with this new methodology, three new reference examples have been uploaded to the repository (one 1D case and two 2D cases)
Fixes #(issue)
Type of change
-[x] A current methodology being more user-friendly
Testing
How did you test your changes?
Flame_Vortex_Interaction.mp4
-[x] 3rd Test, 2D Premixed Flame with perturbed flame front
Flame_Insta.mp4
Checklist
See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)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)claude-full-review— Claude full review via label