@@ -135,8 +135,12 @@ def simulate(self):
135135 for P in P_list :
136136 for T in T_list :
137137 self .model .TPX = T , P * 1e5 , X
138- self .idt_dict [(0 , P , T )] = \
139- self .simulate_idt (fig_name = f'R{ r } _{ round (P ,2 )} _bar_{ round (T ,2 )} _K.png' )
138+ if equivalence_ratios is None :
139+ self .idt_dict [(0 , P , T )] = \
140+ self .simulate_idt (fig_name = f'R{ r } _{ round (P ,2 )} _bar_{ round (T ,2 )} _K.png' )
141+ else :
142+ self .idt_dict [(equivalence_ratios [i ], P , T )] = \
143+ self .simulate_idt (fig_name = f'R{ r } _{ equivalence_ratios [i ]} _{ round (P ,2 )} _bar_{ round (T ,2 )} _K.png' )
140144 if len (T_list ) >= 3 :
141145 plot_idt_vs_temperature (self .idt_dict , figs_path = self .paths ['figs' ], reactor_index = r )
142146 reactor_idt_dict [r ] = self .idt_dict
@@ -392,11 +396,10 @@ def plot_idt_vs_temperature(idt_dict: dict,
392396 ax .set_xlabel ('1000/T (1/K)' )
393397 ax .set_ylabel ('IDT (s)' )
394398 ax .set_title (f'IDT vs. 1000/T, phi = { phi } , P = { p } bar' )
395- ax .scatter (phi_p_data .keys (), phi_p_data .values (),label = 'simulation' , color = 'blue' ,marker = "o" )
399+ ax .scatter (phi_p_data .keys (), phi_p_data .values (), label = 'simulation' , color = 'blue' , marker = "o" )
396400 ax .set_yscale ('log' )
397- #Add experimental data specified by the user
398401 if exp_data is not None :
399- ax .scatter (exp_data [0 ], exp_data [1 ], label = 'experiment' , color = 'orange' ,marker = "D" )
402+ ax .scatter (exp_data [0 ], exp_data [1 ], label = 'experiment' , color = 'orange' , marker = "D" )
400403 ax .set_yscale ('log' )
401404 ax .legend (loc = 'lower right' )
402405 fig .savefig (os .path .join (figs_path , fig_name ))
0 commit comments