From fa8ad41435e8477d5a01b9564059cba4af55052f Mon Sep 17 00:00:00 2001 From: Yoel Cortes-Pena Date: Mon, 15 Jan 2024 19:25:10 -0600 Subject: [PATCH] fix bug --- thermosteam/separations.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/thermosteam/separations.py b/thermosteam/separations.py index 8f069ac3..96a3f990 100644 --- a/thermosteam/separations.py +++ b/thermosteam/separations.py @@ -544,10 +544,15 @@ def partition(feed, top, bottom, IDs, K, phi=None, top_chemicals=None, feed_mol = feed.mol mol = feed.imol[IDs] F_mol = mol.sum() - if not bottom.shares_flow_rate_with(feed): bottom.empty() - Fa = feed.imol[top_chemicals].sum() if top_chemicals else 0. + if top_chemicals: + top.imol[top_chemicals] = top_flows = feed.imol[top_chemicals] + bottom.imol[top_chemicals] = 0 + Fa = top_flows.sum() if hasattr(top_flows, 'sum') else top_flows + else: + Fa = 0. if bottom_chemicals: bottom.imol[bottom_chemicals] = bottom_flows = feed.imol[bottom_chemicals] + top.imol[bottom_chemicals] = 0 Fb = bottom_flows.sum() if hasattr(bottom_flows, 'sum') else bottom_flows else: Fb = 0.