Skip to content

Commit

Permalink
add back collapsed column init
Browse files Browse the repository at this point in the history
  • Loading branch information
cortespea committed Dec 17, 2023
1 parent 4868c48 commit 94bc90d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
8 changes: 5 additions & 3 deletions biosteam/units/distillation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2310,9 +2310,11 @@ class MESHDistillation(MultiStageEquilibrium, new_graphics=False):
mass balances across stages is used to solve for flow rates instead of mass
fractions.
The initialization algorithm first solves for liquid and vapor flow rates
assuming no phase change across adiabatic stages and unity partition coefficients
at reboilers/condensers (in which case the stripping factor is equal to the
The initialization algorithm first converges a "collapsed" column without
adiabatic stages which have no feeds or side draws. This collapsed column
is initialized by solving for liquid and vapor flow rates assuming no phase
change across adiabatic stages and unity partition coefficients at
reboilers/condensers (in which case the stripping factor is equal to the
boil-up ratio). Then, top and bottom stage temperatures are assumed to be
the bubble point and dew point of the fed mixture and the temperature
across stages are linearly interpolated. The partition coefficients in
Expand Down
22 changes: 11 additions & 11 deletions biosteam/units/phase_equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class MultiStageEquilibrium(Unit):
_N_outs = 2
inner_loop_iter = 1
default_maxiter = 15
default_fallback_maxiter = 6
default_fallback_maxiter = 3
default_molar_tolerance = 0.1
default_relative_molar_tolerance = 0.001
auxiliary_unit_names = (
Expand Down Expand Up @@ -755,19 +755,19 @@ def hot_start(self):
for feed, stage in zip(feeds, feed_stages):
feed_flows[stage, :] += feed.mol[index]
self._iter_args = (feed_flows, self._asplit, self._bsplit, self.N_stages)
# feed_stages = [(i if i >= 0 else N_stages + i) for i in self.feed_stages]
# stage_specifications = {(i if i >= 0 else N_stages + i): j for i, j in self.stage_specifications.items()}
# top_side_draws = {(i if i >= 0 else N_stages + i): j for i, j in self.top_side_draws.items()}
# bottom_side_draws = {(i if i >= 0 else N_stages + i): j for i, j in self.bottom_side_draws.items()}
# all_stages = set([*feed_stages, *stage_specifications, *top_side_draws, *bottom_side_draws])
feed_stages = [(i if i >= 0 else N_stages + i) for i in self.feed_stages]
stage_specifications = {(i if i >= 0 else N_stages + i): j for i, j in self.stage_specifications.items()}
top_side_draws = {(i if i >= 0 else N_stages + i): j for i, j in self.top_side_draws.items()}
bottom_side_draws = {(i if i >= 0 else N_stages + i): j for i, j in self.bottom_side_draws.items()}
all_stages = set([*feed_stages, *stage_specifications, *top_side_draws, *bottom_side_draws])
if (self.use_cache
and all([i.IDs == IDs for i in partitions])): # Use last set of data
pass
# elif len(all_stages) != self.N_stages and not data:
# self.hot_start_collapsed_stages(
# all_stages, feed_stages, stage_specifications,
# top_side_draws, bottom_side_draws,
# )
elif len(all_stages) != self.N_stages and not data:
self.hot_start_collapsed_stages(
all_stages, feed_stages, stage_specifications,
top_side_draws, bottom_side_draws,
)
else:
if data:
top, bottom = ms
Expand Down

0 comments on commit 94bc90d

Please sign in to comment.