You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A phase definition specifying a subset of species from another mechanism, using the qualifier declared-species to select reactions and with the skip-undeclared-third-bodies option enabled, fails when there are third body reactions for specific colliders if that collider is not in the phase. This seems to be a corner case for the new handling introduced in #1015.
i = 0: H + O2 + M <=> HO2 + M Arrhenius(A=2.8e+12, b=-0.86, E=0)
i = 1: H + O2 + O2 <=> HO2 + O2 Arrhenius(A=2.08e+13, b=-1.24, E=0)
i = 2: H + O2 + H2O <=> HO2 + H2O Arrhenius(A=1.126e+13, b=-0.76, E=0)
i = 3: H + O2 + N2 <=> HO2 + N2 Arrhenius(A=inf, b=-1.24, E=0)
i = 4: H + O2 + AR <=> HO2 + AR Arrhenius(A=inf, b=-0.8, E=0)
[20448590.35034667 8714720.31109497 72687079.49225374 nan
nan]
For the last two reactions, which have N2 and AR as third bodies, the pre-exponential factor ends up as infinity, and the reaction rate ends up being NaN. I think we need to find a way to skip adding these reactions, but it's not clear where to do so. GasKinetics::addThreeBodyReaction has access to the necessary information, but doesn't have a mechanism to make the determination, but by the point that it's called, all of the setup at the level of the parent Kinetics and BulkKinetics classes has already been completed.
I haven't looked yet, but I wonder if the refactoring in #995 provides a more obvious location to handle this case.
Indeed an edge case! I believe an additional check in detectEfficiencies() to toggle Reaction::valid is all that is needed (within Reaction.cpp). (Edit: it’s a little more than that)
Regarding #995 … it will eventually become possible to outright remove reactions. But until that point, taking care of XML is the limiting issue. The edge case can be caught relatively easily for YAML in ReactionFactory (but not for XML).
Problem description
A phase definition specifying a subset of species from another mechanism, using the qualifier
declared-species
to select reactions and with theskip-undeclared-third-bodies
option enabled, fails when there are third body reactions for specific colliders if that collider is not in the phase. This seems to be a corner case for the new handling introduced in #1015.Steps to reproduce
Behavior
For the last two reactions, which have
N2
andAR
as third bodies, the pre-exponential factor ends up as infinity, and the reaction rate ends up being NaN. I think we need to find a way to skip adding these reactions, but it's not clear where to do so.GasKinetics::addThreeBodyReaction
has access to the necessary information, but doesn't have a mechanism to make the determination, but by the point that it's called, all of the setup at the level of the parentKinetics
andBulkKinetics
classes has already been completed.I haven't looked yet, but I wonder if the refactoring in #995 provides a more obvious location to handle this case.
System information
main
at b753dd5.The text was updated successfully, but these errors were encountered: