Specified Pressure Trace in Reactor

61 views
Skip to first unread message

Owen River Trimble

unread,
Aug 16, 2024, 4:49:16 PM8/16/24
to Cantera Users' Group
Hi,

I have previously run a simulation in Chemkin using a constant H, specified P reaction in 0D homogenous batch reactor. The results are plotted below with time (ms) on the x-axis. The pressure trace comes from experimental data and notice that the temperature, which is calculated from pressure, has the same shape as the pressure. 
chemkinresults.png
I wish to produce these same results in Cantera (python). I believe that I have made it such that the pressure trace varies with time (uses the experimental trace) in Cantera; however, the resulting temperature does not follow the same shape like it does in Chemkin. Any ideas on why this might be?

Code:
gFFCM2 = ct.Solution(FFCM2.yaml)
gFFCM2.TPX = InitialT, InitialP * ct.one_atm, InitialComposition
initialFFCM2h = gFFCM2.h
rFFCM2 = ct.Reactor(gFFCM2)
simFFCM2 = ct.ReactorNet([rFFCM2])

for n in range(0, len(t)):
gFFCM2.HPX = initialFFCM2h, P_profile[n] * ct.one_atm, rFFCM2.thermo.TPX[2]
rFFCM2 = ct.Reactor(gFFCM2)
simFFCM2 = ct.ReactorNet([rFFCM2])
simFFCM2.advance(t[n])
# then I store some data which is not shown here
 
Here, the yellow temperature line does not follow the same shape as pressure like in the previous example. This is the issue I wish to resolve. The light blue line is the P_profile 
python.png

Ingmar Schoegl

unread,
Sep 1, 2024, 2:10:27 PM9/1/24
to Cantera Users' Group
Hi,
While you are not providing sufficient detail to give a meaningful answer, one thing I notice is that you are creating a new ReactorNet object at every simulation step, where you set initial conditions to a new pressure and the composition to the one at the end of the previous iteration. Then, you advance for increasingly long periods, meaning that things will equilibrate at a rate that is much faster than the actual time that passed, which likely explains your results. Instead, you will have to update the pressure of gFFCM2 and then call syncState on rFFCM2. In case you need additional input, please provide a complete minimum working example.
-is-
Reply all
Reply to author
Forward
0 new messages