From 08b3b735ec867ba2eec5911ce836a4f1bd52fa91 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 8 May 2026 14:38:55 -0400 Subject: [PATCH 1/2] Validate riemann_solver: require explicit value, remove unimplemented option 3 - case_validator.py: prohibit None riemann_solver (was silently ignored), restrict valid choices to [1,2,4,5], update wave_speeds/avg_state dependency checks accordingly - definitions.py: remove riemann_solver=3 (Exact) from choices and value_labels since it has never been implemented and silently dispatched nothing at runtime Fixes #1410 --- toolchain/mfc/case_validator.py | 8 ++++---- toolchain/mfc/params/definitions.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolchain/mfc/case_validator.py b/toolchain/mfc/case_validator.py index 687431f54b..c0fb969be9 100644 --- a/toolchain/mfc/case_validator.py +++ b/toolchain/mfc/case_validator.py @@ -673,16 +673,16 @@ def check_riemann_solver(self): cyl_coord = self.get("cyl_coord", "F") == "T" viscous = self.get("viscous", "F") == "T" + self.prohibit(riemann_solver is None, "riemann_solver must be specified (1=HLL, 2=HLLC, 4=HLLD, 5=Lax-Friedrichs)") if riemann_solver is None: return - self.prohibit(riemann_solver < 1 or riemann_solver > 5, "riemann_solver must be 1, 2, 3, 4 or 5") + self.prohibit(riemann_solver not in [1, 2, 4, 5], "riemann_solver must be 1 (HLL), 2 (HLLC), 4 (HLLD), or 5 (Lax-Friedrichs)") self.prohibit(riemann_solver != 2 and model_eqns == 3, "6-equation model (model_eqns = 3) requires riemann_solver = 2 (HLLC)") self.prohibit(wave_speeds is not None and wave_speeds not in [1, 2], "wave_speeds must be 1 or 2") - self.prohibit(riemann_solver == 3 and wave_speeds is not None, "Exact Riemann (riemann_solver = 3) does not support wave_speeds") self.prohibit(avg_state is not None and avg_state not in [1, 2], "avg_state must be 1 or 2") - self.prohibit(riemann_solver not in [3, 5] and wave_speeds is None, "wave_speeds must be set if riemann_solver != 3,5") - self.prohibit(riemann_solver not in [3, 5] and avg_state is None, "avg_state must be set if riemann_solver != 3,5") + self.prohibit(riemann_solver != 5 and wave_speeds is None, "wave_speeds must be set for riemann_solver 1, 2, or 4") + self.prohibit(riemann_solver != 5 and avg_state is None, "avg_state must be set for riemann_solver 1, 2, or 4") self.prohibit(low_Mach not in [0, 1, 2], "low_Mach must be 0, 1, or 2") self.prohibit(riemann_solver != 2 and low_Mach == 2, "low_Mach = 2 requires riemann_solver = 2") self.prohibit(low_Mach != 0 and model_eqns not in [2, 3], "low_Mach = 1 or 2 requires model_eqns = 2 or 3") diff --git a/toolchain/mfc/params/definitions.py b/toolchain/mfc/params/definitions.py index 66166f43c8..ccc4b10a73 100644 --- a/toolchain/mfc/params/definitions.py +++ b/toolchain/mfc/params/definitions.py @@ -623,8 +623,8 @@ def get_value_label(param_name: str, value: int) -> str: }, # Riemann solver "riemann_solver": { - "choices": [1, 2, 3, 4, 5], - "value_labels": {1: "HLL", 2: "HLLC", 3: "Exact", 4: "HLLD", 5: "Lax-Friedrichs"}, + "choices": [1, 2, 4, 5], + "value_labels": {1: "HLL", 2: "HLLC", 4: "HLLD", 5: "Lax-Friedrichs"}, }, "wave_speeds": { "choices": [1, 2], From 249ecc417ced45384b95a8d148b3c30a7f3dea47 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 9 May 2026 09:17:24 -0400 Subject: [PATCH 2/2] fix: add riemann_solver=5 to IGR benchmark and examples --- benchmarks/igr/case.py | 1 + examples/2D_IGR_2fluid/case.py | 1 + examples/2D_IGR_triple_point/case.py | 1 + examples/3D_IGR_33jet/case.py | 1 + examples/3D_IGR_TaylorGreenVortex/case.py | 1 + examples/3D_IGR_TaylorGreenVortex_nvidia/case.py | 1 + examples/3D_IGR_jet/case.py | 1 + examples/3D_IGR_jet_1fluid/case.py | 1 + 8 files changed, 8 insertions(+) diff --git a/benchmarks/igr/case.py b/benchmarks/igr/case.py index 52331297e2..65a4ee2f83 100644 --- a/benchmarks/igr/case.py +++ b/benchmarks/igr/case.py @@ -69,6 +69,7 @@ "num_patches": 1, "model_eqns": 2, "num_fluids": 1, + "riemann_solver": 5, "time_stepper": 3, "bc_x%beg": -1, "bc_x%end": -1, diff --git a/examples/2D_IGR_2fluid/case.py b/examples/2D_IGR_2fluid/case.py index 3b7f520d9d..774930a0ad 100644 --- a/examples/2D_IGR_2fluid/case.py +++ b/examples/2D_IGR_2fluid/case.py @@ -45,6 +45,7 @@ "mixture_err": "T", "mpp_lim": "F", "time_stepper": 3, + "riemann_solver": 5, "bc_x%beg": -1, "bc_x%end": -1, "bc_y%beg": -1, diff --git a/examples/2D_IGR_triple_point/case.py b/examples/2D_IGR_triple_point/case.py index cf0708419c..441365b579 100755 --- a/examples/2D_IGR_triple_point/case.py +++ b/examples/2D_IGR_triple_point/case.py @@ -30,6 +30,7 @@ "alt_soundspeed": "F", "num_fluids": 2, "time_stepper": 3, + "riemann_solver": 5, "elliptic_smoothing": "T", "elliptic_smoothing_iters": 50, "igr": "T", diff --git a/examples/3D_IGR_33jet/case.py b/examples/3D_IGR_33jet/case.py index d7b32157a6..f999ad4494 100644 --- a/examples/3D_IGR_33jet/case.py +++ b/examples/3D_IGR_33jet/case.py @@ -52,6 +52,7 @@ "num_fluids": 1, "mpp_lim": "F", "time_stepper": 3, + "riemann_solver": 5, "igr": "T", "igr_order": 3, "igr_pres_lim": "T", diff --git a/examples/3D_IGR_TaylorGreenVortex/case.py b/examples/3D_IGR_TaylorGreenVortex/case.py index f10c503746..79553de313 100644 --- a/examples/3D_IGR_TaylorGreenVortex/case.py +++ b/examples/3D_IGR_TaylorGreenVortex/case.py @@ -49,6 +49,7 @@ "model_eqns": 2, "num_fluids": 1, "time_stepper": 3, + "riemann_solver": 5, "bc_x%beg": -1, "bc_x%end": -1, "bc_y%beg": -1, diff --git a/examples/3D_IGR_TaylorGreenVortex_nvidia/case.py b/examples/3D_IGR_TaylorGreenVortex_nvidia/case.py index daf00de189..df1c2d202f 100644 --- a/examples/3D_IGR_TaylorGreenVortex_nvidia/case.py +++ b/examples/3D_IGR_TaylorGreenVortex_nvidia/case.py @@ -54,6 +54,7 @@ "model_eqns": 2, "num_fluids": 1, "time_stepper": 3, + "riemann_solver": 5, "bc_x%beg": -1, "bc_x%end": -1, "bc_y%beg": -1, diff --git a/examples/3D_IGR_jet/case.py b/examples/3D_IGR_jet/case.py index e0062f0991..9529615996 100644 --- a/examples/3D_IGR_jet/case.py +++ b/examples/3D_IGR_jet/case.py @@ -78,6 +78,7 @@ "num_fluids": 2, "mpp_lim": "T", "time_stepper": 3, + "riemann_solver": 5, "igr": "T", "igr_order": 3, "igr_pres_lim": "T", diff --git a/examples/3D_IGR_jet_1fluid/case.py b/examples/3D_IGR_jet_1fluid/case.py index 45ab4e3b49..6837a5deec 100644 --- a/examples/3D_IGR_jet_1fluid/case.py +++ b/examples/3D_IGR_jet_1fluid/case.py @@ -53,6 +53,7 @@ "num_fluids": 1, "mpp_lim": "F", "time_stepper": 3, + "riemann_solver": 5, "igr": "T", "igr_order": 5, "igr_pres_lim": "T",