Skip to content

Commit

Permalink
and api for biosteam
Browse files Browse the repository at this point in the history
  • Loading branch information
cortespea committed Dec 23, 2023
1 parent 1028173 commit 06f697e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion thermosteam/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ def __getitem__(self, key):
def __reduce__(self):
return self.from_data, (self.get_data(), self._ID, self._price, self.characterization_factors, self._thermo)

def _update_decoupled_variable(self, variable, value):
if variable == 'mol':
self.mol[:] = value
else:
raise NotImplementedError(f'variable {variable!r} cannot be updated')

def scale(self, scale):
"""
Multiply flow rate by given scale.
Expand Down Expand Up @@ -2011,7 +2017,11 @@ def f(x, done=[False]):
vle(T=T, P=P)
done[0] = no_vapor and not data[1].any() # No VLE
return data.to_array()
data[:] = flx.fixed_point(f, data / total_flow, xtol=1e-3, checkiter=False, checkconvergence=False, convergenceiter=10) * total_flow
data[:] = total_flow * flx.fixed_point(
f, data / total_flow, xtol=1e-3,
checkiter=False, checkconvergence=False,
convergenceiter=10
)

@property
def vle_chemicals(self) -> list[tmo.Chemical]:
Expand Down

0 comments on commit 06f697e

Please sign in to comment.