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

Create YAML file outputs in RMG for use in Cantera #2321

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

Commits on Apr 1, 2024

  1. Rename yml to rms, becuase it was specific to RMS

    This allows the Cantera yaml writer to live alongside it
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    f511c4a View commit details
    Browse the repository at this point in the history
  2. Creating yml_test.py file, looks exactly like yml.py but with 'rms' s…

    …ubstituted for 'yml'
    
    Attach the YAMLWriter listener
    
    Work on the yaml writing for cantera
    
    Renaming yml_test to cantera
    
    This is for writing Cantera yaml files
    
    updated set_cantera_kinetics in falloff.py
    
    spelled "high" wrong in set_cantera_kinetics
    
    added write_cantera_inputs to falloff.pyx for Troe reactions
    
    Fixing Lindemann and Troe
    
    deleted write_cantera_inputs,
    restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics
    for Lindemann and Troe reactions
    
    added efficiencies
    
    restructured cantera.py, now includes MultiArrhenius reactions
    
    added Chebyshev
    
    restructured and added in RMG equations
    
    added in Surface Arrhenius
    
    added sticking coefficient :)
    
    use_chemkin_identifier=True when making Cantera objects
    
    This uses the correct species names
    
    Dump yaml in the order of the dict, not alphabetical
    
    remove quotes from species names
    
    Handle duplicate reactions
    
    For MultiArrhenius and MultiPDepArrhenius kinetics
    we need to make more than one reaction in the
    list of reactions for Cantera yaml.
    (at least until this is implemented:
    Cantera/enhancements#132 )
    
    added the beginnings of the catalysis edits
    
    still need to edit 'state' and fix 'vector<double>' error
    
    fixed for catalysis.
    
    Separates gas and surface reactions in the "reactions" section.
    Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie
    
    wip changes for stickingcoeffcient issue
    
    fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase.
    
    Time for pull request?
    
    Removing comments
    
    Trying cantera 2.5+ from conda-forge in environment.yml
    
    I suspected that the unit tests are failing
    because the new code can't work with
    cantera 2.3 from the RMG channel
    
    Trying Cantera 2.5+ from cantera channel in environment.yml
    
    Added in doc strings to methods. Removed unused imports
    
    Removed unused import from reaction.py
    
    renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions
    
    Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully.
    
    restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx
    
    Minor stylish change in falloff.py/ troe to cantera
    
    cleaning up falloff.pyx after rebase conflicts
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0698a1e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    54640e3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ef5f568 View commit details
    Browse the repository at this point in the history
  5. Creating yml_test.py file, looks exactly like yml.py but with 'rms' s…

    …ubstituted for 'yml'
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    c5dd3a3 View commit details
    Browse the repository at this point in the history
  6. Attach the YAMLWriter listener

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    1717e75 View commit details
    Browse the repository at this point in the history
  7. Work on the yaml writing for cantera

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    971f624 View commit details
    Browse the repository at this point in the history
  8. Renaming yml_test to cantera

    This is for writing Cantera yaml files
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    135a640 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    81db64b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    586f91d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f6bfe02 View commit details
    Browse the repository at this point in the history
  12. Fixing Lindemann and Troe

    deleted write_cantera_inputs,
    restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics
    for Lindemann and Troe reactions
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    e3d8715 View commit details
    Browse the repository at this point in the history
  13. added efficiencies

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    244c712 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4be337c View commit details
    Browse the repository at this point in the history
  15. added Chebyshev

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0bbf4b3 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4949ddc View commit details
    Browse the repository at this point in the history
  17. added in Surface Arrhenius

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    34e962b View commit details
    Browse the repository at this point in the history
  18. added sticking coefficient :)

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0ab1834 View commit details
    Browse the repository at this point in the history
  19. use_chemkin_identifier=True when making Cantera objects

    This uses the correct species names
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    175d3b8 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    190f360 View commit details
    Browse the repository at this point in the history
  21. remove quotes from species names

    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    846c0b8 View commit details
    Browse the repository at this point in the history
  22. Handle duplicate reactions

    For MultiArrhenius and MultiPDepArrhenius kinetics
    we need to make more than one reaction in the
    list of reactions for Cantera yaml.
    (at least until this is implemented:
    Cantera/enhancements#132 )
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    6ef7b87 View commit details
    Browse the repository at this point in the history
  23. added the beginnings of the catalysis edits

    still need to edit 'state' and fix 'vector<double>' error
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    837e307 View commit details
    Browse the repository at this point in the history
  24. fixed for catalysis.

    Separates gas and surface reactions in the "reactions" section.
    Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    a8bc559 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    6e1ed58 View commit details
    Browse the repository at this point in the history
  26. fixed "sites" v. "size" problem, yaml_writer now works for catalysis …

    …and gas phase.
    
    Time for pull request?
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    28f80c8 View commit details
    Browse the repository at this point in the history
  27. Removing comments

    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    bab0f16 View commit details
    Browse the repository at this point in the history
  28. Trying cantera 2.5+ from conda-forge in environment.yml

    I suspected that the unit tests are failing
    because the new code can't work with
    cantera 2.3 from the RMG channel
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    5c61b42 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    c39cb50 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    899ef2e View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    da17893 View commit details
    Browse the repository at this point in the history
  32. renamed cantera.py to cantera_.py. Edited import statement in main.py…

    … to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    bd23fdd View commit details
    Browse the repository at this point in the history
  33. Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann re…

    …actions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully.
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0759ccc View commit details
    Browse the repository at this point in the history
  34. restructed set_cantera_kinetics() and to_cantera_kinetics() for Linde…

    …mann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx
    Nora-Khalil authored and rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0c5a304 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    e110aab View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    43bd964 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    6692742 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    1366709 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    0925dc5 View commit details
    Browse the repository at this point in the history
  40. Fix bug in yaml writing.

    Previously the if was always True
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    3fdb6e1 View commit details
    Browse the repository at this point in the history
  41. Minor refactor for clarity.

    I think this is the same.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    8428b92 View commit details
    Browse the repository at this point in the history
  42. Rename obj_to_dict --> species_to_dict

    Because that's what it is
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    9345a3a View commit details
    Browse the repository at this point in the history
  43. Trying to fix yaml (via cantera 2.6) for Lindemann kinetics

    The call
        rate = ct.LindemannRate(low_rate, high_rate, falloff)
    was causing 
        TypeError: Argument 'rate' has incorrect type (expected cantera._cantera.Arrhenius, got cantera._cantera.ArrheniusRate)
    
    I think the ct.LindemannRate expects an Arrhenius not an ArrheniusRate.
    Thdis was with cantera                   2.6.0            py37hb93dfd8_0    cantera
    running on the Ubuntu CI
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    5d35216 View commit details
    Browse the repository at this point in the history
  44. Tidy up cantera yaml writer. Trying to avoid major changes.

    Still doing things mostly the same way, just renaming variables,
    combining some blocks, removing X from the gas phase,
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    b2677f4 View commit details
    Browse the repository at this point in the history
  45. Tidying the cantera yaml writer

    Renamed some functions and (i think) simplified some loops
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    4ff908a View commit details
    Browse the repository at this point in the history
  46. Trying to fix yaml (via cantera 2.6) for Lindemann kinetics

    The call rmgpy/reaction.py:339: in rmgpy.reaction.Reaction.to_cantera
        rate = ct.TroeRate(
    was causing
        TypeError: Argument 'rate' has incorrect type (expected cantera._cantera.Arrhenius, got cantera._cantera.ArrheniusRate)
    
    I think the ct.LindemannRate expects an Arrhenius not an ArrheniusRate.
    Thdis was with cantera                   2.6.0            py37hb93dfd8_0    cantera
    running on the Ubuntu CI
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    3d8a6cf View commit details
    Browse the repository at this point in the history
  47. Removed the extra rmgpy/rectionTest.py

    This was moved into the testing folder.
    I don't think any of the other changes were deliberate.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    43202b1 View commit details
    Browse the repository at this point in the history
  48. Redefine gas inside reactionTest. (needed?)

    This had been done on a branch. Not sure if it is needed
    as things got moved in a confusing rebase.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    a6cf636 View commit details
    Browse the repository at this point in the history
  49. Restore rmgpy/kinetics/falloff.pyx to the version on main branch.

    I think final edits to this file were mostly just accidents in rebasing,
    and the version on main is probably ok.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    46946a1 View commit details
    Browse the repository at this point in the history
  50. Restore rmgpy/reaction.pxd to version on main

    I think this was a rebasing error.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    72db235 View commit details
    Browse the repository at this point in the history
  51. Tidy up reaction.py, removing fix_reaction

    This function is only used in one place for one very specific thing
    so I inlined it. It also had a vague name.
    
    I then commented it out, because I'm not clear why it's needed.
    If it is needed, we can restore it (and put a comment as to why)
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    8096877 View commit details
    Browse the repository at this point in the history
  52. Revert "Redefine gas inside reactionTest. (needed?)"

    The reactionTest.py is failing. From the failure I can't see why
    this would be the cause, but in the idea of change-one-thing-at-a-time
    I'm reverting the most recent change since I think the tests USED to pass.
    
    This reverts commit a8eaa3b.
    rwest committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    68dc922 View commit details
    Browse the repository at this point in the history