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

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

Closed
connie opened this issue Sep 17, 2013 · 6 comments
Closed
Labels
abandoned abandoned issue/PR as determined by actions bot stale stale issue/PR as determined by actions bot

Comments

@connie
Copy link
Member

connie commented Sep 17, 2013

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.

@connie
Copy link
Member Author

connie commented Sep 18, 2013

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?

@rwest
Copy link
Member

rwest commented Sep 18, 2013

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.

@connie
Copy link
Member Author

connie commented Sep 18, 2013

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?

@rwest
Copy link
Member

rwest commented Sep 18, 2013

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.)

@connie
Copy link
Member Author

connie commented Jul 31, 2015

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?

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Jun 22, 2023
@github-actions github-actions bot added the abandoned abandoned issue/PR as determined by actions bot label Jul 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned abandoned issue/PR as determined by actions bot stale stale issue/PR as determined by actions bot
Projects
None yet
Development

No branches or pull requests

2 participants