Skip to content

IonsFromNeutralPhase has inconsistent implementations of some thermo properties #1322

@speth

Description

@speth

Problem description

The IonsFromNeutralPhase class (YAML phase name ions-from-neutral-molecule) has several thermodynamic inconsistencies, mostly relating to the Gibbs free energy.

Steps to reproduce

>>> p = ct.Solution('test/data/thermo-models.yaml', 'ions-from-neutral-molecule')
>>> p.TPX = 500, 2e5, (0.1, 0.1)

# These pairs should be equal
>>> p.g, p.h - p.T*p.s
(-6295054.121796026, -16996646.128849268)

>>> p.volume_mole, sum(p.X * p.partial_molar_volumes)
(0.018785000000000003, 0.05071950000000001)

>>> p.chemical_potentials
array([-4.66404010e+08, -2.88157316e+06])
# should be equal to the chemical potentials
>>> p.partial_molar_enthalpies - p.T * p.partial_molar_entropies
array([-5.60261127e+08, -7.06809948e+08])

>>> p.activities
array([0.5, 0.5])
# should be equal to the activities
>>> np.exp(p.chemical_potentials / (p.T * ct.gas_constant) - p.standard_gibbs_RT)
array([3.19127299e+09, 1.72355301e+73])

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions