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

Additional Kinetics cleanup #1225

Merged
merged 7 commits into from
Mar 22, 2022
Merged

Additional Kinetics cleanup #1225

merged 7 commits into from
Mar 22, 2022

Conversation

speth
Copy link
Member

@speth speth commented Mar 21, 2022

This is just some additional cleanup, mostly related to kinetics / reactions, as a follow-on to #1223.

Changes proposed in this pull request

  • Eliminate the BulkRate template class (thanks to the main capabilities being folded into ArrheniusBase)
  • Eliminate the PlogRate::setRateParameters method - setParameters and setRates provide a full interface.
  • Validate that reactions are configured (i.e., have some parameters set) when they are added to a Kinetics and throw an exception if not
  • Fix some Doxygen warnings
  • Remove unnecessary use of the __unconvertible__ flag
  • Deprecate the unused derived constants logBoltz_Planck and Planck_bar.
  • Eliminate the need for the transitional name Arrhenius3 -- this is now just directly ArrheniusRate

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #1225 (91b294e) into main (5f94a85) will increase coverage by 0.03%.
The diff coverage is 94.38%.

❗ Current head 91b294e differs from pull request most recent head 7864b14. Consider uploading reports for the commit 7864b14 to get more accurate results

@@            Coverage Diff             @@
##             main    #1225      +/-   ##
==========================================
+ Coverage   65.44%   65.47%   +0.03%     
==========================================
  Files         327      327              
  Lines       46321    46337      +16     
  Branches    19688    19678      -10     
==========================================
+ Hits        30314    30339      +25     
  Misses      13475    13475              
+ Partials     2532     2523       -9     
Impacted Files Coverage Δ
include/cantera/base/global.h 81.81% <ø> (ø)
include/cantera/kinetics/ChebyshevRate.h 98.46% <ø> (ø)
include/cantera/kinetics/Custom.h 100.00% <ø> (+14.28%) ⬆️
include/cantera/kinetics/Kinetics.h 36.52% <ø> (ø)
include/cantera/kinetics/PlogRate.h 90.56% <ø> (ø)
include/cantera/kinetics/RxnRates.h 90.90% <ø> (ø)
src/kinetics/InterfaceRate.cpp 91.07% <ø> (ø)
src/kinetics/ChebyshevRate.cpp 90.74% <75.00%> (-0.61%) ⬇️
src/kinetics/RxnRates.cpp 78.26% <80.00%> (ø)
src/kinetics/Arrhenius.cpp 95.34% <85.00%> (-3.12%) ⬇️
... and 18 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@speth speth marked this pull request as draft March 21, 2022 02:49
@speth speth marked this pull request as ready for review March 21, 2022 22:18
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

@speth ... thank you for the simplifications / fixes! While I'm sad to see BulkRate<> go, there really isn't a need after all. Not introducing Arrhenius3 is certainly a big upside here!

I also ran tests comparing this to main and there is no perceptible speed difference. On my machine, typical values are:

In [2]: %run custom_reactions.py
Average time of 100 simulation runs for 'gri30.yaml' (CH4)
- New framework (YAML): 88.36 ms (T_final=2736.60)
- One Python reaction: 95.85 ms (T_final=2736.60) ... +8.47%
- Old framework (XML): 91.95 ms (T_final=2736.60) ... +4.06%

@ischoegl ischoegl merged commit 5f35bd8 into Cantera:main Mar 22, 2022
@speth speth deleted the kinetics-cleanup branch March 22, 2022 01:54
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 this pull request may close these issues.

2 participants