Skip to content

Conversation

@JRChreim
Copy link
Contributor

@JRChreim JRChreim commented Dec 18, 2025

User description

Description

This PR extends the m_phase_change module to include the activation of pT- and pTg-relaxation schemes to the 5-equation model. It updates m_checker_common to include new constraints and includes examples for the new feature. New tests are also added

Type of change

  • New feature (non-breaking change which adds functionality)

Scope

  • This PR comprises a set of related changes with a common goal

If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

  • Expansion Tube, 5- and 6-equation models, pT- and pTg-relaxations, 3 fluids (liquid, vapor, air), showing the similarity for the results (pressure and vapor partial density plots)

pT:

pT-ET-5x6Eq-AlphaRho2.mp4
pT-ET-5x6Eq-p.mp4

pTg:

pTg-ET-5x6Eq-AlphaRho2.mp4
pTg-ET-5x6Eq-p.mp4
  • Shock Tube, 5- and 6-equation models, pT- and pTg-relaxations, 3 fluids (liquid, vapor, air), showing the similarity for the results (pressure and vapor partial density plots)

pT:

pT-ST-5x6Eq-AlphaRho2.mp4
pT-ST-5x6Eq-p.mp4

pTg:

pTg-ST-5x6Eq-AlphaRho2.mp4
pTg-ST-5x6Eq-p.mp4

Test Configuration:

  • What computers and compilers did you use to test this:

Checklist

  • I have added comments for the new code
  • I added Doxygen docstrings to the new code
  • I have made corresponding changes to the documentation (docs/)
  • I have added regression tests to the test suite so that people can verify in the future that the feature is behaving as expected
  • I have added example cases in examples/ that demonstrate my new feature performing as expected.
    They run to completion and demonstrate "interesting physics"
  • I ran ./mfc.sh format before committing my code
  • New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
  • This PR does not introduce any repeated code (it follows the DRY principle)
  • I cannot think of a way to condense this code and reduce any introduced additional line count

If your code changes any code source files (anything in src/simulation)

To make sure the code is performing as expected on GPU devices, I have:

  • Checked that the code compiles using NVHPC compilers
  • Checked that the code compiles using CRAY compilers
  • Ran the code on either V100, A100, or H100 GPUs and ensured the new feature performed as expected (the GPU results match the CPU results)
  • Ran the code on MI200+ GPUs and ensure the new features performed as expected (the GPU results match the CPU results)
  • Enclosed the new feature via nvtx ranges so that they can be identified in profiles
  • Ran a Nsight Systems profile using ./mfc.sh run XXXX --gpu -t simulation --nsys, and have attached the output file (.nsys-rep) and plain text results to this PR
  • Ran a Rocprof Systems profile using ./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace, and have attached the output file and plain text results to this PR.
  • Ran my code using various numbers of different GPUs (1, 2, and 8, for example) in parallel and made sure that the results scale similarly to what happens if you run without the new code/feature

PR Type

Enhancement, Tests


Description

  • Extended phase change module to support 5-equation model with pT and pTg relaxation schemes, previously only available for 6-equation model

  • Fixed conditional internal energy assignment in m_phase_change.fpp to prevent calculation for 5-equation model which doesn't track individual fluid energies

  • Updated phase change validation in case_validator.py to allow both 5-equation (model_eqns == 2) and 6-equation (model_eqns == 3) models with appropriate relaxation constraints

  • Extended test suite to generate tests for both 5 and 6-equation models by iterating over model_eqns values

  • Added comprehensive example cases demonstrating phase change physics:

    • 1D expansion tube examples for both 5 and 6-equation models
    • 2D and 3D bubble dynamics examples with 6-equation model
    • 2D shock tube example with phase change using 6-equation model
  • All examples configured with 3-fluid systems (liquid water, water vapor, air) and relaxation parameters for pressure and temperature equilibration

  • Validated through expansion tube and shock tube simulations showing consistent results between 5 and 6-equation models


Diagram Walkthrough

flowchart LR
  A["5 & 6-Equation Models"] --> B["Phase Change Module"]
  B --> C["pT Relaxation"]
  B --> D["pTg Relaxation"]
  E["Case Validator"] --> F["Model Constraints"]
  F --> C
  F --> D
  G["Test Suite"] --> H["5-Equation Tests"]
  G --> I["6-Equation Tests"]
  J["Example Cases"] --> K["1D Expansion Tube"]
  J --> L["2D/3D Bubble Dynamics"]
  J --> M["2D Shock Tube"]
Loading

File Walkthrough

Relevant files
Bug fix
1 files
m_phase_change.fpp
Conditional internal energy assignment for phase change models

src/common/m_phase_change.fpp

  • Added conditional check for model_eqns == 3 before assigning internal
    energy q_cons_vf(i + intxb - 1)%sf
  • Prevents internal energy calculation for 5-equation model (model_eqns
    == 2) which doesn't track individual fluid energies
+3/-1     
Tests
19 files
cases.py
Extended phase change tests for 5 and 6-equation models   

toolchain/mfc/test/cases.py

  • Extended phase change test loop to iterate over both model_eqns values
    2 and 3
  • Wrapped existing test configuration in new model_eqns loop to generate
    tests for both 5-equation and 6-equation models
  • Updated test case naming to include model_eqns parameter in
    description
  • Adjusted stack pop operations to account for additional nesting level
+57/-56 
golden-metadata.txt
Test metadata for phase change validation                               

tests/8D0E7E1D/golden-metadata.txt

  • New test metadata file generated for phase change test case
  • Contains system configuration, compiler information, and build details
  • Timestamp: 2025-11-30 22:06:45
+190/-0 
golden-metadata.txt
Test metadata for phase change validation                               

tests/02BD9B5E/golden-metadata.txt

  • New test metadata file generated for phase change test case
  • Contains system configuration, compiler information, and build details
  • Timestamp: 2025-11-30 22:07:45
+190/-0 
golden-metadata.txt
Test metadata for phase change validation                               

tests/AAE5C27B/golden-metadata.txt

  • New test metadata file generated for phase change test case
  • Contains system configuration, compiler information, and build details
  • Timestamp: 2025-11-30 22:08:43
+190/-0 
golden-metadata.txt
Test metadata for phase change validation                               

tests/623B6C30/golden-metadata.txt

  • New test metadata file generated for phase change test case
  • Contains system configuration, compiler information, and build details
  • Timestamp: 2025-11-30 22:06:40
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/8D6E051E/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/B2EFB9F7/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/76C663B7/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/D21F4F38/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/E0256CBF/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for post_process, pre_process, and
    simulation components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/2486442D/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for post_process, pre_process, simulation,
    and syscheck components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/60EE4401/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for post_process, pre_process, simulation,
    and syscheck components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/723DDBCF/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for post_process, pre_process, simulation,
    and syscheck components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/C46769FD/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, post_process, pre_process,
    and simulation components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/E6DBCBD9/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/F4D00494/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/344FAA70/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for post_process, pre_process, simulation,
    and syscheck components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata file for 5-equation model relaxation             

tests/413DD555/golden-metadata.txt

  • Added new test metadata file documenting system configuration and
    build environment
  • Records CMake configuration for syscheck, simulation, post_process,
    and pre_process components
  • Captures compiler information (GNU v13.3.0), MPI settings, and CPU
    details
  • Includes build timestamp and git commit information for test
    reproducibility
+190/-0 
golden-metadata.txt
Test metadata documentation for 5-equation model relaxation

tests/D8136392/golden-metadata.txt

  • New test metadata file created documenting build configuration and
    system information
  • Records CMake configuration details for syscheck, simulation,
    post_process, and pre_process components
  • Captures compiler information (GNU C and Fortran v13.3.0) and build
    flags (MPI enabled, OpenACC/OpenMP disabled)
  • Documents CPU specifications and system environment for test
    reproducibility
+190/-0 
Documentation
6 files
casefile.py
2D phase change bubble example with 6-equation model         

examples/2D_phasechange_bubble_6Eqn/casefile.py

  • New example case file for 2D phase change bubble simulation using
    6-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with
    cylindrical coordinates
  • Sets up bubble dynamics with high-pressure background and low-pressure
    vapor bubble
  • Includes relaxation parameters for pressure and temperature
    equilibration
+296/-0 
case.py
3D phase change bubble example with 6-equation model         

examples/3D_phasechange_bubble_6Eqn/case.py

  • New example case file for 3D phase change bubble simulation using
    6-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with
    Cartesian coordinates
  • Sets up bubble dynamics with stretched mesh refinement around bubble
    center
  • Includes relaxation parameters for pressure and temperature
    equilibration
+296/-0 
case.py
2D phase change bubble example with 6-equation model         

examples/2D_phasechange_bubble_6Eqn/case.py

  • New example case file for 2D phase change bubble simulation using
    6-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with
    Cartesian coordinates
  • Sets up bubble dynamics with stretched mesh refinement around bubble
    center
  • Includes relaxation parameters for pressure and temperature
    equilibration
+282/-0 
case.py
2D shock tube phase change example with 6-equation model 

examples/2D_shocktube_phasechange_6Eqn/case.py

  • New example case file for 2D shock tube with phase change using
    6-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with three
    patches
  • Sets up shock tube problem with background, shocked state, and water
    regions
  • Includes relaxation parameters for pressure and temperature
    equilibration
+267/-0 
case.py
1D expansion tube phase change example with 5-equation model

examples/1D_exp_tube_phasechange_5Eqn/case.py

  • New example case file for 1D expansion tube with phase change using
    5-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with two
    patches
  • Sets up expansion tube problem with opposing velocity patches
  • Uses model_eqns == 2 for 5-equation formulation with relaxation
+193/-0 
case.py
1D expansion tube phase change example with 6-equation model

examples/1D_exp_tube_phasechange_6Eqn/case.py

  • New example case file for 1D expansion tube with phase change using
    6-equation model
  • Configures 3-fluid system (liquid water, water vapor, air) with two
    patches
  • Sets up expansion tube problem with opposing velocity patches
  • Uses model_eqns == 3 for 6-equation formulation with relaxation
+193/-0 
Enhancement
1 files
case_validator.py
Phase change validation for 5 and 6-equation models           

toolchain/mfc/case_validator.py

  • Updated phase change validation to allow both 5-equation (model_eqns
    == 2) and 6-equation (model_eqns == 3) models
  • 5-equation model restricted to relax_model 5 or 6 (pT and pTg
    relaxation)
  • 6-equation model allows relax_model 1, 4, 5, or 6
  • Replaced single constraint with comprehensive logical condition
    covering all valid combinations
+2/-4     
Additional files
45 files
case.py [link]   
casefile.py [link]   
case.py [link]   
case.py [link]   
golden.txt +48/-24 
golden-metadata.txt +0/-182 
golden-metadata.txt +0/-189 
golden.txt +0/-20   
golden.txt +20/-0   
golden-metadata.txt +0/-156 
golden.txt +0/-24   
golden.txt +11/-11 
golden.txt +64/-0   
golden.txt +16/-0   
golden-metadata.txt +0/-150 
golden.txt +0/-26   
golden.txt +28/-0   
golden-metadata.txt +0/-183 
golden.txt +0/-506 
golden-metadata.txt +0/-182 
golden.txt +13/-13 
golden-metadata.txt +0/-182 
golden.txt +48/-0   
golden-metadata.txt +0/-182 
golden-metadata.txt +0/-185 
golden.txt +0/-24   
golden-metadata.txt +0/-182 
golden.txt +36/-0   
golden.txt +44/-22 
golden-metadata.txt +0/-182 
golden-metadata.txt +0/-182 
golden.txt +36/-0   
golden.txt +48/-0   
golden-metadata.txt +0/-150 
golden.txt +0/-24   
golden.txt +36/-18 
golden.txt +32/-16 
golden-metadata.txt +0/-182 
golden.txt +64/-0   
golden-metadata.txt +0/-182 
golden.txt +48/-24 
golden.txt +32/-16 
golden.txt +44/-22 
golden-metadata.txt +0/-189 
golden.txt +0/-32   

Summary by CodeRabbit

  • New Features

    • Example phase‑change cases now accept a CLI option to choose the equation model at runtime.
  • Bug Fixes

    • Per‑fluid internal energy assignment is now only applied for the appropriate equation model.
    • Phase‑change validation consolidated and its error message clarified.
  • Tests

    • Phase‑change test matrix expanded; numerous golden‑metadata test fixtures added and removed.

✏️ Tip: You can customize this high-level summary in your review settings.

Complete version of the SG EoS
This PR comprises changes to m_phase_change module to include the activation of pT- and pTg-relaxation schemes also for the 5-equation model. It also updates m_checker_common to include the new constraints for the phase change, and includes examples  for the new feature
@codeant-ai
Copy link

codeant-ai bot commented Dec 18, 2025

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Made per‑fluid internal‑energy assignment conditional on model_eqns == 3; consolidated phase‑change validation rules; test generator now emits cases for both model_eqns values; example cases accept --model_eqns at runtime; many autogenerated golden‑metadata files added/removed and one golden data list trimmed.

Changes

