The SAFT-VRQ-Mie functional converges less robustly than PC-SAFT due to the calculation of local mole fractions. Due to the Gibbs phenomenon, it is almost unavoidable that the density within the pore wall becomes 0 at some point. In that case the calculation of local mole fractions generates NaN.
One remedy for pure components is to write a dedicated implementation of the functional specifically for pure components.
Other remedies would be to "clean" the values of the Helmholtz energy density in places where the (total) density is zero or rewrite the functional without calling the equation of state.
The SAFT-VRQ-Mie functional converges less robustly than PC-SAFT due to the calculation of local mole fractions. Due to the Gibbs phenomenon, it is almost unavoidable that the density within the pore wall becomes 0 at some point. In that case the calculation of local mole fractions generates NaN.
One remedy for pure components is to write a dedicated implementation of the functional specifically for pure components.
Other remedies would be to "clean" the values of the Helmholtz energy density in places where the (total) density is zero or rewrite the functional without calling the equation of state.