2929matplotlib .use ("Agg" )
3030
3131
32- # ---------------------------------------------------------------------------
3332# Configuration
34- # ---------------------------------------------------------------------------
3533CASE_DIR = "."
3634Y_MAJORS = {"H" , "O" , "OH" , "HO2" }
3735Y_MINORS = {"H2O" , "H2O2" }
4038skinner_induction_time = 0.052e-3 # Skinner & Ringrose (1965)
4139
4240
43- # ---------------------------------------------------------------------------
4441# Load MFC output
45- # ---------------------------------------------------------------------------
4642steps = discover_timesteps (CASE_DIR , "silo" )
4743if not steps :
4844 sys .exit ("No silo timesteps found — did you run post_process?" )
6157 for y in Y_VARS :
6258 mfc_Ys [y ].append (float (assembled .variables [f"Y_{ y } " ][mid ]))
6359
64- # ---------------------------------------------------------------------------
6560# Cantera 0-D reference
66- # ---------------------------------------------------------------------------
6761time_save = Tend / SAVE_COUNT
6862
6963
@@ -86,9 +80,7 @@ def generate_ct_saves():
8680
8781ct_ts , ct_Ys , ct_rhos = generate_ct_saves ()
8882
89- # ---------------------------------------------------------------------------
9083# Induction time: first step where [OH] molar concentration >= 1e-6 mol/m^3
91- # ---------------------------------------------------------------------------
9284
9385
9486def find_induction_time (ts , Ys_OH , rhos ):
@@ -106,9 +98,7 @@ def find_induction_time(ts, Ys_OH, rhos):
10698print (f" Cantera: { ct_induction :.3e} s" if ct_induction is not None else " Cantera: not reached" )
10799print (f" (Che)MFC: { mfc_induction :.3e} s" if mfc_induction is not None else " (Che)MFC: not reached" )
108100
109- # ---------------------------------------------------------------------------
110101# Plot
111- # ---------------------------------------------------------------------------
112102fig , axes = plt .subplots (1 , 2 , figsize = (12 , 6 ))
113103_colors = plt .rcParams ["axes.prop_cycle" ].by_key ()["color" ]
114104_color = {y : _colors [i % len (_colors )] for i , y in enumerate (sorted (Y_VARS ))}
0 commit comments