Cohort / File(s) Summary
Phase-Change Core Logic
src/common/m_phase_change.fpp
Guard the per‑fluid internal‑energy assignment so q_cons_vf(... )%sf = ... * ek(i) executes only when model_eqns == 3.
Validation & Constraints
toolchain/mfc/case_validator.py
Consolidate phase‑change validation into a single rule: either (model_eqns==2 and relax_model∈[5,6]) or (model_eqns==3 and relax_model∈[1,4,5,6]); update error message.
Test Case Generation
toolchain/mfc/test/cases.py
Iterate over model_eqns values to emit separate labelled cases; add model_eqns to case labels; conditionally append third‑fluid and velocity pushes for 3‑fluid scenarios.
Example Cases — CLI
examples/1D_exp_tube_phasechange/case.py, examples/2D_phasechange_bubble/case.py, examples/2D_phasechange_bubble/casefile.py, examples/2D_shocktube_phasechange/case.py, examples/3D_phasechange_bubble/case.py
Add argparse with --mfc and -me/--model_eqns (choices 2 or 3); replace hardcoded "model_eqns": 3 with args.model_eqns.
Test Golden Metadata
tests/*/golden-metadata.txt
Many autogenerated golden‑metadata files added and several obsolete ones removed (environment/build snapshots).
Test Golden Data
tests/FA4D8FEF/golden.txt
Removed numerous D/cons.* and D/prim.* entries from the golden dataset listing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Inspect src/common/m_phase_change.fpp for other sites assuming sf was updated when model_eqns != 3.
  • Verify consolidated logic and messages in toolchain/mfc/case_validator.py.
  • Confirm push/pop and label correctness in toolchain/mfc/test/cases.py (stack balance and ndims branches).
  • Check CLI wiring in example scripts to ensure model_eqns is serialized into produced configs.

Possibly related PRs

Suggested reviewers

  • sbryngelson
  • wilfonba

"🐇 I hopped through code at break of day,
I let two models choose their way,
Tests sprout branches, CLIs sing,
Validators guard everything,
Golden files blink — hooray!"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '5 Equation model and relaxation' is directly related to the main objective of the PR, which extends support for 5-equation models in phase-change relaxation schemes.

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.

@codeant-ai codeant-ai bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Dec 18, 2025
@qodo-code-review
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The new phase-change validation removes the explicit range check for relax_model (previously ensured 0..6). If relax_model is invalid (e.g., 7, -1, None with relax='T'), the current logic may no longer reject it, potentially allowing unsupported configurations through.

if not relax:
    return

self.prohibit(model_eqns is not None and ( not ( model_eqns == 2 and ( relax_model == 5 or relax_model == 6 ) ) ) and ( not ( model_eqns == 3 and ( relax_model in [1, 4, 5, 6] ) ) ),
             "phase change requires model_eqns == 3 (all relax_model) or model_eqns == 2 and relax_model == ( 5 or 6 )")
self.prohibit(palpha_eps is not None and palpha_eps <= 0,
Validation Logic

The new model_eqns/relax_model constraint is encoded as a single dense boolean with multiple negations, which is easy to misread and may not match the intended policy. The error message says “model_eqns == 3 (all relax_model)”, but the condition appears to only allow relax_model in [1, 4, 5, 6] when model_eqns == 3. Please verify intended allowed combinations and consider rewriting as clearer positive checks.

self.prohibit(model_eqns is not None and ( not ( model_eqns == 2 and ( relax_model == 5 or relax_model == 6 ) ) ) and ( not ( model_eqns == 3 and ( relax_model in [1, 4, 5, 6] ) ) ),
             "phase change requires model_eqns == 3 (all relax_model) or model_eqns == 2 and relax_model == ( 5 or 6 )")
Fragile Tests

The test generation adds a nested loop over model_eqns and introduces additional stack.push/stack.pop operations. This increases the risk of stack imbalance or incorrect case composition (e.g., pops not matching pushes on all branches), which could silently drop test dimensions or leak configuration into subsequent cases. It’s worth double-checking that each push has a corresponding pop in all paths and that generated cases cover both model_eqns values as intended.

# Phase Change checks
for relax_model in [5] + ([6] if ndims <= 2 else []):
    for num_fluids in ([2] if ndims == 1 or relax_model == 5 else []) + [3]:
        for model_eqns in [3, 2]:
            stack.push(f"Phase Change model {relax_model} -> {num_fluids} Fluid(s) -> model equation -> {model_eqns}", {
                "relax": 'T',
                "relax_model": relax_model,
                'model_eqns': model_eqns,
                'palpha_eps': 1E-02,
                'ptgalpha_eps': 1E-02,
                "num_fluids": num_fluids,
                'riemann_solver':           2,
                'fluid_pp(1)%gamma':        0.7409,       'fluid_pp(1)%pi_inf':   1.7409E+09,
                'fluid_pp(1)%cv':           1816,         'fluid_pp(1)%qv':   -1167000,
                'fluid_pp(1)%qvp':          0.0,
                'fluid_pp(2)%gamma':        2.3266,       'fluid_pp(2)%pi_inf':   0.0E+00,
                'fluid_pp(2)%cv':           1040,         'fluid_pp(2)%qv':   2030000,
                'fluid_pp(2)%qvp':          -23400,
                'patch_icpp(1)%pres':       4.3755E+05,
                'patch_icpp(1)%alpha(1)':   8.7149E-06,    'patch_icpp(1)%alpha_rho(1)': 9.6457E+02 * 8.7149E-06,
                'patch_icpp(1)%alpha(2)':   1-8.7149E-06,  'patch_icpp(1)%alpha_rho(2)': 2.3132 * ( 1 - 8.7149E-06 ),
                'patch_icpp(2)%pres':       9.6602E+04,
                'patch_icpp(2)%alpha(1)':   3.6749E-05,   'patch_icpp(2)%alpha_rho(1)': 1.0957E+03 * 3.6749E-05,
                'patch_icpp(2)%alpha(2)':   1-3.6749E-05, 'patch_icpp(2)%alpha_rho(2)': 0.5803 * ( 1 - 3.6749E-05 ),
                'patch_icpp(3)%pres':       9.6602E+04,
                'patch_icpp(3)%alpha(1)':   3.6749E-05,   'patch_icpp(3)%alpha_rho(1)': 1.0957E+03 * 3.6749E-05,
                'patch_icpp(3)%alpha(2)':   1-3.6749E-05, 'patch_icpp(3)%alpha_rho(2)': 0.5803 * ( 1 - 3.6749E-05 )
            })

            if num_fluids == 3:
                stack.push("", {
                    'fluid_pp(3)%gamma':        2.4870,        'fluid_pp(3)%pi_inf':   0.0E+00,
                    'fluid_pp(3)%cv':           717.5,         'fluid_pp(3)%qv':   0.0E+00,
                    'fluid_pp(3)%qvp':          0.0,
                    'patch_icpp(1)%alpha(2)':   2.5893E-02,                 'patch_icpp(1)%alpha_rho(2)':   2.3132 * 2.5893E-02,
                    'patch_icpp(2)%alpha(2)':   2.8728E-02,                 'patch_icpp(2)%alpha_rho(2)':   0.5803 * 2.8728E-02,
                    'patch_icpp(3)%alpha(2)':   2.8728E-02,                 'patch_icpp(3)%alpha_rho(2)':   0.5803 * 2.8728E-02,
                    'patch_icpp(1)%alpha(3)':   1-8.7149E-06-2.5893E-02,    'patch_icpp(1)%alpha_rho(3)':   3.5840 * ( 1-8.7149E-06-2.5893E-02 ),
                    'patch_icpp(2)%alpha(3)':   1-3.6749E-05-2.8728E-02,    'patch_icpp(2)%alpha_rho(3)':   0.8991 * ( 1-3.6749E-05-2.8728E-02 ),
                    'patch_icpp(3)%alpha(3)':   1-3.6749E-05-2.8728E-02,    'patch_icpp(3)%alpha_rho(3)':   0.8991 * ( 1-3.6749E-05-2.8728E-02 )
                })

            if ndims == 1:
                stack.push("", {
                    'patch_icpp(1)%vel(1)':   606.15, 'patch_icpp(2)%vel(1)': 10.0, 'patch_icpp(3)%vel(1)': 10.0
                })
            elif ndims == 2:
                stack.push("", {
                    'patch_icpp(1)%vel(1)':   0.0, 'patch_icpp(2)%vel(1)': 0.0, 'patch_icpp(3)%vel(1)': 0.0,
                    'patch_icpp(1)%vel(2)':   606.15, 'patch_icpp(2)%vel(2)': 10.0, 'patch_icpp(3)%vel(2)': 10.0
                })
            elif ndims == 3:
                stack.push("", {
                    'patch_icpp(1)%vel(1)':   0.0, 'patch_icpp(2)%vel(1)': 0.0, 'patch_icpp(3)%vel(1)': 0.0,
                    'patch_icpp(1)%vel(2)':   0.0, 'patch_icpp(2)%vel(2)': 0.0, 'patch_icpp(3)%vel(2)': 0.0,
                    'patch_icpp(1)%vel(3)':   606.15, 'patch_icpp(2)%vel(3)': 10.0, 'patch_icpp(3)%vel(3)': 10.0
                })

            cases.append(define_case_d(stack, '', {}))

            stack.pop()
            stack.pop()

            if num_fluids == 3:
                stack.pop()

@codeant-ai
Copy link

codeant-ai bot commented Dec 18, 2025

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Uninitialized/Leftover intxb values
    The new conditional prevents writing to the intxb slot unless model_eqns == 3.
    For models where model_eqns /= 3 the intxb entries will keep their previous values
    (or remain uninitialized), which can break conservation checks or later kernels that
    expect alpha*rho*e to be set. Verify intended behaviour and whether intxb must be
    cleared or set to a model-specific value for other model_eqns.

  • Energy / model consistency risk
    Previously alpha*rho*e was always assigned; now it is conditional. Downstream
    code may rely on this invariant (for energy bookkeeping or I/O). Ensure the change
    preserves the conserved quantities and update callers/tests if the behaviour changed.

  • Branch in GPU hot loop
    The new if (model_eqns == 3) is evaluated inside a GPU-parallel loop. Per-iteration
    branching can hurt performance on accelerators and in some GPU toolchains scalar
    module variables used in device code may not behave as on host. Confirm the
    GPU runtime supports this branch and consider hoisting it outside the loop.

  • Unchecked volume fractions
    Volume fractions for air are computed as aa = 1 - awl - awv without validation. If the provided awl/awv values ever sum >1 or are negative, downstream code will get negative or >1 alpha values which can break physical assumptions. Add validation/clamping or explicit error reporting.

  • t_step_save may be zero
    The number of saves per run (AS) is computed as int(Nt // SF). If Nt < SF this yields 0, producing "t_step_save": 0 in the generated config, which is likely invalid for the solver and will disable all output or cause errors. Ensure AS is enforced to be >= 1.

  • Missing Bounds Check
    The previous explicit check that ensured relax_model is within [0,6] was removed. Without it, out-of-range relax_model values (e.g. -1 or 99) could pass the validation when they should be rejected.

  • Push/Pop imbalance risk
    The new nested loop and additional stack.push calls increase the complexity of push/pop pairs inside alter_phasechange. Verify that for every push there is a matching pop in all code paths (including early returns / exceptions). Consider that an exception in define_case_d or later code would leave the stack in an inconsistent state and break later case generation.

  • Complex Logic
    The newly added single-line boolean expression combining model_eqns and relax_model is dense and hard to verify. It's easy to get operator precedence or grouping wrong, which may allow invalid combinations or reject valid ones. Prefer splitting into explicit checks for clarity and correctness.

  • Unexpected floor-division semantics
    The expression 18e3 * tend // tc * Nx / Nx0 mixes // (floor division) with * and / and floats. This can produce surprising results due to floordiv semantics with floats and operator precedence. Use explicit parentheses and an intentional rounding method (e.g., math.floor) to make the intent clear.

  • Many magic constants
    The file contains many hard-coded numeric scaling factors (e.g. 500000 / 100, 1000000 / 100, 18e3, 0.915, 0.25, etc.). These make the code harder to audit and maintain; consider grouping such constants or explaining rationale so reviewers can confirm units and correctness.

@codeant-ai
Copy link

codeant-ai bot commented Dec 18, 2025

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 72 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="toolchain/mfc/case_validator.py">

<violation number="1" location="toolchain/mfc/case_validator.py:337">
P2: Error message is misleading: it claims &#39;model_eqns == 3 (all relax_model)&#39; but the code only allows `relax_model in [1, 4, 5, 6]` for model_eqns=3. Consider updating the message to accurately describe valid combinations, e.g., &#39;phase change requires model_eqns == 3 with relax_model in [1, 4, 5, 6], or model_eqns == 2 with relax_model == 5 or 6&#39;.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
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: 1

♻️ Duplicate comments (7)
tests/413DD555/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 92%).

tests/D8136392/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 85%).

tests/E6DBCBD9/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 92%).

tests/60EE4401/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 60%).

tests/E0256CBF/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 86%).

tests/723DDBCF/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 87%).

tests/C46769FD/golden-metadata.txt (1)

1-190: See earlier comment on golden-metadata.txt portability.

This file has the same concerns as tests/76C663B7/golden-metadata.txt regarding machine-specific paths (line 29) and CPU scaling MHz variance (line 163: 93%).

🧹 Nitpick comments (5)
examples/2D_phasechange_bubble_6Eqn/casefile.py (2)

12-12: Remove or document commented code.

The commented temperature assignment should either be removed or explained with a comment indicating why it's preserved.


245-250: Simplify arithmetic or explain the scaling factors.

Lines 245-250 multiply by large values (500000 or 1000000) then divide by 100, which simplifies to multiplication by 5000 or 10000. This pattern suggests either:

  • Unit conversion that should be documented
  • Unintentional complexity that should be simplified
🔎 Simplify if no special reason for the intermediate values:
-            "patch_icpp(1)%x_centroid": (xe + xb) * 500000 / 100,
-            "patch_icpp(1)%y_centroid": (ye + yb) * 500000 / 100,
-            "patch_icpp(1)%z_centroid": (ze + zb) * 500000 / 100,
-            "patch_icpp(1)%length_x": (xe - xb) * 1000000 / 100,
-            "patch_icpp(1)%length_y": (ye - yb) * 1000000 / 100,
-            "patch_icpp(1)%length_z": (ze - zb) * 1000000 / 100,
+            "patch_icpp(1)%x_centroid": (xe + xb) * 5000.0,
+            "patch_icpp(1)%y_centroid": (ye + yb) * 5000.0,
+            "patch_icpp(1)%z_centroid": (ze + zb) * 5000.0,
+            "patch_icpp(1)%length_x": (xe - xb) * 10000.0,
+            "patch_icpp(1)%length_y": (ye - yb) * 10000.0,
+            "patch_icpp(1)%length_z": (ze - zb) * 10000.0,
examples/2D_phasechange_bubble_6Eqn/case.py (2)

94-101: Unused computed variables.

Variables ss (shock speed), cfl, Nz, and several speed-of-sound values for patch 2 (c_wl2, c_wv2, c_a2) are computed but never used in the configuration output. Consider removing them to improve clarity, or add a comment explaining if they're kept for documentation/reference purposes.


236-239: Consider clarifying magic number multipliers in patch geometry.

The calculations 500000 / 100 (= 5000×) and 1000000 / 100 (= 10000×) create a background patch significantly larger than the computational domain. While this is a valid pattern for ensuring full domain coverage, the magic numbers reduce readability.

Consider adding a brief comment or using named constants:

# Background patch extends well beyond domain to ensure full coverage
scale_centroid = 5000  # Places centroid far from origin
scale_length = 10000   # Creates oversized patch
toolchain/mfc/test/cases.py (1)

726-726: Consider aligning test label format with existing conventions.

The label format "model equation -> {model_eqns}" differs from the pattern used elsewhere in this file (e.g., "model_eqns=3" on lines 201, 303, 417). For consistency, consider:

-f"Phase Change model {relax_model} -> {num_fluids} Fluid(s) -> model equation -> {model_eqns}"
+f"Phase Change model {relax_model} -> {num_fluids} Fluid(s) -> model_eqns={model_eqns}"
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2902000 and 88e9120.

📒 Files selected for processing (44)
  • examples/1D_exp_tube_phasechange_5Eqn/case.py (1 hunks)
  • examples/1D_exp_tube_phasechange_6Eqn/case.py (1 hunks)
  • examples/2D_phasechange_bubble_6Eqn/case.py (1 hunks)
  • examples/2D_phasechange_bubble_6Eqn/casefile.py (1 hunks)
  • examples/2D_shocktube_phasechange_6Eqn/case.py (1 hunks)
  • examples/3D_phasechange_bubble_6Eqn/case.py (1 hunks)
  • src/common/m_phase_change.fpp (1 hunks)
  • tests/02BD9B5E/golden-metadata.txt (1 hunks)
  • tests/18431ACB/golden-metadata.txt (0 hunks)
  • tests/1B300F28/golden-metadata.txt (0 hunks)
  • tests/2486442D/golden-metadata.txt (1 hunks)
  • tests/2C9844EF/golden-metadata.txt (0 hunks)
  • tests/344FAA70/golden-metadata.txt (1 hunks)
  • tests/413DD555/golden-metadata.txt (1 hunks)
  • tests/60EE4401/golden-metadata.txt (1 hunks)
  • tests/610959C9/golden-metadata.txt (0 hunks)
  • tests/623B6C30/golden-metadata.txt (1 hunks)
  • tests/67C777D8/golden-metadata.txt (0 hunks)
  • tests/6F296065/golden-metadata.txt (0 hunks)
  • tests/723DDBCF/golden-metadata.txt (1 hunks)
  • tests/72FD6FF5/golden-metadata.txt (0 hunks)
  • tests/76C663B7/golden-metadata.txt (1 hunks)
  • tests/786DE444/golden-metadata.txt (0 hunks)
  • tests/82A64F89/golden-metadata.txt (0 hunks)
  • tests/842C6FFC/golden-metadata.txt (0 hunks)
  • tests/8D0E7E1D/golden-metadata.txt (1 hunks)
  • tests/8D6E051E/golden-metadata.txt (1 hunks)
  • tests/9EF19F0A/golden-metadata.txt (0 hunks)
  • tests/A83CADB5/golden-metadata.txt (0 hunks)
  • tests/AAE5C27B/golden-metadata.txt (1 hunks)
  • tests/B2EFB9F7/golden-metadata.txt (1 hunks)
  • tests/B97D4966/golden-metadata.txt (0 hunks)
  • tests/C46769FD/golden-metadata.txt (1 hunks)
  • tests/D21F4F38/golden-metadata.txt (1 hunks)
  • tests/D3C860B9/golden-metadata.txt (0 hunks)
  • tests/D8136392/golden-metadata.txt (1 hunks)
  • tests/DA8AF07E/golden-metadata.txt (0 hunks)
  • tests/E0256CBF/golden-metadata.txt (1 hunks)
  • tests/E6DBCBD9/golden-metadata.txt (1 hunks)
  • tests/F4D00494/golden-metadata.txt (1 hunks)
  • tests/FA4D8FEF/golden-metadata.txt (0 hunks)
  • tests/FA4D8FEF/golden.txt (0 hunks)
  • toolchain/mfc/case_validator.py (1 hunks)
  • toolchain/mfc/test/cases.py (1 hunks)
💤 Files with no reviewable changes (17)
  • tests/9EF19F0A/golden-metadata.txt
  • tests/842C6FFC/golden-metadata.txt
  • tests/DA8AF07E/golden-metadata.txt
  • tests/FA4D8FEF/golden-metadata.txt
  • tests/6F296065/golden-metadata.txt
  • tests/A83CADB5/golden-metadata.txt
  • tests/1B300F28/golden-metadata.txt
  • tests/610959C9/golden-metadata.txt
  • tests/18431ACB/golden-metadata.txt
  • tests/D3C860B9/golden-metadata.txt
  • tests/786DE444/golden-metadata.txt
  • tests/B97D4966/golden-metadata.txt
  • tests/72FD6FF5/golden-metadata.txt
  • tests/FA4D8FEF/golden.txt
  • tests/67C777D8/golden-metadata.txt
  • tests/82A64F89/golden-metadata.txt
  • tests/2C9844EF/golden-metadata.txt
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{fpp,f90}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{fpp,f90}: Use 2-space indentation; continuation lines align beneath &
Use lower-case keywords and intrinsics (do, end subroutine, etc.)
Name modules with m_ pattern (e.g., m_transport)
Name public subroutines with s_ pattern (e.g., s_compute_flux)
Name public functions with f
_ pattern
Keep subroutine size ≤ 500 lines, helper subroutines ≤ 150 lines, functions ≤ 100 lines, files ≤ 1000 lines
Limit routine arguments to ≤ 6; use derived-type params struct if more are needed
Forbid goto statements (except in legacy code), COMMON blocks, and save globals
Every argument must have explicit intent; use dimension/allocatable/pointer as appropriate
Call s_mpi_abort() for errors, never use stop or error stop

**/*.{fpp,f90}: Indent 2 spaces; continuation lines align under &
Use lower-case keywords and intrinsics (do, end subroutine, etc.)
Name modules with m_<feature> prefix (e.g., m_transport)
Name public subroutines as s_<verb>_<noun> (e.g., s_compute_flux) and functions as f_<verb>_<noun>
Keep private helpers in the module; avoid nested procedures
Enforce size limits: subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, module/file ≤ 1000
Limit subroutines to ≤ 6 arguments; otherwise pass a derived-type 'params' struct
Avoid goto statements (except unavoidable legacy); avoid global state (COMMON, save)
Every variable must have intent(in|out|inout) specification and appropriate dimension / allocatable / pointer
Use s_mpi_abort(<msg>) for error termination instead of stop
Use !> style documentation for header comments; follow Doxygen Fortran format with !! @param and !! @return tags
Use implicit none statement in all modules
Use private declaration followed by explicit public exports in modules
Use derived types with pointers for encapsulation (e.g., pointer, dimension(:,:,:) => null())
Use pure and elemental attributes for side-effect-free functions; combine them for array ...

Files:

  • src/common/m_phase_change.fpp
src/**/*.fpp

📄 CodeRabbit inference engine (.cursor/rules/mfc-agent-rules.mdc)

src/**/*.fpp: Use .fpp file extension for Fypp preprocessed files; CMake transpiles them to .f90
Start module files with Fypp include for macros: #:include 'macros.fpp'
Use the fypp ASSERT macro for validating conditions: @:ASSERT(predicate, message)
Use fypp macro @:ALLOCATE(var1, var2) for device-aware allocation instead of standard Fortran allocate
Use fypp macro @:DEALLOCATE(var1, var2) for device-aware deallocation instead of standard Fortran deallocate

Files:

  • src/common/m_phase_change.fpp
🧠 Learnings (4)
📚 Learning: 2025-11-24T21:50:16.713Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification

Applied to files:

  • tests/723DDBCF/golden-metadata.txt
  • tests/2486442D/golden-metadata.txt
  • tests/8D0E7E1D/golden-metadata.txt
  • tests/C46769FD/golden-metadata.txt
  • tests/76C663B7/golden-metadata.txt
  • tests/E0256CBF/golden-metadata.txt
  • tests/D21F4F38/golden-metadata.txt
  • tests/D8136392/golden-metadata.txt
  • tests/AAE5C27B/golden-metadata.txt
  • tests/344FAA70/golden-metadata.txt
  • tests/60EE4401/golden-metadata.txt
  • tests/02BD9B5E/golden-metadata.txt
  • tests/F4D00494/golden-metadata.txt
  • tests/413DD555/golden-metadata.txt
  • tests/B2EFB9F7/golden-metadata.txt
  • tests/623B6C30/golden-metadata.txt
  • tests/E6DBCBD9/golden-metadata.txt
  • tests/8D6E051E/golden-metadata.txt
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Draft a step-by-step plan before making changes; build after each step using `./mfc.sh build -t pre_process simulation -j $(nproc)`

Applied to files:

  • tests/723DDBCF/golden-metadata.txt
  • tests/2486442D/golden-metadata.txt
  • tests/8D0E7E1D/golden-metadata.txt
  • tests/C46769FD/golden-metadata.txt
  • tests/76C663B7/golden-metadata.txt
  • tests/E0256CBF/golden-metadata.txt
  • tests/D21F4F38/golden-metadata.txt
  • tests/D8136392/golden-metadata.txt
  • tests/AAE5C27B/golden-metadata.txt
  • tests/344FAA70/golden-metadata.txt
  • tests/60EE4401/golden-metadata.txt
  • tests/02BD9B5E/golden-metadata.txt
  • tests/F4D00494/golden-metadata.txt
  • tests/413DD555/golden-metadata.txt
  • tests/B2EFB9F7/golden-metadata.txt
  • tests/623B6C30/golden-metadata.txt
  • tests/E6DBCBD9/golden-metadata.txt
  • tests/8D6E051E/golden-metadata.txt
📚 Learning: 2025-11-24T21:50:16.713Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Applies to src/simulation/**/*.{fpp,f90} : Ensure GPU code compiles with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort compilers

Applied to files:

  • tests/723DDBCF/golden-metadata.txt
  • tests/2486442D/golden-metadata.txt
  • tests/8D0E7E1D/golden-metadata.txt
  • tests/C46769FD/golden-metadata.txt
  • tests/76C663B7/golden-metadata.txt
  • tests/E0256CBF/golden-metadata.txt
  • tests/D21F4F38/golden-metadata.txt
  • tests/D8136392/golden-metadata.txt
  • tests/AAE5C27B/golden-metadata.txt
  • tests/344FAA70/golden-metadata.txt
  • tests/60EE4401/golden-metadata.txt
  • tests/02BD9B5E/golden-metadata.txt
  • tests/F4D00494/golden-metadata.txt
  • tests/413DD555/golden-metadata.txt
  • tests/B2EFB9F7/golden-metadata.txt
  • tests/623B6C30/golden-metadata.txt
  • tests/E6DBCBD9/golden-metadata.txt
  • tests/8D6E051E/golden-metadata.txt
📚 Learning: 2025-11-24T21:50:46.909Z
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .cursor/rules/mfc-agent-rules.mdc:0-0
Timestamp: 2025-11-24T21:50:46.909Z
Learning: Compile with Cray `ftn` or NVIDIA `nvfortran` for GPU offloading; also build CPU-only with GNU `gfortran` and Intel `ifx`/`ifort` for portability

Applied to files:

  • tests/723DDBCF/golden-metadata.txt
  • tests/2486442D/golden-metadata.txt
  • tests/8D0E7E1D/golden-metadata.txt
  • tests/C46769FD/golden-metadata.txt
  • tests/76C663B7/golden-metadata.txt
  • tests/E0256CBF/golden-metadata.txt
  • tests/D21F4F38/golden-metadata.txt
  • tests/D8136392/golden-metadata.txt
  • tests/AAE5C27B/golden-metadata.txt
  • tests/344FAA70/golden-metadata.txt
  • tests/60EE4401/golden-metadata.txt
  • tests/02BD9B5E/golden-metadata.txt
  • tests/F4D00494/golden-metadata.txt
  • tests/413DD555/golden-metadata.txt
  • tests/B2EFB9F7/golden-metadata.txt
  • tests/623B6C30/golden-metadata.txt
  • tests/E6DBCBD9/golden-metadata.txt
  • tests/8D6E051E/golden-metadata.txt
🧬 Code graph analysis (2)
examples/2D_shocktube_phasechange_6Eqn/case.py (1)
toolchain/mfc/case.py (1)
  • Case (19-292)
toolchain/mfc/test/cases.py (1)
toolchain/mfc/test/case.py (3)
  • push (317-319)
  • define_case_d (331-347)
  • pop (321-322)
🪛 GitHub Actions: Lint Toolchain
toolchain/mfc/case_validator.py

[error] 333-333: R1714: Consider merging these comparisons with 'in' by using 'relax_model in (5, 6)'. Use a set instead if elements are hashable. (consider-using-in)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Georgia Tech | Phoenix (gpu-acc)
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Build & Publish
🔇 Additional comments (12)
tests/D21F4F38/golden-metadata.txt (1)

29-29: Golden-metadata.txt is informational only and not used in test comparisons.

The golden-metadata.txt file is generated as a side effect of saving the test's golden pack file and documents the system configuration (paths, hostname, git status, CPU info) used when the test was generated. It is never loaded or compared during testing. Test comparisons only use golden.txt, which contains the numerical data from simulation outputs. The absolute paths and system-specific values in metadata are expected and do not affect test portability or results across different machines or CI environments.

tests/76C663B7/golden-metadata.txt (1)

1-190: Golden-metadata.txt files are informational only and not used in regression testing.

The golden-metadata.txt files captured here are metadata/logging files created by the syscheck utility during test execution, not regression test reference files. The actual regression tests compare golden.txt files (which contain computational results), not golden-metadata.txt files (which record system configuration).

