Skip to content

Commit 8db87b5

Browse files
authored
Merge pull request #165 from tannerpolley/tanner/methanol_vle_smooth_transition
Added an initial solving step for the methanol flowsheet for the optimization portion
2 parents 817a0a0 + 4016a08 commit 8db87b5

File tree

5 files changed

+11660
-2789
lines changed

5 files changed

+11660
-2789
lines changed

idaes_examples/notebooks/docs/flowsheets/methanol_flowsheet_w_recycle.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,26 @@ def main(m):
916916

917917
print()
918918
print("Solving optimization problem...")
919+
920+
# Pass 1: smoothed VLE transition
921+
eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq)
922+
m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(
923+
eps_nominal * 2.5
924+
)
925+
m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(
926+
eps_nominal * 2.5
927+
)
928+
919929
opt_res = solver.solve(m, tee=True)
920930
assert opt_res.solver.termination_condition == TerminationCondition.optimal
931+
932+
# Pass 2: restore default smoothness
933+
m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal)
934+
m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal)
935+
936+
opt_res = solver.solve(m, tee=True)
937+
assert opt_res.solver.termination_condition == TerminationCondition.optimal
938+
921939
print("Optimal solution process results:")
922940
report(m)
923941

0 commit comments

Comments
 (0)