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

Inconsistent implementation of chemical potentials and partial molar entropies in IdealMolalSoln #1300

Open
speth opened this issue May 31, 2022 · 0 comments

Comments

@speth
Copy link
Member

speth commented May 31, 2022

Problem description

Steps to reproduce

>>> import cantera as ct
>>> p = ct.Solution('test/data/thermo-models.yaml', 'ideal-molal-aqueous')
>>> p.chemical_potentials
array([-38968574.59879851, -44670331.92380941, -47654928.77054328,
       -50378341.42634466])
>>> p.partial_molar_enthalpies - p.T * p.partial_molar_entropies
array([-1.09382545e+04, -5.71269558e+06, -8.69729243e+06, -1.14207051e+07])
>>> p.gibbs_mole
-38985553.501734525
>>> p.enthalpy_mole - p.T * p.entropy_mole
-27917.15745574266

Behavior

The two pairs of printed quantities should be equal, by the identity μk = hk - T·sk.

The displayed information comes from the implementations of getChemPotentials and getPartialMolarEnthalpies in the IdealMolalSoln class (YAML model name ideal-molal-solution). These two methods are used in the calculation of gibbs_mole and entropy_mole for this phase type, so the second error follows directly from the first.

System information

  • Cantera version: 2.6.0 or main at 8fbb4bc

Attachments

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

No branches or pull requests

1 participant