Skip to content

Extrusion v3#1349

Draft
DimAdam-01 wants to merge 12 commits intoMFlowCode:masterfrom
DimAdam-01:ExtrusionV3
Draft

Extrusion v3#1349
DimAdam-01 wants to merge 12 commits intoMFlowCode:masterfrom
DimAdam-01:ExtrusionV3

Conversation

@DimAdam-01
Copy link
Copy Markdown
Contributor

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?

  • 1st Test, 1D Flamelet.
  • 2nd Test, 2D Premixed Flame Vortex interaction
Flame_Vortex_Interaction.mp4

-[x] 3rd Test, 2D Premixed Flame with perturbed flame front

Flame_Insta.mp4

Checklist

  • 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 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

@DimAdam-01 DimAdam-01 requested a review from sbryngelson as a code owner April 1, 2026 18:25
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add premixed flame IC cases and refactor extrusion workflow with configurable paths

✨ Enhancement

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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
Loading

Grey Divider

File Changes

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

Add new premixed flame IC cases 271 and 272

src/common/include/2dHardcodedIC.fpp


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

Refactor extrusion to use configurable file parameters

src/common/include/ExtrusionHardcodedIC.fpp


3. src/pre_process/m_global_parameters.fpp ✨ Enhancement +0/-0

Add files_dir and file_extension global parameters

src/pre_process/m_global_parameters.fpp


View more (13)
4. src/pre_process/m_start_up.fpp ✨ Enhancement +0/-0

Include new parameters in startup configuration reading

src/pre_process/m_start_up.fpp


5. src/pre_process/m_mpi_proxy.fpp ✨ Enhancement +0/-0

Broadcast new file parameters across MPI processes

src/pre_process/m_mpi_proxy.fpp


6. examples/2D_premixed_flame_vortex/case.py 📝 Documentation +93/-0

Add complete 2D premixed flame vortex case configuration

examples/2D_premixed_flame_vortex/case.py


7. examples/2D_premixed_landau_insta/case.py 📝 Documentation +0/-0

Add complete 2D premixed flame Landau instability case

examples/2D_premixed_landau_insta/case.py


8. examples/1D_flamelet/case.py 📝 Documentation +73/-0

Add complete 1D flamelet case configuration

examples/1D_flamelet/case.py


9. examples/1D_flamelet/sandiego.yaml 📝 Documentation +303/-0

Add San Diego chemical mechanism for flamelet case

examples/1D_flamelet/sandiego.yaml


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

Register new example cases in test suite

toolchain/mfc/test/cases.py


11. toolchain/mfc/params/definitions.py ✨ Enhancement +0/-0

Define files_dir and file_extension parameters

toolchain/mfc/params/definitions.py


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

Add parameter descriptions for file configuration

toolchain/mfc/params/descriptions.py


13. toolchain/mfc/params/namelist_parser.py ✨ Enhancement +0/-0

Add new parameters to namelist parser

toolchain/mfc/params/namelist_parser.py


14. tests/0D1E22F3/golden-metadata.txt 🧪 Tests +0/-0

Update test metadata with build configuration

tests/0D1E22F3/golden-metadata.txt


15. docs/documentation/case.md 📝 Documentation +2/-2

Update documentation for IC extrusion workflow

docs/documentation/case.md


16. tests/0D1E22F3/golden.txt Additional files +0/-0

...

tests/0D1E22F3/golden.txt


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 1, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. files_extension parameter typo 📘 Rule violation ≡ Correctness
Description
The toolchain fallback namelist parameter list (and docs) use files_extension, but the Fortran
namelist and parameter registry use file_extension. This breaks consistent parameter registration
and can cause cases using file_extension to be rejected or undocumented.
Code

toolchain/mfc/params/namelist_parser.py[R45-46]

+        "files_dir",
+        "files_extension",
Evidence
PR Compliance ID 6 requires new parameters to be consistently registered/wired across the toolchain
and Fortran namelist. The PR registers file_extension in the toolchain and Fortran namelist, but
introduces the mismatched name files_extension in the toolchain fallback parser and documentation.

CLAUDE.md
toolchain/mfc/params/namelist_parser.py[45-47]
src/pre_process/m_start_up.fpp[84-88]
toolchain/mfc/params/definitions.py[1048-1051]
docs/documentation/case.md[259-266]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The parameter name is inconsistent: `files_extension` is used in the toolchain fallback namelist parameter list (and in docs), while the actual registered/Fortran parameter name is `file_extension`.

## Issue Context
This inconsistency can cause parameter parsing/validation failures (especially when the fallback parameter set is used) and violates the requirement that new parameters be registered consistently across sources-of-truth.

## Fix Focus Areas
- toolchain/mfc/params/namelist_parser.py[45-47]
- docs/documentation/case.md[259-266]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Hardcoded velocity indices 🐞 Bug ≡ Correctness
Description
Hardcoded IC case (271) writes vortex velocities to q_prim_vf(2) and q_prim_vf(3) instead of
using the momentum index bounds (momxb/momxe). This can write into the wrong primitive variables
whenever the state-vector layout changes (e.g., additional equations/fields), corrupting the
initialized state.
Code

src/common/include/2dHardcodedIC.fpp[R275-293]

+    case (271)  ! Premixed Flame Vortices interctiom
+        @: HardcodedReadValues()
+        x1c = 0.0027_wp
+        y1c = 0.005_wp
+        x2c = 0.0027_wp
+        y2c = 0.003_wp
+        r1c = (x_cc(i) - x1c)**(2.0_wp) + (y_cc(j) - y1c)**(2.0_wp)
+        r2c = (x_cc(i) - x2c)**(2.0_wp) + (y_cc(j) - y2c)**(2.0_wp)
+        rvortex = 0.0005_wp
+        cvortex = 6000.0_wp
+
+        u1c = -cvortex*((y_cc(j) - y1c))*exp(-r1c/(2.0_wp*rvortex**2.0_wp))
+        v1c = cvortex*((x_cc(i) - x1c))*exp(-r1c/(2.0_wp*rvortex**2.0_wp))
+
+        u2c = cvortex*((y_cc(j) - y2c))*exp(-r2c/(2.0_wp*rvortex**2.0_wp))
+        v2c = -cvortex*((x_cc(i) - x2c))*exp(-r2c/(2.0_wp*rvortex**2.0_wp))
+        q_prim_vf(2)%sf(i, j, 0) = q_prim_vf(2)%sf(i, j, 0) + u1c + u2c
+        q_prim_vf(3)%sf(i, j, 0) = v1c + v2c
+    case (272)  ! Prexmied flame instability
Evidence
Elsewhere in the same hardcoded IC file, momentum components are referenced via momxb/momxe (not
numeric literals). Additionally, momxb/momxe are derived from mom_idx%beg/%end in global
parameters, so they are not guaranteed to be fixed to 2/3 across configurations.

src/common/include/2dHardcodedIC.fpp[44-56]
src/common/include/2dHardcodedIC.fpp[275-292]
src/pre_process/m_global_parameters.fpp[201-211]
src/pre_process/m_global_parameters.fpp[805-826]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Case (271) assigns velocity perturbations using fixed indices `q_prim_vf(2)` and `q_prim_vf(3)`. These indices are not stable across different equation sets and can point to the wrong fields.

## Issue Context
- Other hardcoded IC cases use `momxb`, `momxe`, or `momxb+1`.
- `momxb/momxe` are derived from `mom_idx` bounds and can shift with configuration.

## Fix Focus Areas
- src/common/include/2dHardcodedIC.fpp[275-292]
- src/pre_process/m_global_parameters.fpp[805-826]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

3. Extrusion docs typos 🐞 Bug ⚙ Maintainability
Description
The updated documentation introduces a typo ("etup") and an inconsistent filename-token
(files_extension vs file_extension), which can mislead users configuring extrusion. This makes
the new workflow harder to follow and increases misconfiguration risk.
Code

docs/documentation/case.md[R265-266]

+etup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/1D_flamelet/IC`, and their format is `prim.XX.YY.files_extension.dat`.
+Implementation: All variables and file handling are managed in the `case.py` file of the simulation.
Evidence
The docs now reference file_extension but also show a filename format containing
files_extension, and the "Setup" label is misspelled; meanwhile the toolchain/Fortran parameter is
file_extension (singular).

docs/documentation/case.md[262-267]
toolchain/mfc/params/definitions.py[1048-1051]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Docs for extrusion contain a typo and inconsistent parameter/token naming (`files_extension` vs `file_extension`).

## Issue Context
Users will likely copy/paste the documented pattern/parameter names into their cases.

## Fix Focus Areas
- docs/documentation/case.md[262-267]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sbryngelson sbryngelson marked this pull request as draft April 1, 2026 18:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a new 1D flamelet example case and updates related documentation. A .gitignore rule is added to exclude example data files matching the pattern examples/**/IC/*.dat. Documentation is updated to reflect a revised workflow for dimensional extrusion patches using files_dir and file_extension parameters. Two new files are added: a Python script that generates a JSON simulation configuration using Cantera, and a Cantera mechanism file defining a hydrogen/oxygen/nitrogen reacting mixture with thermodynamic and transport properties.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Extrusion v3' is vague and generic, offering minimal insight into the actual changes beyond suggesting a version iteration. Replace with a more descriptive title that highlights the main improvement, such as 'Simplify Initial Condition extrusion workflow' or 'Improve IC extrusion user experience with new examples'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the main changes, includes testing details with attachments, and follows most template sections; however, the 'Type of change' section is unclear and uses non-standard formatting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7da6212 and a39c5ef.

⛔ Files ignored due to path filters (42)
  • examples/1D_flamelet/IC/prim.1.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.10.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.11.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.12.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.13.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.14.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.2.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.3.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.4.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.5.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.6.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.7.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.8.00.000000.dat is excluded by !**/*.dat
  • examples/1D_flamelet/IC/prim.9.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.1.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.10.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.11.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.12.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.13.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.14.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.2.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.3.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.4.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.5.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.6.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.7.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.8.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_flame_vortex/IC/prim.9.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.1.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.10.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.11.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.12.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.13.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.14.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.2.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.3.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.4.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.5.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.6.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.7.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.8.00.000000.dat is excluded by !**/*.dat
  • examples/2D_premixed_landau_insta/IC/prim.9.00.000000.dat is excluded by !**/*.dat
📒 Files selected for processing (17)
  • .gitignore
  • docs/documentation/case.md
  • examples/1D_flamelet/case.py
  • examples/1D_flamelet/sandiego.yaml
  • examples/2D_premixed_flame_vortex/case.py
  • examples/2D_premixed_landau_insta/case.py
  • src/common/include/2dHardcodedIC.fpp
  • src/common/include/ExtrusionHardcodedIC.fpp
  • src/pre_process/m_global_parameters.fpp
  • src/pre_process/m_mpi_proxy.fpp
  • src/pre_process/m_start_up.fpp
  • tests/0D1E22F3/golden-metadata.txt
  • tests/0D1E22F3/golden.txt
  • toolchain/mfc/params/definitions.py
  • toolchain/mfc/params/descriptions.py
  • toolchain/mfc/params/namelist_parser.py
  • toolchain/mfc/test/cases.py

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.90%. Comparing base (afc724e) to head (a39c5ef).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1349       +/-   ##
===========================================
+ Coverage   47.42%   63.90%   +16.48%     
===========================================
  Files          70       70               
  Lines       19202    18336      -866     
  Branches     1635     1504      -131     
===========================================
+ Hits         9106    11718     +2612     
+ Misses       9229     5583     -3646     
- Partials      867     1035      +168     

☔ 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.

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