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

FalloffRate.third_body_concentration is not defined #1254

Closed
bryanwweber opened this issue Apr 28, 2022 · 0 comments · Fixed by #1257
Closed

FalloffRate.third_body_concentration is not defined #1254

bryanwweber opened this issue Apr 28, 2022 · 0 comments · Fixed by #1257
Labels

Comments

@bryanwweber
Copy link
Member

bryanwweber commented Apr 28, 2022

In FalloffRate.falloff_function(), the conc3b parameter can be passed as None, in which case self.third_body_concentration is used. However, FalloffRate.third_body_concentration is not defined in the pyx file, so this raises an attribute error:

import cantera as ct
gas = ct.Solution("gri30.yaml")
r = gas.reaction(11).rate
r.falloff_function(300)

I think we can improve the user experience in this case, either by eliminating the default argument or raising a more useful error message.

def falloff_function(self, double temperature, conc3b=None):
"""
Evaluate the falloff function
"""
if conc3b is None:
conc3b = self.third_body_concentration
return self.falloff.evalF(temperature, conc3b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants