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

Used Cantera reaction rate coefficient units #416

Closed
wants to merge 1 commit into from
Closed

Used Cantera reaction rate coefficient units #416

wants to merge 1 commit into from

Conversation

jAnirudh
Copy link
Contributor

@jAnirudh jAnirudh commented Sep 8, 2023

Proposed fix to #318 for computing the production rates for elementary reactions with FORD reactions

The reaction rate coefficients appearing as ctuc in ceptr/production.py are computed directly from Cantera, except for Three-Body reactions, which are made to work according to Cantera's legacy behaviour as discussed in #323.

These changes are reflected in the comp_qfqr, productionRate and the productionRate_Light methods of the corresponding mechanism.H files.

This fix should immediately work for FORD reactions when not using the analytic Jacobian.

@marchdf marchdf requested a review from malihass September 8, 2023 14:52
@malihass
Copy link
Collaborator

malihass commented Sep 8, 2023

Thanks for the PR!
So instead of doing this, #414 adjusts the value of dim which is a little bit cleaner than the string operations.
Would you please be able to try and see if #414 fixes that issue for you?

@jAnirudh
Copy link
Contributor Author

jAnirudh commented Sep 8, 2023

No worries :)

I am not a fan of the string operations myself honestly. Ideally I'd have liked Cantera to simply give me the rate coefficient unit directly without me having to do any string manipulations. Maybe this is something the Cantera folks may like to consider for us.

However, I found this way to be much easier to follow and keep track of than modifying dim when adding new reactions. Here, irrespective of the kind of reaction, if Cantera supports it we're sure to get the same dim. This makes it much easier to implement new reactions plus there are fewer and more localized changes to track which is good for maintainability IMO.

Anyway, while I haven't been able to go through all the code changes in production.py and util.py, this change and #414 give identical mechanism.H files for the 3 methods I've mentioned. So we essentially have 2 ways to solve the problem :)

@malihass
Copy link
Collaborator

malihass commented Sep 8, 2023

OK, I am going to close this since this results in the same mechanisms. Thanks for bringing these FORD issues to our attention!

@malihass malihass closed this Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants