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
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: