-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support Chemkin parameterization for multiple bath gas species #193
Comments
I haven't seen these Chemkin keywords before:
I'm wondering if this ends up being a special form of Mike Burke's mixing rules (see #157), which @pjsingal is currently working on implementing in Cantera. |
It's new to me too. I'm pretty sure fair-use doctrine allows me to post this excerpt of a Release 2021R2 technical manual that I just found online:
|
Thanks, @rwest. Now that the reactions:
- units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol}
- equation: H + O2 (+M) <=> HO2 (+M)
type: linear-Burke
duplicate: true
colliders:
- name: M
type: falloff
low-P-rate-constant: [1.737e+019, -1.230, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 6.700e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
- name: AR
type: falloff
low-P-rate-constant: [6.810e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 7.000e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiency: {A: 1, b: 0, Ea: 0}
- name: He
type: falloff
low-P-rate-constant: [9.192e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 5.900e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiency: {A: 1, b: 0, Ea: 0}
- name: H2
efficiency: {A: 1.3, b: 0, Ea: 0}
- name: H2O
efficiency: {A: 10.0, b: 0, Ea: 0} (@pjsingal, let me know if you agree this interpretation is correct; I think the translation is all species use the same high-pressure rate constant, and the efficiency for those species with a specific rate parameterization is 1) The caveat is that the For a more complete example, I've put together a YAML file and small script for comparing the three different approaches for the above reaction, and consistent with the previous literature result, you can see that using the more accurate mixing rule can have a fairly large effect on the rate constant, here compared as the ratio of the ckpdep.yamlphases:
- name: gas
thermo: ideal-gas
kinetics: bulk
species:
- {gri30.yaml/species: [O2, H, AR, N2, H2O, HO2, H2]}
- {nasa_gas.yaml/species: [He]}
state: {T: 300, P: 1 atm, X: {O2: 1.0, H: 1.0e-5, AR: 4.4, HE: 2.0, N2: 4.0, H2O: 0.1}}
# H +O2 (+M) = HO2 +(M) 4.650e+012 0.440 0.0
# LowMX/1.737e+019 -1.230 0.0/
# TroeMX/ 6.700e-001 1.000e-030 1.000e+030 1.000e+030/ LowSP/ AR 6.810e+018 -1.200 0.0/
# TroeSP/AR 7.000e-001 1.000e-030 1.000e+030 1.000e+030/ LowSP/ HE 9.192e+018 -1.200 0.0/
# TroeSP/HE 5.900e-001 1.000e-030 1.000e+030 1.000e+030/ HE / 1.0 / AR / 1.0 / H2/ 1.30/ H2O/ 10.00 /
reactions:
- units: {length: cm, time: s, quantity: mol, activation-energy: cal/mol}
# Reaction 0: Combined rate using Burke reduced pressure linear mixing rule
- equation: H + O2 (+M) <=> HO2 (+M)
type: linear-Burke
duplicate: true
colliders:
- name: M
type: falloff
low-P-rate-constant: [1.737e+019, -1.230, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 6.700e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
- name: AR
type: falloff
low-P-rate-constant: [6.810e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 7.000e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiency: {A: 1, b: 0, Ea: 0}
- name: He
type: falloff
low-P-rate-constant: [9.192e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 5.900e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiency: {A: 1, b: 0, Ea: 0}
- name: H2
efficiency: {A: 1.3, b: 0, Ea: 0}
- name: H2O
efficiency: {A: 10.0, b: 0, Ea: 0}
# Reaction 1-3: Separate reactions for colliders with unique rate constant expressions
- equation: H + O2 (+M) <=> HO2 (+M)
type: falloff
duplicate: true
low-P-rate-constant: [1.737e+019, -1.230, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 6.700e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiencies: {AR: 0, He: 0, H2: 1.3, H2O: 10.0}
- equation: H + O2 (+AR) <=> HO2 (+AR)
type: falloff
duplicate: true
low-P-rate-constant: [6.810e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 7.000e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
- equation: H + O2 (+He) <=> HO2 (+He)
type: falloff
duplicate: true
low-P-rate-constant: [9.192e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 5.900e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
# Reaction 4-6: Separate reactions, but calculated on the full mixture concentration.
# These are the rates needed to compute the Chemkin-style mole-fraction based weighting
- equation: H + O2 (+M) <=> HO2 (+M)
type: falloff
duplicate: true
low-P-rate-constant: [1.737e+019, -1.230, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 6.700e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
efficiencies: {H2: 1.3, H2O: 10.0}
- equation: H + O2 (+M) <=> HO2 (+M)
type: falloff
duplicate: true
low-P-rate-constant: [6.810e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 7.000e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
- equation: H + O2 (+M) <=> HO2 (+M)
type: falloff
duplicate: true
low-P-rate-constant: [9.192e+018, -1.200, 0.0]
high-P-rate-constant: [4.650e+012, 0.440, 0.0]
Troe: {A: 5.900e-001, T3: 1.000e-030, T1: 1.000e+030, T2: 1.000e+030}
ckpdep.pyimport cantera as ct
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.constrained_layout.use'] = True
gas = ct.Solution('ckpdep.yaml')
def kf_burke(gas):
return gas.forward_rate_constants[0]
def kf_separate(gas):
return sum(gas.forward_rate_constants[1:3])
def kf_chemkin(gas):
XM = 1 - sum(gas['AR','HE'].X)
XAR, XHE = gas['AR','HE'].X
return gas.forward_rate_constants[4:] @ [XM, XAR, XHE]
burke = []
separate = []
chemkin = []
for i in range(10000):
T = 300 + 1000 * np.random.random()
P = 10**(-2 + 10 * np.random.random())
X = np.random.random(gas.n_species)
gas.TPX = T, P, X
burke.append(kf_burke(gas))
separate.append(kf_separate(gas))
chemkin.append(kf_chemkin(gas))
burke = np.array(burke)
separate = np.array(separate)
chemkin = np.array(chemkin)
fig, ax = plt.subplots(1, 2, figsize=(9,5))
ax[0].plot(burke / separate, '.')
ax[1].plot(burke / chemkin, '.')
ax[0].set(ylabel=r'$k_{\text{Burke}} / k_{\text{separate}}$')
ax[1].set(ylabel=r'$k_{\text{Burke}} / k_{X\text{-weighted}}$')
plt.show() |
The Chemkin format is not supported using the latest Cantera version. For example, in our mechanism, the format is:
However, the format is not supported in the latest Cantera version, and we must extract the N2 component and change the format into two separate reactions:
When we try to adjust the format to fit the Cantera, it’s not working by Chemkin.
Could you please try to fix this issue in your side to support the Chemkin format in the next version?
The text was updated successfully, but these errors were encountered: