From 988705b9dee8714c9753077bdc6d65eef200bad9 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Wed, 15 Jul 2026 20:29:25 -0400 Subject: [PATCH] fix bug for when (vle) chemicals exist --- thermosteam/equilibrium/vle.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/thermosteam/equilibrium/vle.py b/thermosteam/equilibrium/vle.py index 40d124ab..03a48816 100644 --- a/thermosteam/equilibrium/vle.py +++ b/thermosteam/equilibrium/vle.py @@ -1133,10 +1133,13 @@ def set_PS(self, P, S, gas_conversion=None, liquid_conversion=None): self._S_hat = S_hat def set_PH(self, P, H, gas_conversion=None, liquid_conversion=None): - self._setup(gas_conversion, liquid_conversion) + try: + self._setup(gas_conversion, liquid_conversion) + except NoEquilibrium: + self._N = 0 # no chemicals or no vle chemicals thermal_condition = self._thermal_condition thermal_condition.P = self._P = P - if self._N == 0: + if self._N == 0: thermal_condition.T = self.mixture.xsolve_T_at_HP( self._phase_data, H, thermal_condition.T, P )