The general intent here was to enable calculating reaction enthalpies in the Matlab toolbox, as part of the li-ion battery simulations in PR #563. This required several changes: - Create getDeltaEnthalpies.m in Matlab toolbox/@Kinetics, as well as similar methods for Gibbs free energy and entropy of reaction - Add kin_getDelta to kineticsmethods.cpp. - Add getPartialMolarEnthalpies to metalPhase class (it returns all zeros). Note that similar methods are not enabled for the corresponding 'Standard State' methods, for the time being. Mainly because it is difficult for me to envision a significant use case, but also because of some lingering confusion between 'standard' and 'reference' states in Cantera's codebase.
14 lines
435 B
Matlab
14 lines
435 B
Matlab
function dH = getDeltaEnthalpies(a)
|
|
% GETDELTAENTHALPIES Get the enthalpy of reaction for each reaction.
|
|
% dH = getDeltaEnthalpies(a)
|
|
%
|
|
% :param a:
|
|
% Instance of class :mat:func:`Kinetics` (or another
|
|
% object deriving from Kinetics) for which the enthalpies of
|
|
% reaction are desired.
|
|
% :return:
|
|
% Returns a vector of the enthalpy of reaction for each
|
|
% reaction. Units: J/kmol
|
|
%
|
|
|
|
dH = kinetics_get(a.id, 17, 0);
|