Skip to content

Expose partial molar thermo properties to MATLAB#1761

Merged
speth merged 5 commits intoCantera:mainfrom
ischoegl:matlab-thermo
Aug 15, 2024
Merged

Expose partial molar thermo properties to MATLAB#1761
speth merged 5 commits intoCantera:mainfrom
ischoegl:matlab-thermo

Conversation

@ischoegl
Copy link
Copy Markdown
Member

@ischoegl ischoegl commented Aug 6, 2024

Changes proposed in this pull request

Expose partial molar thermo properties to MATLAB, and remove mislabeled reference state enthalpies_RT. The fix sidesteps the discussion of "standard state" vs "reference state" nomenclature of #522, and instead focuses on quantities that are relevant to the actual state. Added properties are:

  • ThermoPhase.partialMolarEnthalpies
  • ThermoPhase.partialMolarEntropies
  • ThermoPhase.partialMolarIntEnergies
  • ThermoPhase.partialMolarCp
  • ThermoPhase.partialMolarVolumes
  • ThermoPhase.electrochemicalPotentials

If applicable, fill in the issue number this pull request is fixing

Closes #522

If applicable, provide an example illustrating new features this pull request is introducing

>> gas = Solution('h2o2.yaml');
>> gas.TPX = {300, OneAtm, 'H2:1,O2:1'};
>> gas.equilibrate('HP');
>> gas.partialMolarEnthalpies

ans =

   1.0e+08 *

    0.8545    2.7231    3.0389    0.9457    1.2587   -1.1919    1.4706    0.4063    0.5432    0.8945

>> gas.partialMolarEnthalpies * gas.X'

ans =

   6.6029e+04

>> gas.H

ans =

   6.6029e+04

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 59.52381% with 17 lines in your changes missing coverage. Please review.

Project coverage is 73.13%. Comparing base (9d0e54a) to head (682bde8).
Report is 31 commits behind head on main.

Files Patch % Lines
src/clib/ct.cpp 59.52% 17 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1761   +/-   ##
=======================================
  Coverage   73.12%   73.13%           
=======================================
  Files         381      381           
  Lines       54175    54217   +42     
  Branches     9226     9224    -2     
=======================================
+ Hits        39615    39650   +35     
- Misses      11600    11607    +7     
  Partials     2960     2960           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ischoegl ischoegl marked this pull request as ready for review August 6, 2024 11:52
@ischoegl ischoegl requested a review from a team August 6, 2024 12:49
@ischoegl ischoegl mentioned this pull request Aug 14, 2024
5 tasks
Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @ischoegl. This looks good to me.

@speth speth merged commit 4c8f9e9 into Cantera:main Aug 15, 2024
@ischoegl ischoegl deleted the matlab-thermo branch August 19, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Matlab species thermo properties consistent and useful

2 participants