BioSTEAMDevelopmentGroup / Bioindustrial-Park

BioSTEAM's Premier Repository for Biorefinery Models and Results
MIT License
37 stars 18 forks source link

Crazy MESP for oilcane biorefinery config S1/O1/S2/O2 #51

Closed yalinli2 closed 1 year ago

yalinli2 commented 1 year ago

Hi @yoelcortes , I'm getting really bad MESP numbers now:

>>> from biorefineries import oilcane as oc
>>> oc.load('S1')
>>> oc.sys.TEA.solve_price(oc.ethanol)
554.2055437462008

Haven't checked other configurations though. BTW, if there will be major changes to the oilcane biorefinery, maybe better to open new branch? I can help to review before merging since I've been tracking MESPs/GWPs, thanks!

yalinli2 commented 1 year ago

OK just checked, S1/O1/S2/O2 are all bad...

yoelcortes commented 1 year ago

@yalinli2, thanks for checking this. The problem was that when I made the tests, I added this line in __init__.py:

feedstock.price = MFPP()

But the MFPP was in USD per ton (should be USD per kg). It is fixed now. I can work on a new branch and have you review before merging from now on (good idea!).

Regarding MESPs, the ethanol stream is not a product in S2 and O2. You'll need to pass both advanced and cellulosic ethanol streams to solve for the MESP:

>>> from biorefineries import oilcane as oc
>>> oc.load('O2')
>>> oc.tea.solve_price([oc.advanced_ethanol, oc.cellulosic_ethanol])
0.9225516982836797

Because the feedstock price changes with biorefinery for consistency among tests, you'll want to make sure you set the price you want before getting the MESP.

Thanks!

yalinli2 commented 1 year ago

OK thanks @yoelcortes , it's quite strange that the tests didn't even catch such weird results...

I kind of noticed that ethanol wasn't in the system but didn't think it'd matter since it's been giving reasonable looking results, but I just checked and found there were different, I'll update the calculation, thanks for the note!

Also, I reopened this issue because I noticed that the MESP for S1/O1 configs (esp. O1) have changed substantially (esp. for O1, increased from $1.53/gal to $2.17/gal) between ~you submitted the oilcane revision to now, I'll double-check on this and follow up

And I think I generally close an issue in a timely manner if I believe it's resolved, so I'd appreciate it if you can leave it to me (or other people who post the issue) next time. If the issue's like a week old and no one follows up then sure the person might've forgot about it, but sometimes people will need time to verify, thanks!

yoelcortes commented 1 year ago

@yalinli2, absolutely, thanks for letting me know. Keeping issues open to give enough time for verification is good idea.

Regarding the MESP being different, you can try setting the price of the feedstock back to the original price:

>>> from biorefineries import oilcane as oc
>>> oc.load('O1')
>>> oc.feedstock.price = 0.035
>>> ethanol_kg_per_gal = 2.98668849
>>> oc.tea.solve_price(oc.advanced_ethanol) * ethanol_kg_per_gal
1.6230408644406924

When I made the new tests for oilcane configurations, I forgot the feedstock price was in USD/kg (not USD/ton) so the values looked good to me at the moment jaja. Thanks for catching this error and posting it!

yalinli2 commented 1 year ago

@yoelcortes , thanks so much for the info! It's counter-intuitive to me that we'd want to set the feedstock price based on a decade-old MESP, but at the same time I also don't think setting the same feedstock price for oilcane/sugarcane is fair :)

I updated the codes in the wwt module (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/commit/a7638666a3754037567795a946a33d73c786981e) and now the results look good, I'll close this issue!