idaes-pse
idaes-pse copied to clipboard
Cubic EoS model fails to initialize at high pressures.
An external user brought a use case to my attention where the Cubic EoS model failed to converge at high pressures.
The issue appears to be that the deviation between the ideal initial guess and the actual solution for bubble temperature is large enough to cause the solver to fail (scaling might also be an issue).
Test case files attached.
Rahul Ghandi also suggested a better way to initialize the vapour and liquid compositions in the two-phase region.
One suggestion:
-
For two phase region, can we initialize the phase flow based on distance of temperature from Tdew and Tbubble.
-
Once we have approximate feed that is vaporized (step above), we can use Rachford-Rice method to calculate vapor and liquid phase composition. I did a quick calculation and results are as below. The initial guess for phase composition is better (than assuming same as feed).
vapRatio = ((blk[k].temperature.value - blk[k].temeprature_bubble.value) /
(blk[k].temeprature_dew.value - blk[k].temeprature_bubble.value))
blk[k].flow_mol_phase["Vap"].value = vapRatio*blk[k].flow_mol.value
blk[k].flow_mol_phase["Liq"].value = (1-vapRatio)*blk[k].flow_mol.value
# Initialize the vapor and liquid compositions using Rachford-Rice equation
for j in blk[k].params.component_list:
psat = 1e5*10**(blk[k].params.antoine[j, "1"] - blk[k].params.antoine[;, "2"] /
(blk[k].temperature.value + blk[k].params.antoine[j, "3"]))
kfact = psat/blk[k].pressure.value
blk[k].mole_frac_phase_comp["Liq", j].value = blk[k].mole_frac_comp[j]/(1+vapRatio*(kfact-1))
blk[k].mole_frac_phase_comp["Vap", j].value = blk[k].mole_frac_phase_comp["Liq", j].value*kfact
Closing due to lack of activity.