IdealGasConstPressureReactor volume continues to increase

124 views
Skip to first unread message

Brian Sun

unread,
Aug 8, 2017, 11:02:13 AM8/8/17
to Cantera Users' Group
Hello,

I am running into an issue with the IdealGasConstPressureReactor. When I run the program as is, the temperature stabilizes at around 830 K, and the heat loss and density begin to stabilize as well. However, it appears that the reactor volume has increased up to 10x what it used to be. I believe this might have to do with the pressure, so I increased the K value on the valve from 1e-9 all the way up to 10000 to try to stabilize it, but the volume still made its way up 10x its original size.

I am not sure if this is how the reactor is intended to work, as I began working with Cantera very recently. The increase in volume seemed a little "off" for me, but it might just be doing what it is supposed to. If someone could clear things up for me, that would be greatly appreciated. I have attached the code that I am using.

Thanks
constant_pressure_reactor.py

Steven DeCaluwe

unread,
Aug 8, 2017, 11:13:25 AM8/8/17
to canter...@googlegroups.com
Hi Brian,

If it is a constant pressure ideal gas reactor, then the volume must almost always increase with the Temperature, no?  Assuming it's a constant mass reactor, as well.  

v = RT/P, where P is constant and R will shift with the chemical composition. But I imagine that the changes in T will be larger in magnitude than any changes in R. 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.
<constant_pressure_reactor.py>

Brian Sun

unread,
Aug 8, 2017, 11:47:27 AM8/8/17
to Cantera Users' Group
Hi Mr. Decaluwe,

Thanks for the speedy reply. The issue I am having relates to what you said. Even when the temperature stabilizes around 830 K (basically constant), the volume still continues to increase rapidly, from 3x the original volume to 10x the original volume. Is this still the expected behavior?

Brian

Bryan W. Weber

unread,
Aug 8, 2017, 12:14:46 PM8/8/17
to Cantera Users' Group
Brian,

Since you have a mass flow input, the volume can also increase if there is not a balance of mass coming in versus mass going out. You can check this by plotting the reactor mass as a function of time. If you want the volume of the reactor to be constant, you should use a constant volume reactor (i.e., IdealGasReactor). Can you attach the CTI file if you need some more help troubleshooting?

Best,
Bryan

Brian Sun

unread,
Aug 8, 2017, 12:44:57 PM8/8/17
to Cantera Users' Group
Hi Bryan,

For this simulation, I need to use the constant pressure ideal gas reactor. It appears that the issue is with the balance of mass coming in vs going out. I plotted the reactor mass as a function of time and it increased about 8x for the time of the simulation (128 seconds). The residence time also increased significantly.

I have attached the CTI file that I am using. It is a large file that I obtained from the LLNL n-Heptane, Detailed Mechanism, Version 3.1. It was originally in Chemkin format and I had to convert it for Cantera usage.

Brian
n-Heptane.cti

Bryan W. Weber

unread,
Aug 8, 2017, 5:57:50 PM8/8/17
to Cantera Users' Group
Hi Brian,

I'm not sure what problem you're trying to solve. You asked us to confirm if this is appropriate behavior for this reactor, and based on your results, I'd say that yes, it is the expected behavior. Is it a problem that the volume increases so much? Do you need the volume of the reactor to be constant, in addition to the pressure? Can you describe with a little more detail what you're trying to model so we can help you solve that problem?

Best,
Bryan

Brian Sun

unread,
Aug 9, 2017, 10:12:22 AM8/9/17
to Cantera Users' Group
Bryan,

I believe my main question has been answered now. I just wanted to confirm that the massive increase in volume of the constant pressure reactor is the expected behavior, even if the temperature is basically constant.

Is there a way to solve this mass imbalance that you are talking about?  I am trying to model the ignition of n-Heptane to achieve a steady state.

Thanks,
Brian

Bryan W. Weber

unread,
Aug 9, 2017, 10:30:00 AM8/9/17
to Cantera Users' Group
Brian,

I believe you can use a PressureController: http://cantera.org/docs/sphinx/html/cython/zerodim.html#pressurecontroller If you look at the equations for the valve there, you can see that the mass flow rate depends on the product of the coefficient and the pressure difference. In this case, because you're using the constant pressure reactor, the pressure difference is very small, and this leads to a small mass flow rate output. On the other hand, the pressure controller always has a mass flow rate equal to the master device plus some correction. Just make sure you set the master device to be the inlet mass flow controller, and I think you'll have better results.

Best,
Bryan

Brian Sun

unread,
Aug 9, 2017, 12:17:11 PM8/9/17
to Cantera Users' Group
Hi Bryan,

Thanks for the advice. I will try that. I'll let you know if I have any questions.

Thanks,
Brian
Reply all
Reply to author
Forward
0 new messages