new to Matlab-Cantera, how to calculate the heat release of reactions.

1,515 views
Skip to first unread message

Yu Li

unread,
Jan 2, 2017, 11:51:40 PM1/2/17
to Cantera Users' Group
hi all:
    I'm a past CHEMKIN user, and new to Cantera-MATLAB, after several day's I get familar with the Cantera, but I met with a basic problems.

    I found that the python-Cantera have more function than Matlab-Cantera. for example, I want to calculate the heat release of each reaction, in Python, there is 'getDeltaEnthalpy ', but there is no such function in MATLAB. I found that the related function to enthalpy of Matlab is: 
enthalpies_RT(tp)

Get the non-dimensional enthalpies.

enthalpy_mass(tp)

Get the mass specific enthalpy.

enthalpy_mole(a)

Get the mole specific enthalpy.


which looks could not help me calculate the heat release of all reactions.

could anybody give me some suggestions about this?


thanks!

Li

Bryan W. Weber

unread,
Jan 3, 2017, 9:00:04 AM1/3/17
to Cantera Users' Group
Li,

Welcome to Cantera! Please see this thread for some more details: https://groups.google.com/d/msg/cantera-users/SIsC-YAUjBw/J-dF7IiWEAAJ

Regards,
Bryan
Message has been deleted

Yu Li

unread,
Jan 3, 2017, 1:35:48 PM1/3/17
to Cantera Users' Group
hi:
   thanks for your reply! I have some concern about the answer in the link:
 
   it says there: calculate the heat release rate using the species partial molar enthalpies (via the enthalpies_RT function) and the net production rates (via the netProdRates function)
   as I found in the web, the  species partial molar enthalpies should be calculated by enthalpy_mole,right? so it should be a vector of each species with unit: j/kmol.
  then, the unit of net production of species is kmol/m^3/s, so the enthalpy change of speices could be: J/m^3/s.

  however when I use the enthalpy_mole(g), it is not a vector, it is a single value, while the enthalpies_RT (g) is a vector. 

   but the enthalpies_RT (g), as describe: if gaseous species, these values are ideal gas enthalpies. however it is non-dimensional value, how could it be ideal gas enthalpies?

    so it confused me a little bit. could you please give me moe suggestions?

thanks!
Li 

Steven DeCaluwe

unread,
Jan 3, 2017, 1:50:54 PM1/3/17
to <cantera-users@googlegroups.com>
Hi Li,

enthalpy_mole calculates the average molar enthalpy of the mixture; as such, it is supposed to return a scalar.  I am not sure why the documentation on this function says otherwise.

enthalpies_RT returns the vector of species enthalpies, h_k, divided by the quantity RT.  It is this division by RT that makes the returned vector unitless (numerator and denominator both have units of kJ/kmol).  I actually do not know why the non-dimensional form is  - I always end up multiplying by RT to get the actual enthalpies.

Anyway, the heat release rate would be the dot product of the vectors [netProdRates(g)] (kmol/m3/s for a gas phase) and [enthalpies_RT(g)*gasconstant*Temperature(g)] (kJ/kmol).

Cheers,
Steven

——————————————————————————————————
Steven DeCaluwe, PhD
Assistant Professor of Mechanical Engineering
Colorado School of Mines
Brown Building W410B
Golden, CO 80401

Twitter: @DrDeCaluwe

--
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.

Bryan W. Weber

unread,
Jan 3, 2017, 2:12:37 PM1/3/17
to Cantera Users' Group
Hi Li,

The documentation for enthalpy_mole doesn't state that it returns a vector (it uses the singular enthalpy instead of the plural enthalpies in enthalpies_RT). We could probably clarify that though. As Steven suggested, you can multiply the enthalpies_RT by the temperature and the gas constant to have dimensional values.

Regards,
Bryan
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.

Ray Speth

unread,
Jan 3, 2017, 2:23:45 PM1/3/17
to Cantera Users' Group
Bryan,

The summary line of the documentation is correct, but the 'returns' notation claims that the function returns a vector:

The same is still true in the development version, and for many other Thermo functions which return scalars (e.g. most if not all of the other foo_mass and foo_mole functions).

Regards,
Ray

Yu Li

unread,
Jan 3, 2017, 2:33:01 PM1/3/17
to Cantera Users' Group
hi:
    function v = enthalpy_mole(a)
% EN   Instance of class :maTHALPY_MOLE  Get the mole specific enthalpy.
% v = enthalpy_mole(a)
% :param tp:
%  t:func:`ThermoPhase` (or another
%     object that derives from ThermoPhase)
% :return:
%     Vector of molar specific enthalpies of the species. Units: J/kmol
%

v = thermo_get(a.tp_id, 2);

this is I found in the funciton, maybe there are some misunderstanding of me.
however, thanks!

BTY, I want to calculate is the heat release rate of each reactions instead of species. here is my code:

nu_net = stoich_net(g);
Spe_MoleHeat=enthalpies_RT(g)*gasconstant*temperature(g);   % (kJ/kmol)
moleHeat_Matrix=Spe_MoleHeat.*nu_net;
Rea_HeatRelease=sum(moleHeat_Matrix,1);

I think it should be OK, due to I'm new for Cantera, so want know if you have any ideal about this.
thanks!

Li
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.

Bryan W. Weber

unread,
Jan 3, 2017, 3:21:43 PM1/3/17
to Cantera Users' Group
Hi Li,

Right you are, and Ray pointed it out as well. I was tricked by the summary you posted! Sorry about that. I'll correct this and the updated documentation should be posted soon.

I'd also note that the units of the gasconstant() value returned by Cantera should be J/kmol-K, not kJ/kmol-K. In general, the units used in Cantera are SI units (J, kg, m^3, etc), with the exception of kmol instead of mol.

Best,
Bryan
Reply all
Reply to author
Forward
0 new messages