Revised vapor composition constraints fix ZeroDivisionError when gdp.hull reformulation is applied#47
Revised vapor composition constraints fix ZeroDivisionError when gdp.hull reformulation is applied#47
Conversation
…hull reformulation is applied
|
As long as there are no errors, this PR is ready to be merged. @bernalde |
bernalde
left a comment
There was a problem hiding this comment.
Besides some small changes the most important part is verifying that both the Big-M and HR can provided the right solution to the problem and that the new introduced variables/constraints did not modify the optimal solution
| m.dHvap[comp] = dHvapb[comp] / m.Hscale | ||
|
|
||
| ## Heat capacity calculation for liquid and vapor phases using Ruczika-D method for each component in the feed, section, and tray | ||
| ## Heat capacity calculation for liquid and vapor phases for each component in the feed, section, and tray |
There was a problem hiding this comment.
Why remove the comment on the method? Is that method not used? If it is used, leave the comment and add a reference
| m.prop[comp, 'TC'] / m.Tup, | ||
| m.prop[comp, 'TC'] / m.Tlo, | ||
| ), # (0, None), | ||
| initialize=lambda m, sec, tray, comp: m.T0[sec, tray] / m.Tlo, |
There was a problem hiding this comment.
I like this way of defining bounds and initializations!
| m.prop[comp, 'TC'] | ||
| / m.T[1, n_tray] | ||
| m.Tr[1, n_tray, comp] | ||
| # m.prop[comp, 'TC'] |
There was a problem hiding this comment.
Why leave these lines here? If the code works, remove the comments as they become confusing
| ) | ||
| ) | ||
| / m.P[1, n_tray] | ||
| # / m.P[1, n_tray] |
There was a problem hiding this comment.
Remove comment as pressure multiplied in the other side of the equality
| """ | ||
| return m.Tr[4, n_tray, comp] * m.T[4, n_tray] == m.prop[comp, 'TC'] | ||
|
|
||
| @disj.Constraint(m.comp, doc="Top scetion 4 vapor composition") |
f798d9d to
2838304
Compare
This PR fix the ZeroDivisionError when gdp.hull reformulation is applied in the Kaibel instance.
File:
gdplib/kaibel/kaibel_solve_gdp.py