-
Notifications
You must be signed in to change notification settings - Fork 84
add crystallizer flowsheet #1482
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
base: main
Are you sure you want to change the base?
Conversation
| from idaes.core import UnitModelCostingBlock | ||
|
|
||
| from watertap.property_models.unit_specific import cryst_prop_pack as props | ||
| from watertap.unit_models.Crystallizer_revised import Crystallization |
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 am interested to see how the revised form differs from the original. For one, I would prefer to have the revised version condensed within the original, accessible through config options, assuming there is considerable overlap in code. Waiting to see this unit model file to determine that.
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 suppose you can get rid of Crystallizer_revised and just use the revised original now, right?
adam-a-a
left a comment
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.
Here are some initial comments from a first pass
|
|
||
| costing = blk.parent_block() | ||
| costing.register_flow_type("steam", blk.steam_cost) | ||
| #costing.register_flow_type("steam", blk.steam_cost) |
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.
delete commented code
| blk.costing_package.cost_flow( | ||
| pyo.units.convert( | ||
| ( | ||
| blk.unit_model.magma_circulation_flow_vol | ||
| * blk.unit_model.dens_mass_slurry | ||
| * Constants.acceleration_gravity | ||
| * blk.costing_package.crystallizer.pump_head_height | ||
| / blk.costing_package.crystallizer.efficiency_pump | ||
| ), | ||
| to_units=pyo.units.kW, | ||
| ), | ||
| "electricity", | ||
| ) | ||
|
|
||
| blk.costing_package.cost_flow( | ||
| pyo.units.convert( | ||
| (blk.unit_model.work_mechanical[0] / _compute_steam_properties(blk)), | ||
| to_units=pyo.units.m**3 / pyo.units.s, | ||
| ), | ||
| "steam", | ||
| ) |
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.
Curious about why these lines are being deleted. I probably didn't look closely enough, but have they been moved elsewhere or completely removed? And why?
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.
@adam-a-a They are removed as we integrate the steam heater, pump, and other essential components into the full FC crystallizer flowsheet. Therefore, the flow rates of the steam and recycle streams, along with their associated costs, are incorporated within the cost calculations of the steam heater and pump unit models.
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.
@ElmiraShamlou but removing this hinders whoever wants to use the combined unit we had previously.
Maybe what we need is a configuration argument that determines the mode the user wants (broken down or combined), and then adds the necessary equations for each case?
| _cost_crystallizer_flows(blk) | ||
|
|
||
|
|
||
| def _compute_steam_properties(blk): |
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 question here, except it makes more sense immediately as to why we wouldn't want/need this in a costing module
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.
this should really be part of the property package
| m.fs.distillate = Product(property_package= m.fs.properties_vapor) | ||
|
|
||
|
|
||
| # unit models: steam heater, mixer, pump, crystalizer, compressor, separator |
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.
| # unit models: steam heater, mixer, pump, crystalizer, compressor, separator | |
| # unit models: steam heater, mixer, pump, crystallizer, compressor, separator |
| ) | ||
|
|
||
| """ | ||
| self.work_mechanical = Var( |
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'm surprised to see no tests fail for the crystallizer unit especially since no changes were made to the test file.
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.
The tests are failing, and I'm revising them to align with the recent changes.
|
|
||
| optimize_set_up(m) | ||
|
|
||
| #interval_initializer(m) |
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 am guessing that an InfeasibleConstraint exception (or something like that) arises when using the interval initializer.
| @@ -0,0 +1,508 @@ | |||
| ################################################################################# | |||
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.
Next step is to add (1) a test file for this flowsheet and (2) documentation for this flowsheet in this section: https://watertap.readthedocs.io/en/latest/technical_reference/flowsheets/index.html
| @@ -0,0 +1,444 @@ | |||
| ################################################################################# | |||
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.
Next step is to add (1) a test file for this flowsheet and (2) documentation for this flowsheet in this section: https://watertap.readthedocs.io/en/latest/technical_reference/flowsheets/index.html
| #from watertap.core.util.model_debug_mode import activate | ||
| #activate() |
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.
delete
|
This is waiting on NAWI funds for work to continue. |
|
@ElmiraShamlou and this one too? |
…cryst_flowsheet
…tertap into pr/ElmiraShamlou/1482
|
I made these changes initially because the flowsheet wasn't working and I have a student that wants to use it. But also my changes match our conventions. I reverted @adam-a-a 's modifications for steam costing where In making these changes, I discovered that we have two models that use a steam cost with different units: Crystallizer tests are failing but that was the case prior to my changes. |
@kurbansitterley my main question here is what will currently happen when more than one unit on the flowsheet has its own |
My understanding is that |
|
@ElmiraShamlou added tests for the new flowsheets; only testing |
add three crystallizer flowsheets
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: