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

DILUTE Error with Latest Stoichiometry Update #515

Merged
merged 7 commits into from
Jan 7, 2024

Conversation

AlfredMayhew
Copy link
Collaborator

I have noticed that all AtChem2 models now fail if DILUTE is not set to NOTUSED, following the changes in #514 . This is because the added dilution reactions in the mechanism.reac file don't have defined stoichiometric coefficients. I have fixed this by adding a coefficient of 1.

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (27ede44) 52.05% compared to head (0840c46) 52.05%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #515   +/-   ##
=======================================
  Coverage   52.05%   52.05%           
=======================================
  Files          17       17           
  Lines        2096     2096           
  Branches      166      166           
=======================================
  Hits         1091     1091           
  Misses        933      933           
  Partials       72       72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@rs028 rs028 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@rs028
Copy link
Collaborator

rs028 commented Jan 6, 2024

One question, does the stoichiometric coeff need to be a real number or does this work even if the user set it to an integer?

PS: you should be able to merge this, after you accept the invite to be member (I think!)

@AlfredMayhew
Copy link
Collaborator Author

The accepted formats in the mechanism file should be either a integer or decimal number, with or without a space. i.e. all of the following should be accepted:

  • 2 O3
  • 2.0 O3
  • 2O3
  • 2.0O3

This is then read by python and converted to a float in the separate_stoichiometry function. This means it's always written out to mechanism.reac and mechanism.prod as a decimal (real?). I haven't actually tried manually editing these files to change the 1.0 to an integer of 1. I suspect that would cause a FORTRAN error because it would be the wrong type, but I'm not sure.

One thing that has come to mind that I will test is I'm not sure how the .kpp conversion script will handle this change either, so I'll try and test that at some point!

I can't seem to merge the request, so feel free to do that.

@AlfredMayhew
Copy link
Collaborator Author

Ok, looking at the kpp conversion script it seems like it treats the reaction lines as a 'rate section' and a 'reaction section' and just swaps them, without digging into what the individual species are. This means it should carry any stoichiometry through. I think the kpp test would have failed too if there was an issue, but I will double check when I have some time.

@rs028 rs028 merged commit 63cf98e into AtChem:master Jan 7, 2024
8 checks passed
@AlfredMayhew AlfredMayhew deleted the stoich branch January 11, 2024 22:56
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.

None yet

2 participants