Cantera reactor change in enthalpy of system

38 views
Skip to first unread message

Antariksh Patel

unread,
Jun 17, 2024, 7:17:13 PMJun 17
to Cantera Users' Group
Hi guys, 

I am trying to find how the mass fractions and the enthalpy of the system changes with a step of 1 microsecond and I am trying to do this using a IDealGasConstPressureReactor. However I am not getting the results I should (i know what i should get from some other work) and it seems like there is negligable change in the system. Does anyone have any ideas? I have attatched the code bellow.
t = 1*10**-6 # Time step size

#for i in np.arange(no_points): # Mabye i can make this fast by taking stuff out the loop #
gas = ct.Solution("GRI12.yaml")  # create a default GRI-Mech 3.0 gas mixture
gas.HPX = -8.11741605e+05, ct.one_atm, "H2:4.84696761e-04, H:3.67735198e-08, O:8.28486505e-08, O2:1.39780208e-01, OH:8.98867449e-07, H2O:5.93006471e-02, HO2:8.64347184e-05, H2O2:3.06804698e-05 , C:7.20296866e-20 , CH:3.18642075e-15, CH2:3.78751570e-10, CH2(S):2.03115950e-11, CH3:1.04947051e-05, CH4:2.71408855e-02, CO:1.33276760e-02, CO2:3.14464669e-02, HCO:1.43914696e-08, CH2O:5.21917402e-04, CH2OH:2.31522396e-10, CH3O:7.97217973e-06, CH3OH:7.74571720e-05, C2H:5.95324446e-15, C2H2:1.67765778e-05, C2H3:2.18436408e-10, C2H4:2.97896465e-04, C2H5:4.95170037e-07, C2H6:5.24363320e-04, HCCO:1.30502110e-10, CH2CO:3.18984103e-06, HCCOH:1.53179021e-08, N2:7.26940692e-01, AR:0"  # set gas to an interesting state
reac = ct.IdealGasConstPressureReactor(gas)  # create a reactor containing the gas
sim = ct.ReactorNet([reac])  # add the reactor to a new ReactorNet simulator
#print(gas.enthalpy_mass)  # view the initial state of the mixture (state summary will be printed to console)
#print(gas.Y[13])
gas()
test1 = gas.enthalpy_mass
sim.advance(t)  # advance the simulation to the specified absolute time, t = 1 sec
#print(gas.enthalpy_mass)  # view the updated state of the mixture, reflecting properties at t = 1 sec
#print(gas.Y[13])
gas()
test2 = gas.enthalpy_mass
print(test1-test2)

Ray Speth

unread,
Jun 28, 2024, 4:29:20 PM (4 days ago) Jun 28
to Cantera Users' Group
Hi,

For a closed system at constant pressure, the enthalpy is constant. The answer Cantera gives you should correspond to that, within some small integration tolerances.

Regards,
Ray
Reply all
Reply to author
Forward
0 new messages