Standardize Feedstock Outputs (follow-on to 463)#523
Standardize Feedstock Outputs (follow-on to 463)#523elenya-grant wants to merge 27 commits intoNatLabRockies:developfrom
Conversation
…_out between performance and cost model
…T into feedstock_updates
h2integrate/core/feedstocks.py
Outdated
| self.commodity_rate_units = self.config.commodity_rate_units | ||
|
|
||
| self.add_output(f"{feedstock_type}_out", shape=n_timesteps, units=self.config.units) | ||
| # NOTE: should below be renamed to f"{self.commodity}_capacity"? |
There was a problem hiding this comment.
I'd support that change, it seems more clear
Stick with consumed imo. That's more clear given how we're handling feedstock quantities. |
johnjasa
left a comment
There was a problem hiding this comment.
Thanks for this, Elenya! I like the thought you put into the feedstocks setup and how it could be more standard to match other components. I also appreciate you fixing the NG units to be consistently correct.
My blocking request is for you to update feedstocks.md as well. Could you please change that doc so it matches what you've done here, then also add a few words to explain the CF calculation and anything else you introduce here?
h2integrate/core/feedstocks.py
Outdated
| f"total_{self.commodity}_consumed" | ||
| ] * (1 / self.fraction_of_year_simulated) | ||
|
|
||
| outputs[f"rated_{self.commodity}_production"] = inputs[f"{self.commodity}_out"].max() |
There was a problem hiding this comment.
I know I brought this up on a call, but I forget where we landed. Will this assumption (that the rated production is the max of the commodity stream) be limiting in any way? Would this go against users' intuition at some point?
There was a problem hiding this comment.
I don't think so - the inputs[f"commodity_out"] is the output from the performance model, which outputs the commodity_out as an array of all the same values. Aka - the max should equal the mean which should equal the "commodity_capacity" input to the performance model.
h2integrate/core/feedstocks.py
Outdated
| # Calculate performance based on consumption | ||
|
|
There was a problem hiding this comment.
Suggest removing comment as it isn't necessarily helpful
…T into feedstock_updates
Standardize Feedstock Outputs (follow-on to 463)
Updated feedstock component to have standard outputs (like those output from the
PerformanceModelBaseClass). Feedstock model now outputscapacity_factor,annual_commodity_consumed, andtotal_commodity_consumed. Note that these are output from the FeedstockCostModel, which is due to the special handling of feedstock components.This PR was re-opened because it seemed relevant for PR #605 so that non-electricity commodities could also be used with the updated dispatch method that is introduced in PR #605.
This PR is ready for high-level feedback, the questions for reviewers are noted in Section 2!
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.mdhas been updated to describe the changes made in this PRSection 3: Related Issues
Made Issue #659 when creating this PR, this issue is not resolved by this PR
Resolves part of Issue #485 about updates feedstock to have standardized performance
Section 4: Impacted Areas of the Software
Section 4.1: New Files
None
Section 4.2: Modified Files
h2integrate/core/feedstocks.py:FeedstockCostModel:commodity_out, which is used as the denominator in the capacity factor calculationcapacity_factor,annual_commodity_consumed, andtotal_commodity_consumedexamples/test/test_all_examples.py::test_natural_gas_exampleadded subtest for feedstock capacity factorh2integrate/core/test/test_feedstocks.py: added new testtest_feedstock_standard_outputsh2integrate/core/h2integrate_model.pyH2IntegrateModel.connect_technologies(): added connection to connectcommodity_outoutput of the feedstock performance model to the inputcommodity_outof the feedstock cost model (this was needed because theFeedstockCostModelandFeedstockPerformanceModelare not part of the same sub-system (they don't have shared inputs/outputs - they're connected using connections, not promoted inputs/outputs))examples/16_natural_gas/tech_config.yaml: added some comments for natural gas feedstockh2integrate/tools/profast_tools.py:make_price_breakdown(): updated so it can handle cases with a zero total capex.examples/12_ammonia_synloop/tech_config.yaml: updatedn2_feedstockprice to be $5.0/t (instead of 0) or to prevent errors when trying to run profast with zero costsplant_config.yaml: addedn2finance subgroup for integration testing purposes. Removedn2_feedstockfrom thenh3technology group so that LCOA doesn't change in tests (before the n2_feedstock had zero cost, but the update to the n2_feedstock price would give a larger LCOA if included). Could instead update the test value if desired.pytest examples/test/test_all_examples.py::test_ammonia_synloop_example: added subtest for LCONSection 5: Additional Supporting Information
Section 6: Test Results, if applicable
N/A