IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
206 stars 228 forks source link

Crash in state initialization when init_VLE flag is false #1424

Closed vova292 closed 1 month ago

vova292 commented 1 month ago

https://github.com/IDAES/idaes-pse/blob/1c337b9902efa356014cb41d0f25c1b8b820f3d5/idaes/models/properties/modular_properties/state_definitions/FTPx.py#L497

In the line linked above, the variable vap_frac does not exist if init_VLE flag is False. The else section is missing.

So when init_VLE is False the code will crash

andrewlee94 commented 1 month ago

@vova292 Thank you for filing this issue (and #1423) - I've confirmed both of them and have a fix ready for testing and review. Do you happen to have a simple test case that triggers this issue at all?

vova292 commented 1 month ago

I had created this by using a Feed unit model in a flowsheet. Using the Coolprop property package with multiple components but a single Liquid phase for all the components. The valid phase was also just liquid.

Unfortunately i dont have that running example at the moment.

andrewlee94 commented 1 month ago

@vova292 I think I put together an example that will test for this case. PR #1425 will hopefully fix this and your other issue.