Cantera / enhancements

Repository for proposed and ongoing enhancements to Cantera
11 stars 5 forks source link

Rethink handling of 3rd body colliders #133

Closed ischoegl closed 2 years ago

ischoegl commented 2 years ago

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:

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 Cantera/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

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 commented 2 years ago

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