Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative flow rates in BTX and demo flowsheet ill-conditioning #1439

Open
dallan-keylogic opened this issue Jun 18, 2024 · 2 comments
Open
Labels
Priority:Normal Normal Priority Issue or PR

Comments

@dallan-keylogic
Copy link
Contributor

While working on #1395, I found that changes I made to the BTX scaling caused test failures for the demo flowsheet on Linux while tests succeeded on Windows. Trying to dig into the problem I discovered two issues:

  1. The problem Jacobian had a condition number on the order of 10^15
  2. There were negative values for flow_mol_phase in model.fs.M01.inlet_2_state.

I dealt with the second issue by adding bounds for it (and other similar variables) in #1395, but that caused the initialization to fail. Because it was clear that something was fundamentally wrong with the flowsheet that scaling could not fix, I didn't want #1395 to be dragged even further off-topic and so xfailed two tests involving the demo flowsheet.

Somebody needs to go back and either fix the issues with the demo flowsheet or replace the BTX property package with some suitable variation of the modular properties.

There appears to be an issue where the heater in the flowsheet has very little to do, because the feed comes in at 377 K and the heater outlet is set to 380 K. However, lowering the feed temperature didn't fix the underlying singularity.

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Jun 20, 2024
@dallan-keylogic
Copy link
Contributor Author

From the developer call on 6/20/24. This is a significant issue, negative flow rates call results into question in many tests. Naively adding lower bounds of 0 to flow_mol_phase and flow_mol_phase_comp causes seven tests to fail:

FAILED idaes/core/solvers/tests/test_homotopy.py::test_ideal_prop - AssertionError
FAILED idaes/core/solvers/tests/test_homotopy.py::test_ideal_prop_max_iter - AssertionError
FAILED idaes/models/unit_models/tests/test_gibbs.py::TestInitializers::test_block_triangularization - idaes.core.util.exceptions.InitializationError: fs.unit failed to initialize successfully: uninitialized variables or unconverged equality constraints detected. Please check postcheck summary for more information (largest residual above tolerance = 229.82787418188317).
FAILED idaes/models_extra/column_models/tests/test_reboiler.py::TestBTXIdeal::test_initialize - idaes.core.util.exceptions.InitializationError: fs.unit failed to initialize successfully. Please check the output logs for more information.
FAILED idaes/models_extra/column_models/tests/test_reboiler.py::TestBTXIdeal::test_solve - AssertionError
FAILED idaes/models_extra/column_models/tests/test_reboiler.py::TestBTXIdeal::test_solution - AssertionError
FAILED idaes/models_extra/column_models/tests/test_tray_column.py::TestBTXIdealFcTP::test_initialize - idaes.core.util.exceptions.InitializationError: fs.unit.reboiler failed to initialize successfully. Please check the output logs for more information.
FAILED idaes/models_extra/column_models/tests/test_tray_column.py::TestBTXIdealFcTP::test_solve - AssertionError
FAILED idaes/models_extra/column_models/tests/test_tray_column.py::TestBTXIdealFcTP::test_solution - AssertionError

We should probably wait to solve this issue until the new scaling tools are implemented, and it's not clear who's going to fix this issue.

@ksbeattie
Copy link
Member

This will wait for the new scaling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants