Skip to content

Segmentation fault when setting inert species as reactive in input file #148

Closed as not planned

Description

@connie

I noticed that adding an inert species such as Argon to the input file incorrectly as a reactive species leads to a Segmentation Fault without any warnings. It would be nice if RMG gave some sort of other error message instead of just crashing.

species(
    label='Ar',
    reactive=True,
    structure=SMILES("[Ar]"),
)

If the species is found in ANY reaction library (i.e. not in RMG families), then there is no such error.

Activity

  1. connie commented on Sep 18, 2013

    @connie
    MemberAuthor

    Correction to the above- if the species is set to reactive = True in ANY case, including if it is found in a reaction library, the job will crash with a segmentation fault.

    However, even if reactive = False, it will add library reactions including the species into the core. AND it will incorporate the kinetics of that reaction. Therefore even if something is labeled as inert, if a library reaction consumes it, the concentration will change. So I guess in Py the reactive = False simply means that we don't use rate rules to look for reactions?

  2. rwest commented on Sep 18, 2013

    @rwest
    Member

    the reactive = False simply means that we don't use rate rules to look for reactions?

    I guess so. We could make it filter out reaction libraries too. What about a seed mechanism though? Are there ever occasions when you'd want to include known reactions but turn off RMG? (as currently occurs).
    At very least, current behaviour should be explained in the documentation.

  3. connie commented on Sep 18, 2013

    @connie
    MemberAuthor

    In fact I am currently using it for the purpose of having reactions that RMG does not detect involving chlorine. So it kind of works out for me. However, I could see this being a problem because you would think that reactive=False means that no reactions involving the species get added whatsoever.

    I wonder what the behavior would be if we didn't use any reaction libraries and set a hydrocarbon species as nonreactive?

  4. rwest commented on Sep 18, 2013

    @rwest
    Member

    My feeling is that reactive=False should probably turn off reaction discovery, whether from libraries or templates, but that anything put in a seed mechanism should be already in the core. (This smells a bit to the perennial problem of reaction libraries vs kinetics libraries.)

  5. connie commented on Jul 31, 2015

    @connie
    MemberAuthor

    The segmentation faults no longer occur. It looks like when a species is set to not reactive, no new reactions are generated when it is added to core (rmgpy.rmg.model line 612):

    if not newSpecies.reactive:
        logging.info('NOT generating reactions for unreactive species {0}'.format(newSpecies))
    else:
        logging.info('Adding species {0} to model core'.format(newSpecies))
        display(newSpecies) # if running in IPython --pylab mode, draws the picture!
    
        # Find reactions involving the new species as unimolecular reactant
        # or product (e.g. A <---> products)
        newReactions.extend(self.react(database, newSpecies))
    

    However, because the species is in the core, if for instance a reaction in RMG exists such as

    A + I (inert) = B + C

    and species A is formed and added to the core at some later time, this probably means that species I will end up reacting? This should probably be prevented completely. If the user specifically wants even a normal hydrocarbon species not to react, RMG should not react it. Perhaps that means adding it specifically to the forbidden structures list?

  6. github-actions commented on Jun 22, 2023

    @github-actions

    This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

  7. added
    stale
    on Jun 22, 2023
  8. added
    abandoned
    on Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    abandonedstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions