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

Rethink handling of 3rd body colliders #133

Closed
ischoegl opened this issue Jan 31, 2022 · 1 comment
Closed

Rethink handling of 3rd body colliders #133

ischoegl opened this issue Jan 31, 2022 · 1 comment
Assignees
Labels
feature-request New feature request work-in-progress An enhancement that someone is currently working on

Comments

@ischoegl
Copy link
Member

ischoegl commented Jan 31, 2022

Abstract

At the moment, third body colliders are handled by ThirdBodyCalc.h, which is managed by Reaction objects. Specifically, there are two dedicated reaction specializations, - ThreeBodyReaction and FalloffReaction - that implement 3rd body colliders, whereas this feature is unused by others.

Cantera/cantera#1183 removes several Reaction specializations as the new framework introduced in #87 has already moved most reaction-specific functionality to ReactionRate (at least for GasKinetics). Ongoing work on Cantera/cantera#1181 also indicates that no specializations are needed for InterfaceKinetics. It is anticipated that the handling of 3rd-body colliders is the only remaining outlier in the new implementation framework.

Motivation

Describe the need for the proposed change:

  • What problem is it trying to solve? ... completely eliminate Reaction specializations (i.e. remove ReactionFactory together with CTI/XML)
  • Who is affected by the change? ... all Cantera users
  • Why is this a good solution? ... reduction of complexity

Possible Solutions

There are four solutions:

  1. Attach the handling of third-body species to ArrheniusRate
  2. Create a dedicated object ThreeBodyArrheniusRate
  3. Keep separate FalloffReaction and ThreeBodyReaction specializations (i.e. no change)
  4. Update: Create a ThirdBodyRate<ArrheniusBase> template (assuming implementation of a reduced scope Arrhenius(Base) object Preamble to InterfaceKinetics refactoring cantera#1184)

For (1), (2) and (4), the rate object would calculate M and make it available to GasKinetics (instead of having this handled in a separate step). Either would (at least partially) replace ThirdBodyCalc.h.

Other thoughts

  • with (1), attaching more functions will make ArrheniusRate a 'catch-all'. As it is the most frequently used rate parameterization, this may affect performance
  • with (2), no further specializations are needed for FalloffRate, as they inherently involve 3rd-body colliders
  • it is possible to extend third-body reactions to other reaction rate types, e.g. BlowersMasel
  • A similar question (attach optional functions or create separate specializations?) arises in the context of InterfaceKinetics. Specifically, coverages and sticking behavior are implemented for both Arrhenius and BlowersMasel variants.

Overall, I believe (1) will allow for a slimmer API but may penalize performance, whereas (2) will create more specializations. At the moment, I have a strong preference for option (4), as it may be the best way forward for Cantera/cantera#1181 as well.

References

Links to related Pull Requests, GitHub Issues, Users' Group topics, or other relevant material.

@ischoegl
Copy link
Member Author

ischoegl commented May 9, 2022

Based on Cantera/cantera#1219, there is a speed penalty for alternative approaches, so ThirdBodyCalc.h will remain as is.

@ischoegl ischoegl closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request work-in-progress An enhancement that someone is currently working on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant