From 613a5b2d90df57d5972725bce9451c1e96d7521e Mon Sep 17 00:00:00 2001 From: cortespea Date: Sun, 17 Dec 2023 16:33:09 -0600 Subject: [PATCH] update submodules --- biosteam/units/phase_equilibrium.py | 24 +++++++++++++++++------- thermosteam | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/biosteam/units/phase_equilibrium.py b/biosteam/units/phase_equilibrium.py index 8f4724f3..7dabecde 100644 --- a/biosteam/units/phase_equilibrium.py +++ b/biosteam/units/phase_equilibrium.py @@ -223,9 +223,16 @@ def _run(self, stacklevel=1, P=None, solvent=None, update=True, IDs = p.IDs else: eq = ms.lle - lle_chemicals, K_new, phi = eq(T=ms.T, P=P, top_chemical=solvent, update=update) + if update: + eq(T=ms.T, P=P, top_chemical=solvent, update=update) + lle_chemicals, K_new, phi = eq._lle_chemicals, eq._K, eq._phi + else: + lle_chemicals, K_new, phi = eq(T=ms.T, P=P, top_chemical=solvent, update=update) self.phi = phi self.T = ms.T + if couple_energy_balance: + T = self.T + for i in self.outs: i.T = T IDs = tuple([i.ID for i in lle_chemicals]) IDs_last = self.IDs if IDs_last and IDs_last != IDs: @@ -617,10 +624,12 @@ def _run(self): f = self.multistage_equilibrium_iter top_flow_rates = self.hot_start() top_flow_rates = flx.conditional_fixed_point(f, top_flow_rates) - if self.iter == self.maxiter: - self.fallback_iter = 0 - top_flow_rates = flx.conditional_fixed_point(self._sequential_iter, top_flow_rates) - self.update(top_flow_rates) + self.fallback_iter = 0 + self.update( + top_flow_rates + if self.iter == self.maxiter + else flx.conditional_fixed_point(self._sequential_iter, top_flow_rates) + ) def _hot_start_phase_ratios_iter(self, top_flow_rates, *args @@ -993,8 +1002,9 @@ def multistage_equilibrium_iter(self, top_flow_rates): else: # LLE for i in stages: i.mixer._run() - i.partition._run(P=P, solvent=self.solvent_ID, update=False, - couple_energy_balance=False) + partition = i.partition + partition._run(P=P, solvent=self.solvent_ID, update=False, + couple_energy_balance=True) new_top_flow_rates = self._get_top_flow_rates(False) mol = top_flow_rates.flatten() mol_new = new_top_flow_rates.flatten() diff --git a/thermosteam b/thermosteam index 1d6797dc..41c2c9ac 160000 --- a/thermosteam +++ b/thermosteam @@ -1 +1 @@ -Subproject commit 1d6797dcedfbe5216c6fa525685544a34e5de0bd +Subproject commit 41c2c9acc0edc7beaf4074cc70cb7053f852ba98