Skip to content

Crash in PhaseDiagram.binary_vle for nitrogen/propane mixture at 126.58 K #361

Description

@RolfStierle

When calculating a binary vapor-liquid equilibrium (VLE) phase diagram for a mixture of nitrogen and propane using the PC-SAFT equation of state, the code crashes at a specific temperature (126.58 K).

Here is the minimal reproducible example that triggers the crash:

from feos import Parameters, EquationOfState, PhaseDiagram
from si_units import *

substances = ["nitrogen", "propane"]

parameters = Parameters.from_json(substances, 'esper2023.json', binary_path='bauer2026_binary.json')
eos = EquationOfState.pcsaft(parameters)

# The crash occurs on the following line
dia = PhaseDiagram.binary_vle(eos, temperature_or_pressure=126.58*KELVIN, npoints=501)
thread '<unnamed>' (99962) panicked at crates/feos-core/src/phase_equilibria/phase_diagram_binary.rs:271:24:
index out of bounds: the len is 100 but the index is 100

---------------------------------------------------------------------------
PanicException                            Traceback (most recent call last)
Cell In[4], line 9
      6 parameters = Parameters.from_json(substances, 'esper2023.json', binary_path='bauer2026_binary.json')
      7 eos = EquationOfState.pcsaft(parameters)
----> 9 dia = PhaseDiagram.binary_vle(eos, temperature_or_pressure=126.58*KELVIN, npoints=501)

PanicException: index out of bounds: the len is 100 but the index is 100

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions