Skip to content

Bug Report: Melamine (CAS 108-78-1) — Tb is inconsistent; melamine sublimes, it has no stable liquid at 1 atm #180

Open

Description

@SomaLily

Summary

thermo.Chemical('melamine') stores Tb = 704.0 K (430.9 °C), treating melamine as a normal solid→liquid→gas compound. In reality, melamine sublimes at its melting temperature (~618 K / 345 °C) under atmospheric pressure; no stable liquid phase exists at 1 atm.

The consequence: Chemical('melamine', T=663.15, P=360e3) returns phase='l' when the correct phase at relevant industrial operating conditions is gas.

A related symptom: the H(T) enthalpy curve shows two separate jumps (s→l at Tm + l→g at Tb) instead of the single jump expected for a subliming compound (s→g at ~Tm).

Environment

  • thermo version: 0.6.0
  • Python: 3.13.9

Reproducer

from thermo.chemical import Chemical

m = Chemical('melamine')
print(f'Tb: {m.Tb:.1f} K ({m.Tb-273.15:.1f} °C)')       # 704.0 K (430.9 °C)
print(f'Tm: {m.Tm:.1f} K ({m.Tm-273.15:.1f} °C)')       # 618.1 K (345.0 °C)

# Phase scan at 101.325 kPa — shows s→l→g (wrong for a subliming compound)
for Tc in [610, 618, 620, 630, 650, 663, 680, 698, 704, 720]:
    m3 = Chemical('melamine', T=Tc, P=101325)
    print(f'  T={Tc}K ({Tc-273.15:.0f}°C): phase={m3.phase}')
# Observed: s (610K) → l (620K) → g (698K)
# Expected for sublimation:  s (610K) → g (698K)    — no liquid phase at 1 atm

# Industrial operating conditions
m_op = Chemical('melamine', T=390+273.15, P=360e3)
print(f'Phase at 390°C / 360 kPa: {m_op.phase}')          # 'l' ← should be 'g'

Evidence 1: Hirt (1960) vapor pressure equation

The classic Hirt, Steger et al. (1960) paper (Journal of Polymer Science) experimentally measured melamine vapor pressure by Knudsen effusion and reported the correlation:

log₁₀(P) = 12.52 − 6440/T (P in mmHg, T in K)

This is the NIST reference for melamine vapor pressure and sublimation enthalpy.

The Hirt equation predicts sublimation, not liquid→gas

At thermo's stored Tm = 618 K, the sublimation vapor pressure is:

P_sub(Tm) = 10^(12.52 − 6440/618) = 126 mmHg = 16.8 kPa

This ~17 kPa is the triple-point pressure of melamine. At 1 atm (101 kPa) ≈ 6× the triple-point pressure, one might expect a stable liquid. However, melamine's high sublimation rate near its melting point means the liquid phase is practically non-existent at atmospheric conditions — the compound goes directly from solid to gas.

Cross-check against stored Tb

If Tb = 704 K is treated as a normal boiling point (where P_sat = 1 atm), the Hirt equation gives:

P(704K) = 10^(12.52 − 6440/704) = 10^3.372 = 2355 mmHg = 3.1 atm

→ At 704 K, the Hirt equation predicts P_sat = 3.1 atm, not 1 atm. The equation is an excellent fit for experimentally validated data (ΔH_sub = 123.2 kJ/mol from slope vs NIST 120±4 kJ/mol), so the error is in the stored Tb, not the equation.

Equation validation

Source ΔH_sub (kJ/mol) Method
Hirt equation slope 123.2 From 6440 × ln(10) × R
Hirt, Steger et al. (1960), NIST 120 ± 4 Knudsen effusion, direct
Stephenson & Malanowski (1987) 121.3 ± 4.2 Literature compilation
Thermo's own Hsubm 120.0 (stored value, matches NIST)

(Note: Thermo also stores Joback-estimated Hsub = 951.5 kJ/mol and Hvap_Tb = 603.5 kJ/mol, which overestimate ~8× for the triazine ring; the m-suffixed properties are the correct literature values.)

Evidence 2: Industrial practice

The urea-to-melamine pyrolysis process operates at 380–400 °C and ~360 kPa, with melamine collected as a gas-phase product. At these conditions (T=390°C, P=360 kPa), Chemical('melamine') returns phase='l', contradicting industrial practice.

The phase misprediction has a significant enthalpy impact: the liquid-phase enthalpy at 390°C excludes the vaporization enthalpy (~92 kJ/mol from Hsubm − Hfusm), causing errors of ~1 GJ per tonne of melamine in reaction enthalpy calculations.

Evidence 3: H vs T enthalpy scan — two jumps instead of one

Image

The H vs T scan at 1 atm reveals the problem visually: thermo produces two separate enthalpy jumps at the positions of Tm and Tb, when a subliming compound should show a single jump at the sublimation temperature.

Transition Temperature Enthalpy change
s → l 620 K (3°C above Tm) +29.2 kJ/mol (Hfus)
l → g 700 K (4°C below Tb) +77.5 kJ/mol (Hvap)
Sum (s→g) — 106.7 kJ/mol
Expected s→g ~618 K ~120 kJ/mol (Hsub)

The two jumps sum to 106.7 kJ/mol — close to the expected Hsub of 120 kJ/mol, but split incorrectly into melting + vaporization at the wrong temperatures. The 13 kJ/mol gap is due to the sensible heat of the spurious liquid phase that shouldn't exist at 1 atm.

import numpy as np
import matplotlib.pyplot as plt
from thermo.chemical import Chemical

species = 'melamine'
P = 101325  # Pa (1 atm)
T_min, T_max, N = 580, 730, 150

temps = np.linspace(T_min, T_max, N)
H_vals, phases = [], []
for T in temps:
    m = Chemical(species, T=T, P=P)
    H_vals.append(m.H)
    phases.append(m.phase)
H_vals = np.array(H_vals)

fig, ax = plt.subplots(figsize=(10, 5))
colors = {'s': '#4a90d9', 'l': '#e67e22', 'g': '#e74c3c'}
for ph in ('s', 'l', 'g'):
    mask = np.array(phases) == ph
    if mask.any():
        ax.scatter(temps[mask], H_vals[mask], c=colors[ph], s=8,
                   label={'s':'Solid','l':'Liquid','g':'Gas'}[ph])

m0 = Chemical(species)
for name, Tv in [('Tm', m0.Tm), ('Tb', m0.Tb)]:
    ax.axvline(Tv, color='#2c3e50', ls='--', lw=0.8, alpha=0.5)
    ax.text(Tv+3, ax.get_ylim()[1]*0.95, f'{name}={Tv:.0f}K', fontsize=8)

ax.set_xlabel('T (K)'); ax.set_ylabel('H (J/kg)')
ax.set_title(f'{species} — H vs T (P={P/101325:.2f} atm)')
ax.legend(); ax.grid(alpha=0.3)
fig.tight_layout()
fig.savefig('/tmp/melamine_H_vs_T.png', dpi=150)

Suggested Fix

Melamine should be treated as a subliming compound. At atmospheric pressure, it does not have a stable liquid phase. The Hsub and Tb parameters should be consistent with sublimation behavior.

  1. Set Tb to match Tm (~618 K / 345 °C), since melamine sublimes at its melting temperature. The solid→gas transition temperature is ~618 K, not 704 K.
  2. Alternatively, mark melamine as a subliming compound, so the s→l→g phase sequence is replaced by direct s→g.

Additionally: the inflated Joback-estimated values (Hsub = 951.5 kJ/mol, Hfus = 220.4 kJ/mol, Hvap_Tb = 603.5 kJ/mol) should be corrected to match the literature data already stored in the m-suffixed properties (Hsubm = 120.0, Hvapm = 127.3, Hfusm = 27.8).

References

  1. Hirt, R. C., Steger, J. E., et al. Vapor Pressure of Melamine. Journal of Polymer Science, 1960.
    — Primary source of the vapor pressure correlation. Knudsen effusion, ΔsubH° = 120 ± 4 kJ/mol.

  2. Stephenson, R. M., Malanowski, S. Handbook of the Thermodynamics of Organic Compounds. Elsevier, 1987.
    — ΔsubH° = 121.3 ± 4.2 kJ/mol.

  3. Dorofeeva, O. V. Quantum-chemical study of gas-phase enthalpies of formation of urea-derived compounds. Struct. Chem. 28, 1541–1550 (2017). DOI: 10.1007/s11224-017-0937-4
    — QC-derived ΔsubH° ≈ 142 kJ/mol, same order of magnitude.


Reported from industrial chemical engineering context. Happy to provide additional validation data or participate in discussion.

Activity

  1. CalebBell commented on Jun 12, 2026

    @CalebBell
    Owner
    1. The chemical class should not be used for this sort of equilibrium - it's a legacy class.
    2. The correct fix, using a flasher and configuring solid/liquid/gas phases and letting the sublimation happen because it's what minimizes Gibbs energy, requires more development on solid phases inside the library.
    3. The data in thermo would have to predict the sublimation was thermodynamicaly favorable. This might take some coaxing because while there is some experimental data, the liquid properties are predicted.
    4. The incomplete work that I experimented with, GibbsExcessSolid, can be configured along with e.g. an IdealGas without a liquid phase - this may be helpful. GibbsExcessSolid is not documented or exposed any may change radically in the future.
  2. SomaLily commented on Jun 18, 2026

    @SomaLily
    Author

    Positive follow-up to the melamine phase issue.

    We ran the urea → melamine pyrolysis calculation through three independent paths, all converging:

    Path Method ΔH/t melamine Theoretical gas (Nm³/t)
    thermo (corrected) H_tot + phase fix (Hsubm − Hfusm) + 0°C Nm³ alignment 5.561 GJ/t 155.3
    Dorofeeva 2017 Std formation enthalpy of melamine(g) ΔfH° = 70.1 kJ/mol + sensible heat 5.56 GJ/t 157
    NIST report Hess's law dual-path closure 5.666 GJ/t 158

    After correcting for the melamine phase misjudgment (l→g) and aligning to 0°C Nm³ (Chinese engineering standard), thermo's result deviates from the NIST benchmark by only −1.7% in gas consumption.

    More importantly: the Dorofeeva path uses a different data source for melamine gaseous ΔfH° — no thermo involved — and still lands within 1.3% of thermo's corrected value. This cross-validation suggests the underlying property database (Hfm, Hsubm, Hfusm from the m-suffixed attributes) is reliable for this reaction once the phase judgment is fixed.

    Thought this might be useful as a confidence check. Thanks for thermo — it held up under a real industrial benchmark.

    — mave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions