-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Bug with the computation of [M] with real gases #967
Comments
These calculations should use the total "activity concentration", not the total physical concentration. Fixes Cantera#967
Using the |
Thanks, @rhouim for bringing this up. The implementation certainly seems inconsistent--one term ignores the activity coefficients, while the other considers them--but I'm wondering if the fix should be to remove activity coefficients from the latter term, not to add them to the former (just to be clear, neither term completely ignores real gas effects, since the EoS is used to calculate the molar density). I've never really used or looked into third-body reactions, but my naive understanding is that the "third body" |
That's an interesting thought, @decaluwe. In that case, there would still be an odd asymmetry (if not really an inconsistency) in calculating the rate as the product of two activities and one concentration. I guess part of the issue here is that assuming that any third body has an equivalent effect is already a pretty significant simplification, so it's hard to think about what "should" be used here. |
These a very good points. In our own codes, we have had the same internal debate: wether to base the computation of Nevertheless, it might be more consistent to compute H+O2+N2<=>HO2+N2 In these reactions the concentrations of the third bodies, N2 and AR, would likely be computed with the activity concentrations. However, the following reaction H+O2+M<=>HO2+M reaction could have the third body concentration computed using normal the molar concentrations. This may be a little inconsistent. |
So I chatted with @cfgoldsmith and @rwest offline about this, and their take does comport with my naïve understanding, above: the third body You are correct that the species-specific third-body reactions you write above will use the activity concentrations. This seems incorrect, given the paragraph above, although it is academic for ideal gas mechanisms like GRI-3.0 (the activity concentrations and the molar concentrations are the same). But thinking about it some more, for real gases, if I change the state in a way that changes the activity for some species I suppose the "correct" way to handle this would be to write it as a standard 3-body with a generic Regardless, I don't think we should let the tail wag the dog, here. I would recommend editing #968 so that the molar concentration, rather than the activity concentration, is used for both terms. |
Thanks for the info. Based on this discussion, I agree that from a physical standpoint that treating However, there are some practical issues from a user standpoint. Some reaction mechanisms used in combustion can be quite large with many many species. Users working with supercritical combustion would have to go through all of those reactions and reclassify some of the reactions as third-body reactions and manually setting the all but one of the many enhancement factors (sometimes ~50 to 100 species) to zero. Most users, including myself, would likely (and perhaps unknowingly) eat the inconsistency. Perhaps a way to handle this, assuming the you folks opt to switch to molar concentrations, that doesn't require users to manually go through and alter mechanism files would be to re-classify reactions with an explicit third-body in the reaction string as a third body reaction. This could, in principle, be performed while the mechanism file is being read and searching for species in normal reactions where In general, supercritical and high-pressure combustion is kind of in the Wild West right now. There are lots of open questions and inconsistencies such as using chemical reaction mechanisms developed under ideal gas conditions because nothing else is available. The third body thing is quite a small issue in comparison to these. Thus, either way: normal concentrations or activity concentrations to compute To be honest, I only noticed this when I started looking through the supercritical combustion literature for preparation for a course in multiphase combustion and adding a real-gas combustion module into our in-house code. No papers (at least ones that I found) state how they computed We will be using Cantera to perform mechanism reaction reduction to simulate solid-detonation fireballs using the Becker-Kistiakowsky-Wilson EoS model. I will be adding this EoS to Cantera. The compressibility factor is initially quite high (Z ~3 to 5) and we need to reduce large chemical mechanisms to ones that are more practical for multidimensional CFD for our rather unique conditions. |
From the discussion on Cantera#967, the calcuation of [M] should be based on the physical concentrations of the 3rd body colliders, not their "activity concentrations". Fixes Cantera#967
Per the suggestion of @decaluwe, @rwest, and @cfgoldsmith, I've changed the implementation in #968 to use the physical concentration when calculating [M] for three body and falloff reactions. To the question of how to treat reactions like - equation: H + 2 O2 <=> HO2 + O2
rate-constant: {A: 2.08e+19, b: -1.24, Ea: 0.0} with - equation: H + O2 + M <=> HO2 + M
type: three-body
default-efficiency: 0
efficiencies: {O2: 1.0} This is maybe not ideal, since now if you print all of the reaction equations, you'll see a bunch of reactions with the equation - equation: H + 2 O2 <=> HO2 + O2
type: three-body Then, the last step would be to also identify such reactions when converting from Chemkin input files and label them as three-body reactions. |
From the discussion on Cantera#967, the calcuation of [M] should be based on the physical concentrations of the 3rd body colliders, not their "activity concentrations".
All - I am posting here also as I just pushed a (friendly) amendment to @speth's PR on #968. I believe the question on how to treat concentration has been settled already, but a process to convert reactions that explicitly specify a collision partner is still missing (per @decaluwe's suggestion). As an alternative to what is posted above, it is possible to leave the existing syntax - equation: H + 2 O2 <=> HO2 + O2
rate-constant: {A: 2.08e+19, b: -1.24, Ea: 0.0} and use simple rules to identify this reaction as a - equation: H + O2 + M <=> HO2 + M
rate-constant: {A: 2.08e+19, b: -1.24, Ea: 0.0}
type: three-body
default-efficiency: 0
efficiencies: {O2: 1.0} Specifically, I am suggesting the following three rules for converting an
There is a draft version in commits to #968 that creates the machinery that makes detection possible, but I wanted to make sure that I am not overlooking anything (i.e. rules are not finalized). Any comments would be appreciated (@speth, @decaluwe, @rwest, and @cfgoldsmith). |
Per discussion in Cantera#967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
From the discussion on Cantera#967, the calcuation of [M] should be based on the physical concentrations of the 3rd body colliders, not their "activity concentrations".
Per discussion in Cantera#967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
I've been following along the various discussions and haven't yet thought of any Gotchyas that haven't already been mentioned. (Hence my silence) |
Per discussion in Cantera#967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
From the discussion on #967, the calcuation of [M] should be based on the physical concentrations of the 3rd body colliders, not their "activity concentrations".
Per discussion in Cantera#967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
For posterity, I wanted to share (with permission) a few comments that Mike Burke made in an email conversation:
|
Per discussion in #967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
We have been looking through the Cantera source code to examine how the activity concentrations are implemented in preparation for us to add a real-gas equation of state model.
When looking through
GasKinetics.cpp
andThirdBodyCalc.h
we noticed what could be a bug when computing the real-gas third body concentration. On line 63 ofGasKinetics.cpp
the activity concentrations are stored inm_conc
and on line 64 the normal total concentration is stored inctot
. The activity concentrations,m_conc
, and total molar density,ctot
, is fed into 3-body update function.On lines 36-44 of
ThirdBodyCalc.h
, [M] is calculated in the update function. Note:m_conc
is namedconc
in this function. These lines of code perform:[M] = m_default*ctot + sum(m_eff*conc_i)
,where (presumably)
m_default = 1
andm_eff = actual efficiency factor - 1
. The portion of [M] computed using ctot does not include real gas effects, whereas the other portion includes the real gas effects. Written another way usingc_i
for molar concentration anda_i
for the activity concentration for species i:[M] = sum(c_i + (efficiency_factor_i - 1)*a_i)
This seems inconsistent with real gas thermodynamics. I am also pretty sure that, in general,
sum(c_i) != sum(a_i)
.It seems to me that ctot needs to be redefined in the computation of [M] as
sum(a_i)
.Perhaps this is a bug that is left over from optimizing the computation of [M] for ideal gas mixtures?
The text was updated successfully, but these errors were encountered: