Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute IDT and IDT SA using Cantera #150

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Compute IDT and IDT SA using Cantera #150

wants to merge 19 commits into from

Conversation

alongd
Copy link
Member

@alongd alongd commented May 2, 2024

Added the Cantera IDT adapter
Allow users to specify "roles" (fuel, oxygen, nitrogen) to species, and compute equivalence ratios automatically

alongd and others added 19 commits May 1, 2024 08:53
Also added descriptions to commented input
f! schema
f! common

f! common determine_concentrations_by_equivalence_ratios()
f! cantera idt

canera idt

working

cantera idt

cantera idt

cantera idt

Cantera IDT

Round T,P values in figures' names
f! tests cantera ?

cantera idt tests

f! tests

tst cantera idt

f! cantera idt tests
Save sa_dict

Added paths to main
…lot.

Also changed style to scatter plot with 100 points of simulations.
plt.xlim(x_min, x_max)
plt.savefig(os.path.join(figs_path, fig_name))
plt.close()
except (AttributeError, ValueError):

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
ax.set_yscale('log')
ax.legend(loc='lower right')
fig.savefig(os.path.join(figs_path, fig_name))
except (AttributeError, ValueError):

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
Comment on lines +161 to +162
# for i in range(self.model.n_reactions):
# reactor.add_sensitivity_reaction(i)

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +262 to +285
# for condition_data in self.all_data:
# time, data_list, reaction_sensitivity_data, thermodynamic_sensitivity_data = condition_data
# sa_dict['time'] = time.data
#
# # extract kinetic SA
# for rxn in reaction_sensitivity_data:
# # for kinetics, get `ethane(1)` from `dln[ethane(1)]/dln[k8]: H(6)+ethane(1)=H2(12)+C2H5(5)`
# observable_label = rxn.label.split('[')[1].split(']')[0]
# if observable_label not in sa_dict['kinetics']:
# sa_dict['kinetics'][observable_label] = dict()
# # for kinetics, get k8 from `dln[ethane(1)]/dln[k8]: H(6)+ethane(1)=H2(12)+C2H5(5)` then only extract 8
# parameter = rxn.label.split('[')[2].split(']')[0]
# parameter = int(parameter[1:])
# sa_dict['kinetics'][observable_label][parameter] = rxn.data
#
# # extract thermo SA
# for spc in thermodynamic_sensitivity_data:
# # for thermo get 'C2H4(8)' from `dln[ethane(1)]/dH[C2H4(8)]`
# observable_label = spc.label.split('[')[1].split(']')[0]
# if observable_label not in sa_dict['thermo']:
# sa_dict['thermo'][observable_label] = dict()
# # for thermo get 'C2H4(8)' from `dln[ethane(1)]/dH[C2H4(8)]`
# parameter = spc.label.split('[')[2].split(']')[0]
# sa_dict['thermo'][observable_label][parameter] = spc.data

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

from arc.common import save_yaml_file

from rmgpy.chemkin import load_chemkin_file

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'load_chemkin_file' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants