Skip to content

Require two fluids for phase change - #1743

Merged
sbryngelson merged 1 commit into
MFlowCode:masterfrom
rj-scharff:fix/phase-change-min-two-fluids
Aug 20, 2026
Merged

Require two fluids for phase change#1743
sbryngelson merged 1 commit into
MFlowCode:masterfrom
rj-scharff:fix/phase-change-min-two-fluids

Conversation

@rj-scharff

Copy link
Copy Markdown
Contributor

Description

Reject phase-change configurations with fewer than two carrier fluids.

The phase-change operator uses fixed liquid and vapor indices lp = 1 and
vp = 2 and writes both indexed fields. With one carrier fluid, the vapor
index aliases x-momentum.

This implements the narrow validation guard requested in Issue #1738. It
intentionally does not address the broader phase-change/Euler–Euler
compatibility question.

Fixes #1738.

Type of change

  • Bug fix

Testing

  • Added direct validator coverage for:
    • disabled phase change;
    • missing num_fluids;
    • one fluid;
    • two fluids;
    • three fluids.
  • TestPhaseChangeFluidPairing: 5 passed.
  • Complete test_case_validator.py: 51 passed.
  • Complete ./mfc.sh lint: passed.
    • Ruff passed for toolchain, examples, and benchmarks.
    • 459 bundled tests passed with 8 warnings and 9 subtests passed.
  • Validator-only one-fluid probe: the new constraint was reported for all three
    validation stages.
  • Validator-only two-fluid phase-change probe: passed all three stages.
  • Unmodified 2D_phasechange_bubble positive control: passed all three stages.
  • Normal pre-commit hook: all seven stages passed.
  • git diff --check: passed.

No preprocessing or simulation of the unsafe one-fluid configuration was
performed.

Checklist

  • I added or updated tests for the new behavior.
  • The change is limited to the validator and focused validator tests.

The phase-change operator uses fixed liquid and vapor indices 1 and 2 and writes both fields. Reject one-fluid cases before input generation so that the vapor index cannot alias x-momentum.

Fixes MFlowCode#1738
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.59%. Comparing base (d4ffa29) to head (0e8f16c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1743   +/-   ##
=======================================
  Coverage   61.59%   61.59%           
=======================================
  Files          84       84           
  Lines       21493    21493           
  Branches     3176     3176           
=======================================
  Hits        13239    13239           
  Misses       6078     6078           
  Partials     2176     2176           

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

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

@sbryngelson
sbryngelson merged commit 21a4ebe into MFlowCode:master Aug 20, 2026
84 of 85 checks passed
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.

Validator accepts one-fluid adaptive Euler–Euler classes with phase relaxation despite fixed vapor index vp=2

2 participants