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

SurfPhase does not bound chemical potentials at zero mole fraction #1314

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

SurfPhase does not bound chemical potentials at zero mole fraction #1314

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 chemicalPotentials in SurfPhase does not bound the chemical potentials to finite values at the limit of zero mole fraction for each species. This is different from the behavior of other phase models, and inconsistent with the definition of the partialMolarEntropies method for this phase.

>>> import cantera as ct
>>> s = ct.Interface('test/data/surface-phases.yaml', 'Pt-surf')
>>> s.TPX = 300, ct.one_atm, 'Pt(s): 0.7, H(s): 0.3, O(s): 0'
>>> s.gibbs_mole
-12463347.594169196

>>> s.chemical_potentials
array([  -868050.64349966, -39519040.47906478,               -inf])

>>> sum(s.chemical_potentials * s.X)
nan

# In contrast, entropy is finite
>>> s.partial_molar_entropies
array([   0.        ,  455.97960377, 2677.38624304])

# For other phases, chem potentials are finite even at zero mole fraction
>>> gas = ct.Solution('h2o2.yaml')
>>> gas.X
array([1., 0., 0., 0., 0., 0., 0., 0., 0., 0.])

>>> gas.chemical_potentials
array([-3.92042461e+07, -1.53944629e+09, -1.52217254e+09, -1.78457285e+09,
       -1.73880306e+09, -2.02150142e+09, -1.77920778e+09, -1.92926533e+09,
       -1.76944793e+09, -1.78048060e+09])

System information

  • Cantera version: 2.6.0 or main at decda93

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