MCAS in SWRO Flowsheet - #1849
Conversation
|
@sufikaur @ksbeattie this is the other PR that could potentially make it into the patch release |
…lize and solve with mcas only!
…g and pelton turbine ERD costing; cleanup translator code (remove)
|
@sufikaur This followup PR that I was hoping to get into the patch release is actually ready! I was able to resolve the issues. There may be a couple of trivial test failures to resolve on my end (checking now). My hope is that we can still squeeze this in once we get two reviews. |
| # RO unit | ||
| desal.RO.A_comp.fix(4.2e-12) # membrane water permeability coefficient [m/s-Pa] | ||
| desal.RO.B_comp.fix(3.5e-8) # membrane salt permeability coefficient [m/s] | ||
| desal.RO.B_comp[0, "tss"].fix(1e-10) # membrane salt permeability coefficient [m/s] |
There was a problem hiding this comment.
Nice, so we can do this even without having to provide charge.
| @@ -353,17 +318,50 @@ | |||
| temperature = 298 * pyunits.K | |||
There was a problem hiding this comment.
This is a minor comment. but we should probably put this into to fix_operation_function. Not critical.
| m.fs.feed.properties[0].conc_mass_phase_comp["Liq", "tss"], | ||
| value(10 / conc_mass_tss), | ||
| ) | ||
|
|
There was a problem hiding this comment.
I almost think, if you make this into fix_feed_conditions function, it will make a clear example of how to set feed state using concentrations and flow volume.
| }, | ||
| hold_state=True, | ||
| ) | ||
| m.fs.properties.set_default_scaling( |
There was a problem hiding this comment.
I would also put all scaling stpes into a separate function.
this we can call build, fix, scale, initalize etc.
| # initialize pretreatment | ||
| propagate_state(m.fs.s_feed) | ||
| flags = fix_state_vars(prtrt.intake.properties) | ||
| solve(prtrt, checkpoint="solve flowsheet after initializing pre-treatment") |
There was a problem hiding this comment.
not sure why we are using prtrt/psttrt they are realy confusing and do not make it easier to read the code. I suggest we just use explicity m.fs.pretreatment etc.
| @@ -601,8 +601,8 @@ | |||
| m.fs.costing.base_currency = pyunits.USD_2023 | |||
There was a problem hiding this comment.
This will not wor kcorrectly. The costing is already built and using default costing units loaded at build_global_params call, which happens at costing build. That means the vars are using different base_currency here then you would expect. - e.g. any vars build at global will use base currency (I think USD_2019) and any vars down stream will use 2023. This is an issue, as it means you might be down converting some of the costs rather then up based on CPI index.
There was a problem hiding this comment.
Ideally, we should define base cost at our desired year, and any unit costs/capex/etc have cost defined at specific year (USD_2020 or something - in many cases they just use base_currency which is what ever is the base_currecny var in the costing package. I am not sure how that impacts all equations but its inconsistent, for example your electricity price will use USD_2018 (set here, which is called here and build_global_params is called at build by base flowshetCostingblock here which means all vars called after here use USD_2018, and only anything built after build_global_parms will end up using USD_2023. which means base all aggreaget costs etc on USD_2018, build units with csoitng of USD_2023 unless they specify otherwise, and cost eelctricty on USD_2018!
yay....
There was a problem hiding this comment.
Unless I can't read code... and then I am wrong and should pursue my wifes dream of running a Cat farm somewhere...
avdudchenko
left a comment
There was a problem hiding this comment.
Overall nice. but be aware of bugged up base_currency usage here. (just make sure the tests pass. Most of my comments are related to clearer organization of some code but its very optional)
Fixes/Resolves:
(replace this with the issue # fixed or resolved, if no issue exists then a brief statement of what this PR does)
Summary/Motivation:
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: