Skip to content
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

Extended BSM2 Flowsheet Costing #1405

Merged
merged 6 commits into from
May 24, 2024

Conversation

MarcusHolly
Copy link
Contributor

Changes proposed in this PR:

  • Adds costing to the BSM2_P_Extension flowsheet
  • Updates the GUI to include costing outputs

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@MarcusHolly MarcusHolly self-assigned this May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 99.15966% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.03%. Comparing base (e44c9fe) to head (bee9985).
Report is 56 commits behind head on main.

Files Patch % Lines
...dies/full_water_resource_recovery_facility/BSM2.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1405      +/-   ##
==========================================
+ Coverage   94.02%   94.03%   +0.01%     
==========================================
  Files         335      335              
  Lines       35620    35727     +107     
==========================================
+ Hits        33491    33597     +106     
- Misses       2129     2130       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcusHolly MarcusHolly marked this pull request as ready for review May 23, 2024 13:12
Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good- just a couple of comments to consider

@@ -658,6 +678,184 @@ def solve(m, solver=None):
return results


def add_costing(m):
m.fs.costing = WaterTAPCosting()
m.fs.costing.base_currency = pyo.units.USD_2020
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what we use on the conventional BSM2? I think we should avoid 2020 as the base currency because of the pandemic's impact.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conventional also used 2020... should I switch both to 2018 or 2019?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I'm not sure that we've selected a standard year that we want to go by. I think I can recall using 2018 for a few of the IEDO models previously. I suppose we can put a pin it this for now if we'd rather settle on a year.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But perhaps the best route is to go with the latest year that we have the CEPCI index for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest year in IDAES is 2022, but it appears that hasn't made it's way into WaterTAP yet. I tried 2021 as well, but the solver failed to return an optimal solution... not sure why that would happen.


# process costing and add system level metrics
m.fs.costing.cost_process()
m.fs.costing.add_electricity_intensity(m.fs.FeedWater.properties[0].flow_vol)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add electricity intensity and specific energy consumption? They should be the same so you can probably remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was pretty much a copy+paste from the conventional BSM2 costing. I'll remove electricity intensity from both.

pyo.value(m.fs.AD.electricity_consumption[0]),
pyo.units.get_units(m.fs.AD.electricity_consumption[0]),
)
print(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a chunk of these printouts aren't technically under the "costing" category. Maybe you can consider moving those under a separate display function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll address your comments for the conventional and extended BSM2 flowsheets

@MarcusHolly MarcusHolly added the Priority:Normal Normal Priority Issue or PR label May 23, 2024
Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - do we skip the mac test on conventional BSM2 as well? Just want to take note of this

Copy link
Contributor

@agarciadiego agarciadiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarcusHolly
Copy link
Contributor Author

LGTM - do we skip the mac test on conventional BSM2 as well? Just want to take note of this

Yes, we also skip mac tests for conventional BSM2.

@adam-a-a adam-a-a merged commit 21c209b into watertap-org:main May 24, 2024
26 checks passed
@bknueven bknueven mentioned this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants