-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update documentation of kaibel model #27
Conversation
Please sort the conflict with the merged PRs from @ZedongPeng before we revise this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. There are some lingering TODO and TOCHECK notes that should be addressed or rewritten.
The most important one is regarding an updated logical expression system in Pyomo. If the model does not run with the current version of Pyomo, we need to update it in this PR.
Finally, put all the units between square brackets
@@ -1,103 +1,204 @@ | |||
""" Side feed flash """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more documentation to this and the rest of the files at the header level? Check the other models for reference
|
||
@msf.Constraint(msf.nc, | ||
doc="Vapor-liquid equilibrium constant") | ||
# TODO: Is it computed using the Peng-Robinson equation of state? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this classifies as a TODO (as there is no action to be taken). I would add it as a Note. Moreover, I would encourage you to contact Soraya asking for these and other questions you might have
msf.OBJ = Objective( | ||
expr=1, | ||
sense=minimize) | ||
# TODO: Is it computed using the Peng-Robinson equation of state? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above
gdplib/kaibel/kaibel_solve_gdp.py
Outdated
m.Tbot = m.TB0 # Bottom-most tray temperature in K | ||
m.Ttop = m.TD0 # Top-most tray temperature in K | ||
m.Tcon = m.TD0 - 5 # Condenser temperature in K | ||
m.Treb = m.TB0 + 5 # Reboiler temperature in K |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of "in UNITS" let's use "[UNITS]" to standardize with other models
gdplib/kaibel/kaibel_solve_gdp.py
Outdated
|
||
m.flow_max = 1e3 # Flowrates upper bound in mol/s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See units comment above
gdplib/kaibel/kaibel_solve_gdp.py
Outdated
for comp in m.comp: | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a link or reference to the method to the header of the file?
gdplib/kaibel/kaibel_solve_gdp.py
Outdated
>= m.min_num_trays | ||
) | ||
|
||
# TOCHECK: pyomo.GDP Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For whom is this TOCHECK note?
gdplib/kaibel/kaibel_solve_gdp.py
Outdated
else: | ||
return Constraint.NoConstraint | ||
|
||
# TOCHECK: Update the logic proposition constraint for the main section with the new pyomo.gdp syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the code run with the current version of Pyomo? If it doesn't then this update needs to be made in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Units should be added in many missing places and between [].
The most important comment is: does this run with the last version of Pyomo without warnings from the logical expression system?
mn.cols, | ||
mn.sec, | ||
mn.nc1, | ||
doc='Temperature term for vapor pressure', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing units here and in many other places
|
||
from gdplib.kaibel.kaibel_side_flash import calc_side_feed_flash | ||
|
||
# from .kaibel_side_flash import calc_side_feed_flash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment
m.P = Var( | ||
m.section, | ||
m.tray, | ||
doc="Pressure at each potential tray in bars", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to [units]
m.section, | ||
m.tray, | ||
m.comp, | ||
doc="Liquid composition", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing units [mol/mol], similar below
@disj.Constraint(m.comp, doc="Top section 4 vapor enthalpy") | ||
def top_vapor_enthalpy(disj, comp): | ||
""" | ||
Vapor enthalpy for the top section in the column. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing units here and in many other functions
m = build_model() | ||
|
||
# Fixing variables | ||
m.F[1].fix(50) # feed flowrate in mol/s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
units in []
Does #47 supersede this? SHould we merge this beforehand? |
This pull request contains changes to the documentation of the ´kaibel_prop.py´ file.