Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect implementation of partialMolarEntropies in SurfPhase #1313

Closed
speth opened this issue Jun 4, 2022 · 0 comments · Fixed by #1449
Closed

Incorrect implementation of partialMolarEntropies in SurfPhase #1313

speth opened this issue Jun 4, 2022 · 0 comments · Fixed by #1449

Comments

@speth
Copy link
Member

speth commented Jun 4, 2022

Problem description

The implementation of partialMolarEntropies in SurfPhase does not give thermodynamically consistent results.

Steps to reproduce

>>> import cantera as ct
>>> s = ct.Solution('test/data/surface-phases.yaml', 'Pt-surf')
>>> s.TPX = 300, ct.one_atm, 'Pt(s): 0.7, H(s): 0.1, O(s): 0.2'

# Check g_k = h_k - T * s_k
>>> s.chemical_potentials
array([-9.06035518e+05, -4.22973366e+07, -1.14433845e+08])

>>> s.partial_molar_enthalpies - s.T * s.partial_molar_entropies
array([ 0.00000000e+00, -3.65375419e+07, -1.10402994e+08])  # no agreement

# These pairs should be equal
>>> sum(s.partial_molar_entropies * s.X), s.entropy_mole
(581.0752089855705, 7302.323496843512)

>>> sum(s.partial_molar_enthalpies * s.X), s.enthalpy_mole
(-25560030.399718467, -25560030.39971847)

>>> sum(s.chemical_potentials * s.X), s.gibbs_mole
(-27750727.448771518, -27750727.448771525)

>>> s.enthalpy_mole - s.T * s.entropy_mole
-27750727.448771525  # Equals gibbs_mole

System information

  • Cantera version: 2.6.0 or main at 1ab81ac.

Additional context

This was discovered as part of #1299, which implements Cantera/enhancements#114.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant