forked from Cantera/cantera
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposing getDeltaEnthalpies to Matlab interface.
The general intent here was to enable calculating reaction enthalpies in the Matlab toolbox, as part of the li-ion battery simulations in PR Cantera#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.
- Loading branch information
1 parent
ccaf7ab
commit 75421d7
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function dS = getDeltaEntropies(a) | ||
% GETDELTAENTROPIES Get the entropy of reaction for each reaction. | ||
% dS = getDeltaEntropies(a) | ||
% | ||
% :param a: | ||
% Instance of class :mat:func:`Kinetics` (or another | ||
% object deriving from Kinetics) for which the entropies of | ||
% reaction are desired. | ||
% :return: | ||
% Returns a vector of the entropy of reaction for each | ||
% reaction. Units: J/kmol-K | ||
% | ||
|
||
dS = kinetics_get(a.id, 17, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function dG = getDeltaGibbs(a) | ||
% GETDELTAGIBBS Get the Gibbs free energy of reaction for each reaction. | ||
% dG = getDeltaGibbs(a) | ||
% | ||
% :param a: | ||
% Instance of class :mat:func:`Kinetics` (or another | ||
% object deriving from Kinetics) for which the Gibbs free | ||
% energies of reaction are desired. | ||
% :return: | ||
% Returns a vector of the Gibbs free energy of reaction | ||
% for each reaction. Units: J/kmol | ||
% | ||
|
||
dG = kinetics_get(a.id, 17, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters