kf_cantera = 92004.86402075388kf_calc = 113473.33578324724kf_cantera = 18219679.603242602kf_calc = 18219679.60324262import cantera as ctimport math
gas = ct.Solution('AramcoMech_1.3_C4.cti')rxn = 18
T = 1500gas.set_equivalence_ratio(1,{'CH4':1},{'O2':1,'N2':3.76})gas.TP = T,ct.one_atm
# Get the forward rate constant from Canterakf_cantera = gas.forward_rate_constants[rxn]
# Calculate it ourselves - note this quick script doesn't work for Simple falloff # or falloff with only a single third bodyk_0 = (gas.reaction(rxn).low_rate.pre_exponential_factor * T**(gas.reaction(rxn).low_rate.temperature_exponent) * math.exp(-gas.reaction(rxn).low_rate.activation_energy/(8314*T)))
k_inf = (gas.reaction(rxn).high_rate.pre_exponential_factor * T**(gas.reaction(rxn).high_rate.temperature_exponent) * math.exp(-gas.reaction(rxn).high_rate.activation_energy/(8314*T)))
param = gas.reaction(rxn).falloff.parameters
FC = (1-param[0])*math.exp(-T/param[1]) + param[0]*math.exp(-T/param[2]) + math.exp(-param[3]/T)
M = sum(gas.concentrations)for species,value in gas.reaction(rxn).efficiencies.items(): M = M + (float(value)-1)*gas.concentrations[gas.species_index(species)]
Pr = k_0*M/k_infC = -0.4 - 0.67*math.log10(FC)N = 0.75 - 1.27*math.log10(FC)f1 = (math.log10(Pr)+C)/(N-0.14*(math.log10(Pr)+C))F = 10**(math.log10(FC)/(1+f1**2))
kf_calc = k_inf*(Pr/(1+Pr))*F
print(kf_cantera)print(kf_calc)Hi,
The issue is with how reactions with 3 rather than 4 coefficients for the Troe form are handled. Cantera uses the same functions for both versions, and uses 0 as the default for the 4th coefficient. However, the use of 0 as the 4th coefficient is also handled specially, and used to indicate that the entire term is set to 0. So, in your code, you would want to write something more like:
FC = (1-param[0])*math.exp(-T/param[1]) + param[0]*math.exp(-T/param[2])
if param[3]:
FC += math.exp(-param[3]/T)
Regards,
Ray