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

Function Scoping Fixes #1242

Merged
merged 12 commits into from
Aug 24, 2023
10 changes: 5 additions & 5 deletions idaes/models/unit_models/mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,11 +1180,11 @@ def calculate_scaling_factors(self):
iscale.constraint_scaling_transform(c, s, overwrite=False)

if hasattr(self, "enthalpy_mixing_equations"):
for t, c in self.enthalpy_mixing_equations.items():

def scale_gen():
for p in self.mixed_state[t].phase_list:
yield self.mixed_state[t].get_enthalpy_flow_terms(p)
def scale_gen(t):
for p in self.mixed_state[t].phase_list:
yield self.mixed_state[t].get_enthalpy_flow_terms(p)

s = iscale.min_scaling_factor(scale_gen(), default=1)
for t, c in self.enthalpy_mixing_equations.items():
s = iscale.min_scaling_factor(scale_gen(t), default=1)
iscale.constraint_scaling_transform(c, s, overwrite=False)
Loading
Loading