Skip to content

Commit 016c763

Browse files
authored
Reject chemistry with num_fluids > 1 in case validator (#1472)
1 parent 81ce63b commit 016c763

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

toolchain/mfc/case_validator.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,15 @@ def check_chemistry(self):
13231323
# Fetch global chemistry and diffusion flags
13241324
chemistry = self.get("chemistry", "F") == "T"
13251325
diffusion = self.get("chem_params%diffusion", "F") == "T"
1326+
num_fluids = self.get("num_fluids")
1327+
1328+
# Chemistry assumes a single reacting gas phase: the temperature/pressure
1329+
# inversion recovers T from the total internal energy via Cantera's ideal-gas
1330+
# EOS (ignoring pi_inf), and the cons->prim conversion collapses all partial
1331+
# densities onto the species-summed total density. Both are only correct for
1332+
# num_fluids = 1; with a second (e.g. stiffened-gas) fluid the state is
1333+
# inconsistent and the simulation NaNs. See MFlowCode/MFC#1470.
1334+
self.prohibit(chemistry and num_fluids is not None and num_fluids != 1, "chemistry is only supported for single-component flows (num_fluids = 1)")
13261335

13271336
# Define what constitutes a wall (-15 for slip, -16 for no-slip)
13281337
wall_bcs = [-15, -16]

0 commit comments

Comments
 (0)