-
Notifications
You must be signed in to change notification settings - Fork 62
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
OARO flowsheet #829
OARO flowsheet #829
Conversation
Codecov Report
@@ Coverage Diff @@
## main #829 +/- ##
==========================================
- Coverage 95.47% 95.42% -0.05%
==========================================
Files 258 259 +1
Lines 24876 25094 +218
==========================================
+ Hits 23750 23947 +197
- Misses 1126 1147 +21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 guess for optimization we need an OARO costing method? Might be best to leave it for after #835 is merged.
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.
Looks good. Let's add costing and optimization later.
# initial guess for states of pump 3 output (temperature and concentrations) | ||
m.fs.P3.control_volume.properties_out[0].temperature.value = feed_temperature | ||
permeate_flow_mass = 0.75 | ||
permeate_mass_frac_NaCl = 0.015 | ||
permeate_mass_frac_H2O = 1 - permeate_mass_frac_NaCl | ||
m.fs.P3.control_volume.properties_out[0].flow_mass_phase_comp[ | ||
"Liq", "H2O" | ||
].value = (permeate_flow_mass * permeate_mass_frac_H2O) | ||
m.fs.P3.control_volume.properties_out[0].flow_mass_phase_comp[ | ||
"Liq", "NaCl" | ||
].value = (permeate_flow_mass * permeate_mass_frac_NaCl) |
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.
Much better than my hand-tuned values!
Yeah, right now, we don't have costing method for OARO model, so we might add it later. |
# Control volume flow blocks | ||
m.fs.feed = Feed(property_package=m.fs.properties) | ||
m.fs.product = Product(property_package=m.fs.properties) | ||
m.fs.product2 = Product(property_package=m.fs.properties) |
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 product2 can be deleted now. I originally added this when we were playing around with constructing the flowsheet one unit at a time.
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.
Deleted
pressure_atmospheric = 101325 | ||
feed_pressure = pressure_atmospheric |
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.
Seems like only one of these should be here?
from watertap.unit_models.pressure_changer import Pump, EnergyRecoveryDevice | ||
from watertap.core.util.initialization import assert_degrees_of_freedom | ||
from watertap.costing import WaterTAPCosting | ||
|
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.
Seems like some of these imports are unused and can be deleted (SequentialDecomposition, MomentumMixingType, etc.)
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.
Yeah, I cleaned up redundant imports
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.
LGTM - just made a few comments about cleaning up the code.
* Add gui * delete redundant GLSD UI code * Draft PR for OARO flowsheet * troubleshoot OARO flowsheet * DOF = 0 resolved; solving flowsheet unsuccessful; issue related to OARO or pump/ERDs * troubleshooting flowsheet * modify test file * half flowsheet * Revise code * Revise OARO model * Add test * Revise OARO * testing main for coverage Co-authored-by: adam-a-a <aatia@keylogic.com> Co-authored-by: Bernard Knueven <Bernard.Knueven@nrel.gov>
* save work * save unfinished work- nonohmic, diffusion layer in places * save work * save work, initial solvable version! * save work * membrane diffusion and water osmosis under polarizaiontion refined * save work, all working property * first finalized ed1d refinement with tests * typo correction * improve fs opt * test opt bound * rename i_lim configvalue * typo fix and rename set * all pressure drop dimensionless quantity and friction methods added * fix impacts on existing ed fs * fix doc building bug * test opt in win * test opt numps solver * save work, add pressure changes in 1d-cv * save work, modify init routine * added and tested cv1d deltaP, addressed comments * add a configerror test * fixed a missing sf to improve solving for mumps * change a var name * added two additional i_lim methods * improved model structure and scaling * Add CITATION file for GitHub * Fix date released * Add text to use for reference * Use entity name for WaterTAP authors * Isothermal 0DRO (#846) * changing 0DRO to be isothermal like 1DRO * updating tests * updating OARO * updating RO default configuration yaml * update seawater RO baselines * update dye desal baselines * update NF bypass twostage baseline * update dye desal baselines; again * OARO Modeling & Initialization (#841) * setting constraint scaling transform for small membrane channel constraints * adjusting RO initialization * restoring custom interface initialization * fixing bug in new initializer * updating test_Pdrop_calculated * fixing cp modulus guess * updating testing baseline * tweaking initialization * move dens_solvent scaling to base class * fixing bug with MC initialization * Revert "tweaking initialization" This reverts commit e015406. * updating baselines, again * removing enthalpy from OARO * removing unneeded import * undoing membrane channel constraint scaling * replacing explicit calls to properties_in/properties_out with 1D versions * Seawater Ion Generic Documentation (#808) * Test that each ZO model has a ZO doc * Adds files that were missed in original commit * Incorporates Ludovico's suggestions * Minor changes to address comments * Excel updatted properly now * Constructed wetlands rst update * revert changes made in last commit * Revert "revert changes made in last commit" This reverts commit 91711ed. * hardcoding list place * Preliminary documentation for seawater_ion_generic * Cl_1- changed to Cl\_- * Gets rid of extra properties table * Update index * Scaling description revised * Update prop pack description * Adds additional properties * Fixes syntax error * Fixes another syntax error * Updates introduction to further explain the connection with IDAES * Updates introduction to further explain the connection with IDAES Co-authored-by: Bernard Knueven <Bernard.Knueven@nrel.gov> Co-authored-by: Keith Beattie <ksbeattie@lbl.gov> * OARO flowsheet (#829) * Add gui * delete redundant GLSD UI code * Draft PR for OARO flowsheet * troubleshoot OARO flowsheet * DOF = 0 resolved; solving flowsheet unsuccessful; issue related to OARO or pump/ERDs * troubleshooting flowsheet * modify test file * half flowsheet * Revise code * Revise OARO model * Add test * Revise OARO * testing main for coverage Co-authored-by: adam-a-a <aatia@keylogic.com> Co-authored-by: Bernard Knueven <Bernard.Knueven@nrel.gov> * fixing getting started links (#852) This addresses #844 by changing them from "latest" to "stable". I also when doing this changed our ReadTheDocs config so that the default is to point to "stable" (which will be the most recent tagged release) rather than "latest" (which is whatever is on the main branch at the time). * Remove idaes solver directives (#836) * removing solver requirement from zero order models * removing in units and full_treatment_train * Differential Parameter Sweep Sampling (#806) * Property Package Constraint Indexing & Utility Function Update (#837) * Update constraint indexing in water prop pack * Initial seawater prop pack changes * Change utility function of seawater prop pack * Updates indexing and utility functions for prop packs * Addresses issues with parameters in the utility function * Makes utility function for transforming property constraints * Update watertap/core/util/scaling.py Co-authored-by: bknueven <30801372+bknueven@users.noreply.github.com> * Update scaling.py * fixing import * rebase main, resolve conflicts * resolve conflicts * Reorganzing the WaterTAP Costing Package (#835) * adding working proof-of-concept * using attribute * better error handling * better example * hard coding year * separating remaining units * costing flows on costing package * adding init to new dir * fixing simple erros * cleaning up imports * fixing flowsheets * a few more imports * setting up to move flows in with units * fixing import * moving non-electricity flow definition * fixing bug in cost_reverse_osmosis * fixing costing module tests * fixing electrodialysis 0D tests * fixing bug in dye_desalination_ui * cleanup * testing _DefinedFlowsDict * adding test for register_costing_parameter_block * ensuring unit-level costs are convert to base currency * doing conversions correctly * removing base_currency update * fixing units in ion_exchange * updating ion exchange baselines * updating UV AOP baselines * fixing merge conflict mistake * modify var bound in optmizaiton * modify var bound in optmizaiton * modify upper bounds of some vars * remove upper bounds and format * Empty commit to trigger CI
Fixes/Resolves:
Summary/Motivation:
Implement OARO flowsheet
Thank @bknueven for providing valueble help for initialization routine for this flowsheet
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: