Skip to content

Metal/electron-cloud: thermo consistency errors caused by placeholder density #2131

Description

@speth

Problem description

The electron-cloud thermo model (class MetalPhase) includes a specification for the density, which is described in the YAML documentation as "the density of the bulk metal". However, this density is then used to determine the molar volume of the electron cloud "phase" and used in a thermodynamically inconsistent way in the calculation of gibbs_mole, enthalpy_mole, and intEnergy_mole.

For a phase with a constant density (or equivalently, molar volume), the following thermodynamic identities should be satisfied:

$$ \left(\frac{\partial G}{\partial P}\right)_T = V $$ $$ \left(\frac{\partial H}{\partial P}\right)_T = V − T\left(\frac{\partial V}{\partial T}\right)_P = V $$ $$ \left(\frac{\partial U}{\partial P}\right)_T = \left(\frac{\partial H}{\partial P}\right)_T − V − P\left(\frac{\partial V}{\partial P}\right)_T = 0 $$

However, the current implementation instead currently gives:

$$ \left(\frac{\partial G}{\partial P}\right)_T = 0 $$ $$ \left(\frac{\partial H}{\partial P}\right)_T = 0 $$ $$ \left(\frac{\partial U}{\partial P}\right)_T = -V $$

Since this model is meant to represent conduction electrons in a metal, where these electrons are not a phase with their own volume but rather a bookkeeping device, the thermodynamically meaningful quantity is the electron's partial molar volume: the change in system volume when one mole of conduction electrons is added at fixed T, P, and host composition. This partial molar volume should be zero and any real volume change of an electrode as it charges/discharges belongs to the host phase's equation of state (for example, the binary-solution-tabulated electrode).

If we set the molar volume of this phase to zero, then we will obtain thermodynamic consistency with all three of the above partial derivatives being equal to zero.

Suggested fix: make the phase volumeless

Give the electron-cloud phase zero (partial) molar volume, declared directly rather than derived from a density:

  1. Override the volume to zero. Make molarVolume() and the partial molar volumes return 0. This is the operational way to express "layered into another phase; adds no volume of its own" in Cantera's additive-volume multiphase model.

  2. Leave the potentials alone. gibbs_mole(), enthalpy_mole(), entropy_mole(), getChemPotentials(), getStandardChemPotentials(), getPartialMolarEnthalpies() stay at 0. They are now legitimately consistent with V = 0.

  3. Remove the intEnergy_mole() override. With H = 0 and V = 0, the base-class U = H − PV = 0 is automatic.

  4. Deprecate the density field. It no longer defines the thermodynamic volume.

System information

  • Cantera version: 4.0.0a1 / main branch at 622e305
  • OS: any
  • Python/MATLAB/other software versions: any

This Issue description was partially written using Claude Opus 4.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions