Hello,
I would greatly appreciate your assistance with a thermal degradation modeling problem I'm working on.
I am attempting to model a thermal degradation reaction where my fuel, with the chemical formula C_a H_b O_c, decomposes into various light gas species. This reaction occurs in the absence of oxygen (pyrolysis conditions).
C_a H_b O_c -----> A CO2 + B CO + C H2 + D CH4
I would like to use Cantera's gas.equilibrate("TP") method to determine the stoichiometric coefficients for this reaction. However, I understand that Cantera typically requires predefined species rather than allowing direct input of elemental compositions.
I have two specific questions:
Any guidance on the best approach for handling this type of problem would be very helpful.
Thank you for your time and assistance.
Hi,
Yes, you can do this, by creating a species with fictitious thermo data which will make it unfavorable at equilibrium. And there’s no need to actually create a new input file. For example:
import cantera as ct gas = ct.Solution('gri30.yaml') fuel = ct.Species('fuel', {'C': 0.4, 'H': 0.5, 'O': 0.1}) fuel.thermo = ct.ConstantCp(T_low=200, T_high=3000, P_ref=ct.one_atm, coeffs=[300, 5e8, 0, 0]) gas.add_species(fuel) gas.TPX = 300.0, ct.one_atm, {'fuel': 1.0} gas.equilibrate('TP') gas()Here, the coeffs array used to define the fuel thermo consists of the reference temperature, the reference enthalpy, the reference entropy, and the specific heat capacity, all in J/kmol or J/kmol/K. I just picked a value that is large enough that no significant amount of fuel is left after equilibrating. The output from the above code is:
which outputs:
gri30: temperature 300 K pressure 1.0133e+05 Pa density 1.1229 kg/m^3 mean mol. weight 27.643 kg/kmol phase of matter gas 1 kg 1 kmol --------------- --------------- enthalpy 8.1397e+05 2.2501e+07 J internal energy 7.2373e+05 2.0006e+07 J entropy 7815.5 2.1605e+05 J/K Gibbs function -1.5307e+06 -4.2313e+07 J heat capacity c_p 1364.8 37728 J/K heat capacity c_v 1064 29413 J/K mass frac. Y mole frac. X chem. pot. / RT --------------- --------------- --------------- CH4 7.4893e-11 1.2905e-10 -75.094 CO 0.40545 0.40015 -69.001 CO2 1.1278e-10 7.084e-11 -206.84 C2H2 0.18915 0.20081 65.717 C2H4 0.40422 0.39831 -6.2514 C2H6 4.3534e-08 4.0021e-08 -78.219 CH2CO 6.277e-11 4.1278e-11 -72.126 C3H8 0.0011743 0.00073616 -81.345 [ +46 minor] 2.2296e-20 1.3993e-20Regards,
Ray