Skip to content

Cases set only the parameters their equation of state reads - #1808

Open
sbryngelson wants to merge 3 commits into
MFlowCode:masterfrom
sbryngelson:fix/eos-parameter-ownership
Open

Cases set only the parameters their equation of state reads#1808
sbryngelson wants to merge 3 commits into
MFlowCode:masterfrom
sbryngelson:fix/eos-parameter-ownership

Conversation

@sbryngelson

@sbryngelson sbryngelson commented Sep 3, 2026

Copy link
Copy Markdown
Member

An ideal gas has no stiffness, yet most cases that select eos = 'ideal_gas' also set pi_inf. The solver already ignores it (pi_infs is zeroed for an ideal gas at init), so the value is a lie in the case file. The validator now refuses pi_inf on an ideal gas outright, rather than only a nonzero one, and the dead lines are removed everywhere they occur: 141 lines across 117 examples, 19 inside the regression-test definitions, and the one in the suite's base configuration, whose fluid was already declared an ideal gas. All 741 test definitions validate against the new rule. Golden files do not move because the init already ignored the value.

Copilot AI lite review requested due to automatic review settings September 3, 2026 00:03
@sbryngelson
sbryngelson force-pushed the fix/eos-parameter-ownership branch 2 times, most recently from bca2215 to 8a43666 Compare September 3, 2026 00:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR tightens EOS configuration validity by forbidding pi_inf when eos = "ideal_gas", removes now-invalid pi_inf entries from example/test cases, and updates the test harness so case modifications can explicitly remove inherited base keys.

Changes:

  • Enforce “ideal gas has no pi_inf parameter” in the case validator and update associated validator messaging.
  • Extend the test case merge logic so None in a case’s modifications unsets an inherited base key.
  • Remove pi_inf from numerous example case configs and adjust EOS selector tests accordingly.

Reviewed changes

Copilot reviewed 121 out of 121 changed files in this pull request and generated no comments.

Show a summary per file
File Description
toolchain/mfc/test/cases.py Updates regression cases to remove inherited pi_inf when switching to ideal_gas, and removes redundant pi_inf entries from generated configs.
toolchain/mfc/test/case.py Adds “None unsets base key” behavior when merging BASE_CFG with per-case modifications.
toolchain/mfc/params_tests/test_eos_selector.py Updates EOS selector tests to expect pi_inf to be rejected for ideal gas and verifies the new error message.
toolchain/mfc/case_validator.py Changes the validator rule to prohibit setting pi_inf for ideal gas (even if zero) and updates the explanatory text/error message.
examples/3D_turb_mixing/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_sphbubcollapse/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_rotating_sphere/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_recovering_sphere/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_rayleigh_taylor_muscl/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_rayleigh_taylor/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_performance_test/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_patch_spherical_harmonic/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_moving_lag_particles/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_mibm_sphere_head_on_collision/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_mibm_periodic_collision/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_lagrange_shbubcollapse/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_lagrange_bubblescreen/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_icpp_stl_cube/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_ibm_stl_test/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_ibm_stl_pyramid/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_ibm_stl_ellipsoid/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_ibm_bowshock/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_brio_wu/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_advection_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_TaylorGreenVortex_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_TaylorGreenVortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_IGR_jet_1fluid/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_IGR_jet/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_IGR_TaylorGreenVortex_nvidia/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_IGR_TaylorGreenVortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/3D_IGR_33jet/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_zero_circ_vortex_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_zero_circ_vortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_viscous_shock_tube/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_tumbling_rectangle/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_triple_point/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_synthetic_turbulence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_shockdroplet_muscl/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_shockdroplet/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_shockbubble/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_shock_cloud_rmhd/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_riemann_test_muscl/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_riemann_test/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_richtmyer_meshkov/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_rayleigh_taylor/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_poiseuille_thickening_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_poiseuille_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_patch_modal_shape_exp/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_patch_modal_shape/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_orszag_tang_hyper_cleaning/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_orszag_tang/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_moving_lag_bubs/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_mibm_shock_cylinder/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_mibm_particle_cloud/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_mibm_cylinder_in_cross_flow/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_mhd_rotor/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_mhd_magnetic_vortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_lid_driven_cavity_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_lid_driven_cavity/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_laplace_pressure_jump/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_lagrange_rising_bubble/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_lagrange_in_crossflow/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_lagrange_bubblescreen/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_kelvin_helmholtz/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_jet/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_isentropicvortex_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_isentropicvortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_icpp_stl_circle/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_viscous_drag_over_cylinder/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_stl_wedge/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_stl_test/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_stl_MFCCharacter/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_poiseuille_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_multiphase/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_ellipse/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_cfl_dt/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm_airfoil/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_ibm/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_hypo_shear_contact/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_herschel_bulkley_poiseuille_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_hardcoded_ic/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_forward_facing_step/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_bingham_poiseuille_nn/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_backward_facing_step/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_axisym_shockbubble/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_advection_muscl/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_advection_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_advection/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_acoustic_pulse_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_acoustic_pulse/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_acoustic_broadband/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_TaylorGreenVortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_IGR_triple_point/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_IGR_2fluid/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/2D_GreshoVortex/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_vacuum_restart/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_vacuum/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_titarevtorro_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_titarevtorro/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_sodshocktube_muscl/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_sodshocktube/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_sod_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_wenoz5/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_wenom5/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_wenojs5/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_teno7/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_teno5/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_old/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_shuosher_analytical/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_mhd_smooth_alfven_wave/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_laxshocktube/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_kapilashocktube/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_hypo_2materials/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_euler_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_dai_woodward_hlld/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_dai_woodward/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_brio_wu_rmhd/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_brio_wu_hlld/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_brio_wu/case.py Removes pi_inf from ideal-gas fluid configuration.
examples/1D_advection_convergence/case.py Removes pi_inf from ideal-gas fluid configuration.
Suppressed comments (3)

toolchain/mfc/test/case.py:1

  • The None-filtering is performed twice (line 171 already drops None values; line 172 repeats the same logic). This duplication makes the merge behavior harder to reason about and maintain. Remove the second filtering pass, or (if the second pass is intended to be different) adjust it to handle a distinct concern (e.g., only drop None originating from mods).
    toolchain/mfc/case_validator.py:1
  • This string literal is split into two adjacent string tokens (\"... may not \" \"set ...\"), which relies on Python's implicit concatenation and is easy to misread/edit incorrectly (and can accidentally introduce spacing issues). Convert this to a single string literal (or a deliberate multi-line concatenation with clearer formatting) to improve readability and reduce the chance of subtle message formatting bugs.
    toolchain/mfc/params_tests/test_eos_selector.py:1
  • The validator rule is phrased as 'do not set pi_inf', but the first assertion passes pi_inf: None (which is still a set key at the call site, even if downstream treats None like missing). To align the test with the intended contract, prefer calling _errors without the fluid_pp(1)%pi_inf key entirely to represent 'unset'. Also, assert len(errors) == 1 is brittle if future validation adds additional errors; consider asserting that at least one error contains the expected substring (and optionally that no error mentions a different cause) rather than hard-coding the count.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sbryngelson
sbryngelson force-pushed the fix/eos-parameter-ownership branch from 8a43666 to 4d58aa7 Compare September 3, 2026 00:37
…eck passes from worktrees

(cherry picked from commit 5ad5c85)
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.

2 participants