Because golden-metadata.txt is not used in test comparisons, the concerns about hard-coded paths (line 29) and CPU scaling MHz variance (line 163) do not affect test reliability. These files are appropriately version-controlled as informational records of the build and execution environment.

src/common/m_phase_change.fpp (1)

263-265: The conditional correctly guards internal energy field assignment to model_eqns == 3.

The code is safe and requires no changes. The assignment to q_cons_vf(i + intxb - 1)%sf(j, k, l) only occurs when model_eqns == 3, and at that point, internalEnergies_idx (and thus intxb) is explicitly initialized in m_global_parameters.fpp (lines 773-774). For other model types (model_eqns == 1, 2, or 4), internalEnergies_idx is not set, but the conditional prevents the assignment from executing. Internal energy fields are neither used nor required for non-6-equation models—they are model-specific state variables present only in the 6-equation system.

Likely an incorrect or invalid review comment.

tests/623B6C30/golden-metadata.txt (1)

1-190: LGTM - Golden metadata artifact for new test case.

This test metadata file captures the build environment and hardware configuration for test validation purposes.

tests/AAE5C27B/golden-metadata.txt (1)

1-190: LGTM - Golden metadata artifact for test case AAE5C27B.

Correctly captures the test environment configuration for regression validation.

examples/2D_shocktube_phasechange_6Eqn/case.py (1)

1-267: Well-structured 2D shock-tube configuration for 6-equation phase-change model.

The script correctly:

  • Defines three-fluid system (liquid water, vapor, air) with appropriate thermodynamic properties
  • Computes shock relations and derives simulation parameters
  • Configures three patches with proper geometry and state variables
  • Uses model_eqns=3 with relax_model=6, which is a valid combination per the updated validator

The physical setup and numerical parameters are well-documented.

examples/1D_exp_tube_phasechange_6Eqn/case.py (1)

1-193: LGTM - 1D expansion tube configuration for 6-equation phase-change model.

The script correctly sets up an expansion tube scenario with:

  • Three-fluid system with appropriate thermodynamic properties
  • Opposing patch velocities (-vel and +vel) to generate expansion waves
  • Valid model_eqns=3 with relax_model=6 configuration
examples/1D_exp_tube_phasechange_5Eqn/case.py (1)

1-193: LGTM - 1D expansion tube configuration for 5-equation phase-change model.

This example demonstrates the new feature introduced by this PR: phase-change relaxation with model_eqns=2 (5-equation model) and relax_model=6. The configuration mirrors the 6-equation version, enabling direct comparison between the two models as shown in the PR's test results.

examples/2D_phasechange_bubble_6Eqn/case.py (1)

175-282: Configuration structure looks correct.

The simulation configuration properly defines:

  • 6-equation model (model_eqns: 3, relax_model: 6)
  • Three fluids with complete thermodynamic properties
  • Two patches with proper volume fractions summing appropriately
  • Cylindrical coordinates enabled for axisymmetric 2D simulation
toolchain/mfc/test/cases.py (1)

725-786: Stack push/pop balance is correct for the new nested loop structure.

The refactored phase-change test generation properly maintains stack balance:

  • For num_fluids == 3: 3 pushes (phase change, fluid 3, velocity) → 3 pops
  • For num_fluids != 3: 2 pushes (phase change, velocity) → 2 pops

The new structure correctly generates distinct test cases for each model_eqns value (3 and 2), with appropriate labeling.

examples/3D_phasechange_bubble_6Eqn/case.py (1)

1-296: 3D configuration correctly extends the 2D pattern.

The script properly adapts the 2D phase-change bubble case for 3D:

  • Uses appropriate 3D geometries (cuboid=9, sphere=8)
  • Includes z-domain parameters and stretch settings
  • Defines all three velocity components
  • Cartesian coordinates (cyl_coord: "F") appropriate for 3D

The same minor suggestions from the 2D review apply here (unused variables like ss, cfl, and magic number multipliers in patch geometry).

tests/2486442D/golden-metadata.txt (1)

1-189: The machine-specific data in golden-metadata.txt does not affect test portability. The metadata file is written separately from the pack data and is used for reference/debugging only—it is never loaded or compared during test validation. Test comparison occurs only on the numerical pack data (golden.txt) using tolerance-based floating-point comparison, which is machine-independent.

Likely an incorrect or invalid review comment.

JRChreim and others added 2 commits December 17, 2025 21:55
Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com>
Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com>
Copy link
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: 1

♻️ Duplicate comments (1)
examples/3D_phasechange_bubble_6Eqn/case.py (1)

169-169: Off-by-one: Missing +1 for initial save state.

The comment on line 147 explicitly states the save count should account for the initial state: "save frequency = SF + 1". Computing AS = int(Nt // SF) omits the initial save (at t=0) and produces one fewer save entry than documented.

🔎 Apply this diff to match the documented behavior:
-AS = int(Nt // SF)
+AS = int(Nt // SF + 1)
🧹 Nitpick comments (1)
examples/3D_phasechange_bubble_6Eqn/case.py (1)

12-12: Consider removing the commented-out debug value.

The commented temperature value of 7.914 K appears to be a leftover from debugging or experimentation and can be removed for cleaner code.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88e9120 and f744537.

📒 Files selected for processing (1)
  • examples/3D_phasechange_bubble_6Eqn/case.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification
🧬 Code graph analysis (1)
examples/3D_phasechange_bubble_6Eqn/case.py (1)
toolchain/mfc/test/cases.py (7)
  • alter_viscosity (787-838)
  • alter_phasechange (719-785)
  • alter_bubbles (511-588)
  • alter_num_fluids (224-291)
  • alter_3d (322-365)
  • alter_body_forces (654-684)
  • chemistry_cases (1061-1097)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Oak Ridge | Frontier (gpu-acc)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Georgia Tech | Phoenix (gpu-acc)
  • GitHub Check: Oak Ridge | Frontier (cpu)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Build & Publish
🔇 Additional comments (5)
examples/3D_phasechange_bubble_6Eqn/case.py (5)

14-93: LGTM: Fluid property definitions are physically sound.

The fluid properties for liquid water (stiffened gas), water vapor, and air (ideal gases) are correctly computed using appropriate equations of state and thermodynamic relations.


103-115: LGTM: Volume fraction calculations are algebraically correct.

The volume fractions for both patches are properly computed, with patch 1 being nearly pure liquid water and patch 2 containing a vapor-air mixture with concentration C0=0.25.


165-165: Verified: Time step calculation is correct.

The use of math.ceil() ensures sufficient time steps are allocated. This appears to address the concern raised in previous reviews about floor-division.


174-296: LGTM: JSON configuration structure is comprehensive and consistent.

The simulation configuration properly specifies:

  • 6-equation model (model_eqns=3) with pTg-relaxation (relax_model=6)
  • Three-fluid system with correct thermodynamic properties
  • Appropriate solver settings (WENO order 3, Riemann solver 2)
  • Two patches: background cuboid and spherical bubble

All fluid properties in the JSON match the computed values from earlier in the file (aside from the critical geometry issue flagged separately).


98-98: Shock Mach number formula for stiffened gas is correct.

The formula at line 98 correctly implements the modified shock relation for stiffened gas EOS. The factor (p02 / (p02 + pia)) properly accounts for the stiffening pressure, and the calculation is consistent with the stiffened gas form used throughout for density, sound speed, and other thermodynamic quantities. The formula reduces to the standard ideal gas relation when pia = 0.

Copy link
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: 1

🧹 Nitpick comments (1)
examples/2D_shocktube_phasechange_6Eqn/case.py (1)

145-146: Optional: Redundant int() calls.

The past review comment about using math.ceil() has been addressed. In Python 3, math.ceil() already returns an int, so the outer int() calls are redundant (though harmless).

🔎 Optional simplification:
-NtA = int(math.ceil(tendA / dt))
-AS = int(math.ceil(NtA / SF))
+NtA = math.ceil(tendA / dt)
+AS = math.ceil(NtA / SF)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f744537 and 27ae81a.

📒 Files selected for processing (1)
  • examples/2D_shocktube_phasechange_6Eqn/case.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification
🧬 Code graph analysis (1)
examples/2D_shocktube_phasechange_6Eqn/case.py (1)
toolchain/mfc/test/cases.py (9)
  • alter_hypoelasticity (590-652)
  • alter_phasechange (719-785)
  • alter_viscosity (787-838)
  • alter_bubbles (511-588)
  • alter_2d (293-320)
  • alter_mixlayer_perturb (686-717)
  • alter_3d (322-365)
  • chemistry_cases (1061-1097)
  • alter_riemann_solvers (190-209)
🪛 Ruff (0.14.8)
examples/2D_shocktube_phasechange_6Eqn/case.py

145-145: Value being cast to int is already an integer

Remove unnecessary int call

(RUF046)


146-146: Value being cast to int is already an integer

Remove unnecessary int call

(RUF046)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Build & Publish
🔇 Additional comments (2)
examples/2D_shocktube_phasechange_6Eqn/case.py (2)

1-107: LGTM: Physical property setup is correct.

The fluid property definitions (liquid water, vapor, air) and derived quantities (gamma, speed of sound, shock relations) follow standard thermodynamic formulas. The three-fluid volume fraction constraint is properly enforced.


246-260: LGTM: Consistent fluid property transformations.

The fluid property definitions apply a consistent transformation pattern to gamma and pi_inf for all three fluids, which aligns with the framework's internal representation.

Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
@codeant-ai
Copy link

codeant-ai bot commented Dec 19, 2025

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

8 issues found across 123 files (changes from recent commits).

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all 8 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="docs/documentation/case.md">

<violation number="1">
P2: Spurious `.` characters in the markdown table will break rendering. There&#39;s a standalone `.` after the heading and multiple table cells have errant `.` characters appended (e.g., `| Parameter               .  |`). These should be removed for the table to render correctly.</violation>
</file>

<file name="docs/documentation/docker.md">

<violation number="1">
P2: Broken link: `examples.md` does not exist in `docs/documentation/`. The directory contains `case.md`, `getting-started.md`, `running.md`, etc., but no `examples.md`. Consider using the correct relative path or keeping the original absolute URL.</violation>
</file>

<file name="CMakeLists.txt">

<violation number="1">
P2: Missing dependency on `gen_constraints.sh` script. The custom command runs this script but doesn&#39;t list it in DEPENDS, so modifications to the script won&#39;t trigger regeneration of `case_constraints.md`. Compare with the similar `examples.md` command which correctly includes its shell script in DEPENDS.</violation>
</file>

<file name="examples/3D_lagrange_bubblescreen/case.py">

<violation number="1">
P1: Gas constants appear to be swapped. `bub_pp%R_v` should use `MW_v` in the denominator, not `MW_g`.</violation>

<violation number="2">
P1: Specific heats appear to be swapped. `bub_pp%cp_v` should use `cp_v`, not `cp_g`.</violation>

<violation number="3">
P1: Thermal conductivities appear to be swapped. `bub_pp%k_v` should use `k_v`, not `k_g`.</violation>

<violation number="4">
P1: Molar weights appear to be swapped. `bub_pp%M_v` should receive `MW_v` (18.0 for water vapor), not `MW_g` (28.0 for gas).</violation>

<violation number="5">
P1: Vapor and gas specific heat ratios appear to be swapped. `bub_pp%gam_v` should receive `gam_v` (1.333 for vapor), not `gam_g` (1.4 for gas). This will cause incorrect thermodynamic calculations.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Into single parametrized scripts, in which the model equation can be chosen
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 11 files (changes from recent commits).

Prompt for AI agents (all 4 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="examples/2D_phasechange_bubble/casefile.py">

<violation number="1" location="examples/2D_phasechange_bubble/casefile.py:11">
P1: Missing `default` value or `required=True` for `--model_eqns` argument. If the script is run without this argument, `args.model_eqns` will be `None`, resulting in invalid JSON output. Consider adding `default=3` to maintain backward compatibility with the original hardcoded value, or add `required=True` if the argument must always be explicitly provided.</violation>
</file>

<file name="examples/2D_phasechange_bubble/case.py">

<violation number="1" location="examples/2D_phasechange_bubble/case.py:11">
P1: Missing default value for `--model_eqns` argument. If not provided, `args.model_eqns` will be `None`, causing the simulation configuration to have an invalid `model_eqns` value. Consider adding `default=3` to maintain backward compatibility with the original hardcoded value, or set `required=True` to enforce explicit selection.</violation>
</file>

<file name="examples/2D_shocktube_phasechange/case.py">

<violation number="1" location="examples/2D_shocktube_phasechange/case.py:11">
P2: The `--model_eqns` argument has no default value and isn&#39;t marked as required. If run without this flag, `args.model_eqns` will be `None`, causing invalid configuration. Consider adding `default=3` or `required=True`.</violation>
</file>

<file name="examples/3D_phasechange_bubble/case.py">

<violation number="1" location="examples/3D_phasechange_bubble/case.py:11">
P1: Missing default value for `--model_eqns` argument. If the script is run without this argument, `args.model_eqns` will be `None`, causing an invalid configuration. Consider adding `default=3` to maintain backward compatibility with the original hardcoded value.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
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: 1

♻️ Duplicate comments (4)
examples/3D_phasechange_bubble/case.py (1)

2-13: Duplicate: Same CLI setup issues as 2D_phasechange_bubble/case.py.

This argparse block is identical to the one in examples/2D_phasechange_bubble/case.py (lines 2-13). All concerns raised there apply here:

  • Missing required=True on --model_eqns (critical)
  • Code duplication across 5 files (essential refactor needed)
  • Unused --mfc argument (verify intent)
  • Confusing help text for model_eqns
examples/2D_phasechange_bubble/casefile.py (1)

2-13: Duplicate: Same CLI setup issues as other phase-change examples.

This argparse block is duplicated across multiple files. See the detailed comment on examples/2D_phasechange_bubble/case.py lines 2-13 for all concerns:

  • Missing required=True on --model_eqns (critical)
  • Code duplication (essential refactor needed)
  • Unused --mfc argument
  • Confusing help text
examples/2D_shocktube_phasechange/case.py (1)

2-13: Duplicate: Same CLI setup issues as other phase-change examples.

This argparse block is duplicated across multiple files. See the detailed comment on examples/2D_phasechange_bubble/case.py lines 2-13 for all concerns:

  • Missing required=True on --model_eqns (critical)
  • Code duplication (essential refactor needed)
  • Unused --mfc argument
  • Confusing help text
examples/1D_exp_tube_phasechange/case.py (1)

2-13: Duplicate: Same CLI setup issues as other phase-change examples.

This argparse block is duplicated across multiple files. See the detailed comment on examples/2D_phasechange_bubble/case.py lines 2-13 for all concerns:

  • Missing required=True on --model_eqns (critical)
  • Code duplication (essential refactor needed)
  • Unused --mfc argument
  • Confusing help text

Additionally, verify that the test framework in toolchain/mfc/test/cases.py (which shows 'model_eqns': 3 hardcoded in the alter_phasechange function around line 725) is updated to test both model_eqns=2 and model_eqns=3 scenarios, aligning with the PR's goal to support both 5- and 6-equation models.

Run the following script to check if test case generation covers both model_eqns values:

#!/bin/bash
# Check if alter_phasechange iterates over model_eqns values
ast-grep --pattern $'def alter_phasechange($$$) {
  $$$
  for $_ in $$$:
    $$$
    model_eqns
    $$$
}'
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 347844e and 26b4697.

📒 Files selected for processing (5)
  • examples/1D_exp_tube_phasechange/case.py (2 hunks)
  • examples/2D_phasechange_bubble/case.py (2 hunks)
  • examples/2D_phasechange_bubble/casefile.py (2 hunks)
  • examples/2D_shocktube_phasechange/case.py (2 hunks)
  • examples/3D_phasechange_bubble/case.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
examples/1D_exp_tube_phasechange/case.py (1)
toolchain/mfc/test/cases.py (1)
  • alter_phasechange (719-785)
examples/3D_phasechange_bubble/case.py (2)
toolchain/mfc/args.py (1)
  • parse (10-193)
toolchain/mfc/state.py (1)
  • MFCConfig (11-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Georgia Tech | Phoenix (gpu-acc)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Oak Ridge | Frontier (gpu-acc)
  • GitHub Check: Oak Ridge | Frontier (cpu)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Build & Publish
🔇 Additional comments (5)
examples/2D_phasechange_bubble/case.py (1)

216-216: Verify that model_eqns is never None.

The dynamic model selection via args.model_eqns correctly enables runtime configuration. However, ensure that the argument is always provided (see comment on lines 2-13 about making it required) to prevent null values in the JSON output.

examples/3D_phasechange_bubble/case.py (1)

222-222: LGTM with caveat.

Dynamic model selection correctly implemented. Ensure --model_eqns is made required to prevent null values.

examples/2D_phasechange_bubble/casefile.py (1)

223-223: LGTM with caveat.

Dynamic model selection correctly implemented. Ensure --model_eqns is made required to prevent null values.

examples/2D_shocktube_phasechange/case.py (1)

187-187: LGTM with caveat.

Dynamic model selection correctly implemented. Ensure --model_eqns is made required to prevent null values.

examples/1D_exp_tube_phasechange/case.py (1)

137-137: LGTM with caveat.

Dynamic model selection correctly implemented. Ensure --model_eqns is made required to prevent null values.

JRChreim and others added 6 commits December 18, 2025 19:06
adjusting indentation so the code does not crash
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c715e9 and e42b828.

📒 Files selected for processing (4)
  • examples/2D_phasechange_bubble/case.py (2 hunks)
  • examples/2D_phasechange_bubble/casefile.py (3 hunks)
  • examples/2D_shocktube_phasechange/case.py (2 hunks)
  • examples/3D_phasechange_bubble/case.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • examples/2D_phasechange_bubble/casefile.py
  • examples/2D_phasechange_bubble/case.py
  • examples/2D_shocktube_phasechange/case.py
🧰 Additional context used
🪛 GitHub Actions: Lint Toolchain
examples/3D_phasechange_bubble/case.py

[error] 8-8: Trailing whitespace (trailing-whitespace) detected by pylint during './mfc.sh lint'.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
🔇 Additional comments (2)
examples/3D_phasechange_bubble/case.py (2)

9-12: LGTM! CLI argument design is solid.

The CLI arguments are well-designed:

  • --mfc properly defaults to an empty dict via JSON parsing
  • --model_eqns now includes default=3 (addressing the previous review comment), maintaining backward compatibility with the original hardcoded value
  • Choices constraint [2, 3] aligns with the 5-equation and 6-equation models supported by the PR

222-222: LGTM! Configuration now uses CLI argument.

The change from a hardcoded "model_eqns": 3 to "model_eqns": args.model_eqns successfully makes the model selection configurable while maintaining the original default behavior.

Copy link
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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e42b828 and 0f2676d.

📒 Files selected for processing (1)
  • examples/3D_phasechange_bubble/case.py (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification
🧬 Code graph analysis (1)
examples/3D_phasechange_bubble/case.py (1)
toolchain/mfc/args.py (2)
  • parse (10-193)
  • add_common_arguments (50-77)
🪛 GitHub Actions: Lint Toolchain
examples/3D_phasechange_bubble/case.py

[warning] 7-7: Trailing whitespace (trailing-whitespace)


[warning] 306-306: Trailing newlines (trailing-newlines)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Georgia Tech | Phoenix (gpu-acc)
  • GitHub Check: Oak Ridge | Frontier (gpu-acc)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Oak Ridge | Frontier (cpu)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Build & Publish
🔇 Additional comments (2)
examples/3D_phasechange_bubble/case.py (2)

2-12: LGTM! CLI argument parsing correctly implemented.

The argument parser setup is well-structured with appropriate defaults and constraints. The default=3 maintains backward compatibility with the original hardcoded value, and choices=[2, 3] properly restricts model selection.

Note: Line 7 has trailing whitespace flagged by the linter.


221-221: LGTM! Dynamic model selection correctly wired.

The replacement of the hardcoded value with args.model_eqns properly enables runtime model selection between 5-equation and 6-equation models, aligning with the PR's objectives.

@codeant-ai
Copy link

codeant-ai bot commented Dec 19, 2025

CodeAnt AI is running Incremental review


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copy link
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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f2676d and 431c9ae.

📒 Files selected for processing (4)
  • examples/1D_exp_tube_phasechange/case.py (2 hunks)
  • examples/2D_phasechange_bubble/case.py (3 hunks)
  • examples/2D_phasechange_bubble/casefile.py (3 hunks)
  • examples/2D_shocktube_phasechange/case.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/2D_shocktube_phasechange/case.py
  • examples/2D_phasechange_bubble/case.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification
🧬 Code graph analysis (1)
examples/2D_phasechange_bubble/casefile.py (1)
toolchain/mfc/args.py (2)
  • parse (10-193)
  • add_common_arguments (50-77)
🪛 GitHub Actions: Lint Toolchain
examples/1D_exp_tube_phasechange/case.py

[warning] 8-8: Pylint: Trailing whitespace (trailing-whitespace) detected (C0303).

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Georgia Tech | Phoenix (cpu)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Oak Ridge | Frontier (gpu-omp)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Georgia Tech | Phoenix (gpu-omp)
  • GitHub Check: Build & Publish
🔇 Additional comments (2)
examples/2D_phasechange_bubble/casefile.py (1)

223-223: LGTM: Runtime model selection integrated correctly.

The configuration now uses args.model_eqns from the CLI, enabling dynamic switching between 5-equation and 6-equation models as intended by this PR.

examples/1D_exp_tube_phasechange/case.py (1)

137-137: LGTM: Consistent with other examples.

The use of args.model_eqns enables runtime model selection, and the implementation is consistent with the sibling example in 2D_phasechange_bubble.

Copy link
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: 0

♻️ Duplicate comments (2)
examples/2D_shocktube_phasechange/case.py (1)

7-7: Remove trailing whitespace.

Line 7 contains trailing whitespace that violates linting rules.

🔎 Proposed fix
-    formatter_class=argparse.ArgumentDefaultsHelpFormatter) 
+    formatter_class=argparse.ArgumentDefaultsHelpFormatter)
examples/3D_phasechange_bubble/case.py (1)

7-7: Remove trailing whitespace.

Line 7 contains trailing whitespace that violates linting rules.

🔎 Proposed fix
-    formatter_class=argparse.ArgumentDefaultsHelpFormatter) 
+    formatter_class=argparse.ArgumentDefaultsHelpFormatter)
🧹 Nitpick comments (1)
examples/2D_phasechange_bubble/casefile.py (1)

307-309: Optional: Verify trailing newlines.

Lines 307-309 appear to be blank lines at EOF. While past review comments indicate trailing newlines were addressed, ensure the file ends with a single newline per Python style guidelines.

🔎 Verification

Check the actual file ending:

#!/bin/bash
# Check the last few bytes of the file to verify newline handling
tail -c 20 examples/2D_phasechange_bubble/casefile.py | od -c
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 431c9ae and a16e1c3.

📒 Files selected for processing (5)
  • examples/1D_exp_tube_phasechange/case.py (2 hunks)
  • examples/2D_phasechange_bubble/case.py (3 hunks)
  • examples/2D_phasechange_bubble/casefile.py (3 hunks)
  • examples/2D_shocktube_phasechange/case.py (2 hunks)
  • examples/3D_phasechange_bubble/case.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/2D_phasechange_bubble/case.py
  • examples/1D_exp_tube_phasechange/case.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: MFlowCode/MFC PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T21:50:16.713Z
Learning: Add and update focused tests for changes; ensure no regressions in golden test outputs without clear justification
🧬 Code graph analysis (2)
examples/3D_phasechange_bubble/case.py (1)
toolchain/mfc/args.py (2)
  • parse (10-193)
  • add_common_arguments (50-77)
examples/2D_phasechange_bubble/casefile.py (1)
toolchain/mfc/args.py (2)
  • add_common_arguments (50-77)
  • parse (10-193)
🪛 GitHub Actions: Lint Toolchain
examples/2D_shocktube_phasechange/case.py

[error] 7-7: Pylint: Trailing whitespace (C0303).

examples/3D_phasechange_bubble/case.py

[error] 7-7: Pylint: Trailing whitespace (C0303).

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Build & Publish
🔇 Additional comments (3)
examples/2D_shocktube_phasechange/case.py (1)

2-12: LGTM: CLI-driven model selection implemented correctly.

The argparse setup is well-structured with appropriate defaults (default=3 for 6-equation model), input validation (choices=[2, 3]), and clear help text. The integration at line 186 correctly replaces the hardcoded model_eqns value with the CLI-provided argument.

Also applies to: 186-186

examples/3D_phasechange_bubble/case.py (1)

2-12: LGTM: CLI implementation is correct and consistent.

The argparse setup follows the same correct pattern as other phase-change examples, with appropriate defaults, validation, and integration at line 221.

Also applies to: 221-221

examples/2D_phasechange_bubble/casefile.py (1)

2-12: LGTM: CLI implementation is correct.

The argparse setup is properly configured with default=3, appropriate validation, and correct integration at line 222. The implementation is consistent with other phase-change examples in this PR.

Also applies to: 222-222

@sbryngelson sbryngelson marked this pull request as draft December 22, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 4/5 size:XXL This PR changes 1000+ lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

2 participants