Auto-Mech / mechanalyzer

Tools construction, manipulation, visualization of chemical mechanisms
MIT License
3 stars 15 forks source link

submech options #297

Closed lpratalimaffei closed 1 month ago

lpratalimaffei commented 2 months ago

I finally got to restructure the "submech" options we talked about a while ago @sjklipp @cmulvihill .

Some examples are found in the tests, in particular for inputs of "sort.dat" files I decided to add filtering options based on a given stoichiometry such that we can delete all species below or above a stoichiometry selected by the user.

More or less, here are the things we can do now

  1. extract all reactions where one or more species appear mechanalyzer/tests/data/sort_singlespecies.dat (need the singlespecies = True active) if multiple species are specified, the "singlespecies = True" is not necessary

  2. extract a submechanism for a fuel, i.e., all reactions with species with given stoichiometries like R, RO2, ... mechanalyzer/tests/data/sort_mech.dat

  3. extract both the submechanism and 3.1 all other reactions involving species with stoichiometry above a declared one (default options available) mechanalyzer/tests/data/sort_submech_deletelarge.dat 3.2 all other reactions involving species with stoichiometry below a declared one (default options available) mechanalyzer/tests/data/sort_submech_keepsubfuel.dat

  4. If one does not specify a species in "isolate_submech" section but only au upper or lower limit stoichiometry, the code will not go through the submech extraction section

I think with these options we can cover most of the things we want without hardcoded changes like those I made a while ago to extract butane submech. Unfortunately the tests are a bit slow but it doesn't make a lot of sense to test very small sets of reactions. This is of course open to discussion and possible changes!

sjklipp commented 2 months ago

Thanks Luna. That sounds great. As our code progresses, and as I observe what other teams are doing, I am coming to the conclusion that AutoMech's greatest utility will be in the fact that we can directly connect to existing mechanisms and simplify the updating process through substantive calculations. What you have done is a valuable step in that direction.


From: Luna Pratali Maffei @.> Sent: Friday, August 23, 2024 9:36 AM To: Auto-Mech/mechanalyzer @.> Cc: Klippenstein, Stephen J. @.>; Mention @.> Subject: [Auto-Mech/mechanalyzer] submech options (PR #297)

This Message Is From an External Sender This message came from outside your organization.

I finally got to restructure the "submech" options we talked about a while ago @sjklipphttps://urldefense.us/v3/__https://github.com/sjklipp__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ_Zqhx1u$ @cmulvihillhttps://urldefense.us/v3/__https://github.com/cmulvihill__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ2W8TStM$ .

Some examples are found in the tests, in particular for inputs of "sort.dat" files I decided to add filtering options based on a given stoichiometry such that we can delete all species below or above a stoichiometry selected by the user.

More or less, here are the things we can do now

  1. extract all reactions where one or more species appear mechanalyzer/tests/data/sort_singlespecies.dat (need the singlespecies = True active) if multiple species are specified, the "singlespecies = True" is not necessary

  2. extract a submechanism for a fuel, i.e., all reactions with species with given stoichiometries like R, RO2, ... mechanalyzer/tests/data/sort_mech.dat

  3. extract both the submechanism and 3.1 all other reactions involving species with stoichiometry above a declared one (default options available) mechanalyzer/tests/data/sort_submech_deletelarge.dat 3.2 all other reactions involving species with stoichiometry below a declared one (default options available) mechanalyzer/tests/data/sort_submech_keepsubfuel.dat

  4. If one does not specify a species in "isolate_submech" section but only au upper or lower limit stoichiometry, the code will not go through the submech extraction section

I think with these options we can cover most of the things we want without hardcoded changes like those I made a while ago to extract butane submech. Unfortunately the tests are a bit slow but it doesn't make a lot of sense to test very small sets of reactions. This is of course open to discussion and possible changes!


You can view, comment on, or merge this pull request online at:

https://github.com/Auto-Mech/mechanalyzer/pull/297https://urldefense.us/v3/__https://github.com/Auto-Mech/mechanalyzer/pull/297__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ0e0Tr5I$

Commit Summary

File Changes

(13 fileshttps://urldefense.us/v3/__https://github.com/Auto-Mech/mechanalyzer/pull/297/files__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ6--G57c$)

Patch Links:

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https://github.com/Auto-Mech/mechanalyzer/pull/297__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ0e0Tr5I$, or unsubscribehttps://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AIJEZPUYNDKNZL243ECOXRDZS5CILAVCNFSM6AAAAABNAJ54Q2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DGMRZGAYDMMQ__;!!G_uCfscf7eWS!c4DQgv6ytM_ZZPEnZTgzRjvdXuKF2EI4SYXqLHIV5b6Af5Zvo_1j688aosw63Sdf1Ayaufip-RaPQ40gl5Eg$. You are receiving this because you were mentioned.