ReactionMechanismGenerator / ReactionMechanismGenerator/RMG-Py

Solution phase models might include PDep rates from libraries

Open
#1,872 4 comments 0 reactions 1 assignee View on GitHub

@hwpang is already working on this.

Since Jul 29, 2020.

bug
Dominant language
Python
Stars
530
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
8

Description

Bug Description

If a kinetic library has pressure-dependent rates, and this library is used in a simulation involving a LiquidReactor, some of these rates end up in the core, making RMG crash when it checks the model:

  File "/home/alongd/Code/RMG-Py/rmgpy/rmg/main.py", line 982, in execute
    self.check_model()
  File "/home/alongd/Code/RMG-Py/rmgpy/rmg/main.py", line 1202, in check_model
    p_min=self.Pmin, p_max=self.Pmax)
  File "rmgpy/reaction.py", line 1217, in rmgpy.reaction.Reaction.check_collision_limit_violation
  File "rmgpy/reaction.py", line 1250, in rmgpy.reaction.Reaction.check_collision_limit_violation
  File "rmgpy/kinetics/arrhenius.pyx", line 775, in rmgpy.kinetics.arrhenius.PDepArrhenius.get_rate_coefficient
  File "rmgpy/kinetics/arrhenius.pyx", line 785, in rmgpy.kinetics.arrhenius.PDepArrhenius.get_rate_coefficient
ValueError: No pressure specified to pressure-dependent PDepArrhenius.get_rate_coefficient().

Although this is a conflict in the user's definitions (use LiquidReactor and use a library with PDep expressions), I still think this is a bug, since we don't warn not to do so, and RMG should have caught that on time, either crashing with a helpful error message or dealing with it appropriately (see suggestion below).

How To Reproduce

Run a LiquidReactor simulation with the NOx2018 kinetic library including methanol in the initial species (so that OH + CH3 = CH3OH, for example, is taken from that library), or with one of the BurkeH2O2 kinetic libraries with H2 as a core species.

Expected Behavior

I would expect RMG to at least try taking the high pressure limit rate from a pdep expression, if available (we already have the functionality to do that: https://github.com/ReactionMechanismGenerator/RMG-Py/blob/master/rmgpy/data/kinetics/library.py#L150). If unavailable, we need to decide whether to crash with a helpful message, or warn the user while ignoring that library reaction.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.