Enthalpy of Formation and Conservation of Energy - Matlab

1,630 views
Skip to first unread message

Murat Ates

unread,
Oct 17, 2013, 6:15:04 PM10/17/13
to canter...@googlegroups.com
Hi Folks,

I am using Cantera with Matlab and I am trying to find temperature and pressure change inside of the engine cylinder by using C3H8 as fuel. I use GRI 3.0 mechanism. 

First of all I wonder if the enthalpies we are calculating for a mixture has formation enthalpies included in addition to the sensible enthalpies. I made couple checks for CH4, C3H8, Ar and the enthalpies at 298.15 K is very close to the formation enthalpies that I can find online.

I have air and residual mixture about 750 K and 27 bar inside the cylinder and I inject C3H8 at 300 K and 150 bar into the cylinder. I have heat loss based on Woschni and some blowby of air mass. By using conservation of energy we can write temperature as: 


Where dYi/dt expressed as:

I solve for the species and temperature by using ode15s and my temperatures are going down after I inject fuel and all of the propane accumulates without any combustion occurring. I checked the ignite example that is using ode solver and I don't see much difference between my code. Any ideas?

Thanks,

Murat


Ray Speth

unread,
Oct 20, 2013, 9:46:08 PM10/20/13
to canter...@googlegroups.com
Murat,

Yes, the enthalpy values calculated by Cantera include the enthalpies of formation. You can see this pretty clearly if you take a mixture and compute its equilibrium state at constant enthalpy and pressure. 

As to the behaviour you're seeing, it's hard to know what's happening if you don't show your code. My first guess would be that 750 K isn't a high enough temperature to observe ignition, especially if you have any form of heat loss.

Regards,
Ray

Murat Ates

unread,
Oct 21, 2013, 9:16:57 AM10/21/13
to canter...@googlegroups.com
Hi Ray,

It seems propane was difficult to autoignite, its autoignition temeprature is about 750-800K however it is still tricky. I switched to nHeptane. I got a reduced nHeptane mechanism from Livermore National Lab (LLNL), 159 species and 770 reactions, however calculations were too slow. I did some modifications but still it didn't help much. Eventually I switched to a fewer number of species and reactions i.e. from University of Wisconsin 29 species and 52 reactions. I was able to see temperature rising, that was a big improvement and relief for me. However, Cantera fails with an error message of "the temperature must be positive". This happens when I am trying to set temperature, pressure, and mass fraction of species for the next time step. Previous temperature is about 2000K.

Ode15s gives me fast results compared to ode23s and ode23t. However, results of these ode solvers don't match, they are relatively different. I feel this is a bad sign. Do you have any experience with these solvers Ray?

Thanks,
Murat 

Ray Speth

unread,
Oct 21, 2013, 6:40:09 PM10/21/13
to canter...@googlegroups.com
Murat,

You should be careful of using the GRI-Mech 3.0 mechanism for anything other than methane. While it does have some propane chemistry, it isn't complete, and I don't think it was calibrated against any experiments that used pure propane as the fuel, only small amounts representative of what's present in natural gas.

I don't think anyone can guess why you get the error "the temperature must be positive" without seeing your code. That should only occur if something is trying to set a negative temperature, which would suggest possibly a numerical instability with the solver you're using or an error in your implementation of the governing equations.

The ODE15s algorithm is very similar to the BDF algorithm implemented by the CVODE solver that Cantera uses. I think that those other solvers are unlikely to give good results, as they really aren't meant for very stiff problems like autoignition. What you should do to make sure that your implementation of the governing equations and solver setup are correct would be to formulate a case that can be simulated with Cantera's reactor network model, and compare the results of solving the problem with each method.

Regards,
Ray

Nick Curtis

unread,
Oct 21, 2013, 10:12:51 PM10/21/13
to canter...@googlegroups.com
Murat,
I've occasionally gotten the negative temperature error in older versions of cantera (e.g. 2.0.1), but only when the setHP_PV method diverges (due to perfectly legitimate reasons, namely dynamic reduction will induce instablity/singularities).  If you're using the set_TPX() method to set the state this should not be an issue.  If you're setting the properties separately that may be the cause however

Nicm

Nick Curtis

unread,
Oct 22, 2013, 10:02:02 AM10/22/13
to canter...@googlegroups.com
Sorry, that's setState_TPX()
Reply all
Reply to author
Forward
Message has been deleted
0 new messages