-
Notifications
You must be signed in to change notification settings - Fork 84
Add WaterTAP Flowsheet block for simpler flowsheet assembly. #1685
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?
Add WaterTAP Flowsheet block for simpler flowsheet assembly. #1685
Conversation
| def build(self): | ||
| super().build() | ||
| self.feed = Feed(property_package=self.config.default_property_package) | ||
| self.solute_type = list(self.config.default_property_package.solute_set)[0] |
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.
Do you have examples of this for other property 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.
This should work for nay property model, the implementation here assume a single solute, but can be extended to work with MCAS as well. (I know it works with Seawater, NaCl and MCAS prop pacakges at least..).
| class WaterTapFlowsheetBlockData(FlowsheetBlockData): | ||
| CONFIG = FlowsheetBlockData.CONFIG() | ||
| CONFIG.declare( | ||
| "default_costing_package", |
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 you adopted this prepending of default_ nomenclature from FlowsheetBlock config, do you know why they do this? It is strange. Like, why not just costing_package or property_package. There could be still be defaults.
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 based on idaes flowsheet block. The idea is that you can have more then one property block and maybe even costing blocks on a flowsheet model.
Example is using RO with MCAS, the default property package is "MCAS" and ro_property_pacakges is NaCl prop pack or SeawaterPropPack, etc. Its just very explicit in the supplied prop pack is "default" acting prop pack that this flowsheet unit can work with.
|
I would be interested in seeing other more complex unit implementations if that is somewhere |
@kurbansitterley If you read the PR text, I link directly to reaktoro enabled flowsheet examples that use this stucture...(You should also have access to hpro_analysis repo which is private if anyone else try to acces (ping me on slack and I can invite you)). |
| def set_fixed_operation(self, **kwargs): | ||
| """Developer should implement a routine to fix unit operation for initialization and 0DOF solving""" | ||
|
|
||
| def set_optimization_operation(self, **kwargs): | ||
| """Developer should implement a routine to unfix variables for unit to perform optimization""" | ||
|
|
||
| def scale_before_initialization(self, **kwargs): | ||
| """Developer should implement scaling function to scale unit using | ||
| default values before initialization routine is ran""" | ||
|
|
||
| def scale_post_initialization(self, **kwargs): | ||
| """Developer should implement scaling function to scale unit after initialization routine is ran""" | ||
|
|
||
| def register_port(self, name, port=None, var_list=None): |
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.
Should we enforce that any of these be developed if subclassing from this? If so, which ones should be deemed "required"? The reason to do so would really be to help the user to make sure to implement methods that provide the most value and make life easier.
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.
ANd this question goes for any of the methods that are placeholders right now
Summary/Motivation:
Currently, we spend alot of time building custom flowsheets that require full re-parametrization of each unit model. This makes the units non-portable, and results in duplicate code. We also use low-level API for building flowsheets, where all units have to be manually connected via arcs, and propagated. This can make sense in a few scenarios (Where a flowsheet has a very complex connection structure), but in most cases, the connections and their flow is mostly linear (even in complex processes like LSRRO).
The WaterTAPFlowsheetBlock brings a layer of abstraction for units with focus on providing a standard building platform for flowsheets where unit models become portable between flowsheets, and where time spent on configuring each unit model is minimized. It defines standard functions necessary to fully define a unit model from fixed operation variables to scaling factors, and additionally provides a method for standard connection management. A full example of benefits/implementation can be found in this branch and flowsheet
An example workflow with unit models build on watertapflowsheet block may look as follows:
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: