Skip to content

Support solid-solid transitions in element standard-state formation integrals - #186

Open
gaoflow wants to merge 1 commit into
CalebBell:masterfrom
gaoflow:fix-standard-state-solid-transitions
Open

Support solid-solid transitions in element standard-state formation integrals#186
gaoflow wants to merge 1 commit into
CalebBell:masterfrom
gaoflow:fix-standard-state-solid-transitions

Conversation

@gaoflow

@gaoflow gaoflow commented Jul 31, 2026

Copy link
Copy Markdown

standard_state_ideal_gas_formation raises NotImplementedError for any element outside the
20-entry whitelist in chemical_utils.py. H2S, SO2, SO3, H2SO4, CS2, and TiO2 all crash on it
today. The whitelist sits right next to six data entries commented out with # TODO (Mn, Ti,
Ca, S, Be, Fe), and an abandoned elif ele == "S": raise NotImplementedError branch shows the
transition handling was scaffolded and never finished.

Root cause: element_standard_state_integral integrates the solid heat capacity in one piece
and ignores the solid_T_trans/solid_H_trans keys, so no element with solid-solid
transitions could be expressed. The generic path now segments the solid integral at each
transition temperature, adding H_trans to dH and H_trans/T_trans to dS when crossed — the same
formula already used for melt and vaporization. Elements without transitions are unchanged.

Activated Mn, Ti, Be, and S; their commented values are exactly the NIST-JANAF element tables
(S: 368.3 K / 401 J; Mn: 980/1361/1412 K; Ti: 1166 K; Be: 1527 K). Formation values now match
the JANAF compound tables: H2S/SO2/SO3/H2SO4/CS2 and TiO2 within ~1% (tests added, element
paths cross-checked against JANAF S-001/Mn-001/Ti-001/Be-001).

Ca and Fe stay commented: Ca's solid Cp fit in this repo is ~50% off JANAF (the transition
data is right but the integral would be wrong), and Fe's entry has no boiling point — its
Tm: 3133.345 is actually the boiling point.

Sulfur's 432 K liquid-liquid lambda anomaly (noted in the old branch's comment) is not modeled;
the commented data omits it.

Repro before: standard_state_ideal_gas_formation(Chemical('H2S'), 400.0) → NotImplementedError.
After: computes, matches JANAF H-080 at 1% rtol. pytest tests/test_chemical_utils.py 32 passed.

The generic standard_state_transitions path in element_standard_state_integral
integrated the solid Cp in one piece and ignored solid_T_trans/solid_H_trans,
so no element with solid-solid transitions could be expressed. The path now
segments the solid integral at each transition temperature and adds the
transition enthalpy/entropy when crossed.

Activates the commented-out Mn, Ti, Be, and S data (all NIST-JANAF exact);
S fixes standard_state_ideal_gas_formation for H2S, SO2, SO3, H2SO4, CS2, and
Ti fixes TiO2. Ca and Fe stay commented: Ca's solid Cp fit is ~50% off JANAF,
and Fe's Tm value is actually its boiling point.

Tests cross-check formation values against the JANAF compound tables and the
element paths against JANAF S-001/Mn-001/Ti-001/Be-001.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant