Standardize Feedstock Outputs (follow-on to 463)#523
Standardize Feedstock Outputs (follow-on to 463)#523elenya-grant wants to merge 19 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?
| 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?
| # Calculate performance based on consumption | ||
|
|
There was a problem hiding this comment.
Suggest removing comment as it isn't necessarily helpful
Standardize Feedstock Outputs (follow-on to 463)
Updated feedstock component to have standard outputs (like those output from the
PerformanceModelBaseClass) and use new naming convention forcommodityand thecommodity_rate_units. Feedstock model now outputscapacity_factor,annual_commodity_consumed, andtotal_commodity_consumed.This PR also allows for the rated capacity of feedstocks and the feedstock price to be swept variables (added these as inputs).
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:
FeedstockCostModelandFeedstockPerformanceModelare not part of the same sub-system (they don't have shared inputs/outputs - they're connected using connections, not promoted inputs/outputs), should we haverated_commodity_productionas an output of theFeedstockCostModel(calculated as the max ofcommodity_outfrom theFeedstockPerformanceModeland rename the inputrated_commodity_productionof theFeedstockPerformanceModelto berated_capacityor something? This means that all the "standard outputs" would be coming from the feedstock cost model (this is because feedstocks are uniquely handled). How I have it right now, values from the feedstock would be accessed like below:But the alternative approach above would allow for:
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
Resolves part of Issue #485 about updates feedstock to have standardized performance
Made issue #522 to address incorrect units used in natural gas model. This PR would resolve that issue.
Section 4: Impacted Areas of the Software
Section 4.1: New Files
path/to/file.extensionmethod1: What and why something was changed in one sentence or less.Section 4.2: Modified Files
h2integrate/core/feedstocks.py: all models updated to usecommodity andcommodity_rate_unitsinstead offeedstock_typeandunits`.FeedstockPerformanceConfig: rename attribute namesFeedstockPerformanceModel: addedrated_commodity_productionas an inputFeedstockCostConfig: rename attribute names, added optional attribute ofcommodity_amount_unitsFeedstockCostModel:price, so the price can be varied in a sweepcommodity_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 modelexamples/23_solar_wind_ng_demand/tech_config.yaml: updated key names for feedstock shared parametersexamples/23_solar_wind_ng_demand/plant_config.yaml: removed site boundaries and year from 'site' - this example is untested by the way!examples/23_solar_wind_ng_demand/flexible_demand_tech_config.yaml: updated key names for feedstock shared parametersexamples/16_natural_gas/tech_config.yaml: updated key names for feedstock shared parametersexamples/21_iron_mn_to_il/tech_config.yaml: updated key names for feedstock shared parametersAlso updated some files so that natural gas units are in MMBtu/h instead of MMBtu (see Issue #522)
Section 5: Additional Supporting Information
Section 6: Test Results, if applicable
N/A