Skip to content

Commit

Permalink
f! IDT
Browse files Browse the repository at this point in the history
  • Loading branch information
NellyMitnik authored and alongd committed Jul 7, 2024
1 parent d9572ca commit 0216229
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions t3/simulate/cantera_IDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,12 @@ def simulate(self):
for P in P_list:
for T in T_list:
self.model.TPX = T, P * 1e5, X
self.idt_dict[(0, P, T)] = \
self.simulate_idt(fig_name=f'R{r}_{round(P,2)}_bar_{round(T,2)}_K.png')
if equivalence_ratios is None:
self.idt_dict[(0, P, T)] = \
self.simulate_idt(fig_name=f'R{r}_{round(P,2)}_bar_{round(T,2)}_K.png')
else:
self.idt_dict[(equivalence_ratios[i], P, T)] = \
self.simulate_idt(fig_name=f'R{r}_{equivalence_ratios[i]}_{round(P,2)}_bar_{round(T,2)}_K.png')
if len(T_list) >= 3:
plot_idt_vs_temperature(self.idt_dict, figs_path=self.paths['figs'], reactor_index=r)
reactor_idt_dict[r] = self.idt_dict
Expand Down Expand Up @@ -392,11 +396,10 @@ def plot_idt_vs_temperature(idt_dict: dict,
ax.set_xlabel('1000/T (1/K)')
ax.set_ylabel('IDT (s)')
ax.set_title(f'IDT vs. 1000/T, phi = {phi}, P = {p} bar')
ax.scatter(phi_p_data.keys(), phi_p_data.values(),label='simulation', color='blue',marker="o")
ax.scatter(phi_p_data.keys(), phi_p_data.values(), label='simulation', color='blue', marker="o")
ax.set_yscale('log')
#Add experimental data specified by the user
if exp_data is not None:
ax.scatter(exp_data[0], exp_data[1], label='experiment', color='orange',marker="D")
ax.scatter(exp_data[0], exp_data[1], label='experiment', color='orange', marker="D")
ax.set_yscale('log')
ax.legend(loc='lower right')
fig.savefig(os.path.join(figs_path, fig_name))
Expand Down

0 comments on commit 0216229

Please sign in to comment.