Updates related to demand_tech in SLC framework#784
Conversation
…d only connect upstream techs to the controller
genevievestarke
left a comment
There was a problem hiding this comment.
I really like this functionality, thank you @elenya-grant !! I think it's much clearer what's happening in the code.
I don't have a problem with called the input demand_component since it needs to be a demand module to use system level control.
I don't think that we should throw an error for having upstream demand components in the system as long as it doesn't change the behavior of the system level control. I'm still working through why you would want a second demand component (so you can see how much of a steady-state demand you've met, maybe?).
It looks good to me!
jaredthomas68
left a comment
There was a problem hiding this comment.
This looks fine to me, but I am concerned we are running in to the difficulties to start with because our SLC is not as extensible as it should be. This PR helps, but I think we may want to have some more discussions around how to make the SLC as extensible and modular as the rest of H2I.
| slc_config["tech_to_commodity"] = tech_to_commodity | ||
| slc_config["storage_techs_to_control"] = storage_tech_to_control | ||
| slc_config["technology_graph"] = self.technology_graph | ||
| slc_config["technology_graph"] = tech_graph |
There was a problem hiding this comment.
If you need to create tech_graph for line length purposes, can we keep the assignment close by so there is no concern about tech_graph in the local scope diverging from the the class attribute self.technology_graph? I'm also concerned about them diverging with the use of the new create_technology_graph method.
There was a problem hiding this comment.
talked to Jared - call tech_graph like upstream_tech_graph or local_tech_graph to make it clear that its not the entire technology graph. maybe consider renaming slc_config["technology_graph"] to slc_config["slc_technology_graph"].
There was a problem hiding this comment.
I changed the name from tech_graph to upstream_tech_graph
There was a problem hiding this comment.
Feeling good about this from a high-level, seems like this is making the SLC more explicit and allowing for the use of multiple demand components.
Feeling good about demand_component, I'm not married to it because I could imagine SLC at some point not requiring demand as an input.
Agreed with @genevievestarke let's not throw an error, it makes it more flexible for folks.
…iling to be more useful
|
There's enough overlap and potential confusion between |
johnjasa
left a comment
There was a problem hiding this comment.
Thanks for this improvement! I've pushed some changes directly to the branch, primarily the renaming of slc_config to slc_topology for clarity. This is ready to come in, imo. I know that SLC is a continual work in progress and this is a nice step forward!
Pull request was converted to draft
Updates related to
demand_techin SLC frameworkREADY FOR REVIEW OF ALL TYPES
This PR aims to resolve two issues related to SLC:
control_parameters#739In this draft implementation, I've required that the user specify the demand technology in the
system_level_controlsection of the plant configuration file. This looks like below:Background and Questions for reviewers on the above implementation:
An alternative approach would be have the
demand_componentdefined under thecontrol_parameterssection. The reason I did not do that approach is to be consistent with the current organization, usage, and distinction betweenslc_configandcontrol_parameters. The SLC gets two "configuration" dictionaries,slc_configandcontrol_parameters.slc_configis created inH2IntegrateModel._classify_slc_technologies(). Theslc_configcontains information that is used by both H2IntegrateModel and the SLC for set-up and connection logic. The parameters within thecontrol_parametersdictionary are controller-specific parameters that is only accessed within the SLC (not used by H2IntegrateModel). This is my justification for the route I went, but I'd be curious to hear opinions on the alternative approach if a reviewer finds it appealing.This simplifies some of the logic in
H2IntegrateModel_classify_slc_technologies(). I've also updated it so that only technologies that are upstream and connected to the demand technology are included in the information contained in theslc_config.Additional Questions for reviewers are noted in Section 2
Example use-cases that would be enabled with this functionality:
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Resolves Issue #739 and #740
TODO: make an issue for the possible future use-case of having multiple demand components feed into the SLC (or even if thats a use-case worth considering)
Section 5: Impacted Areas of the Software
Section 5.1: New Files
h2integrate/core/test/test_slc_framework.py: added in tests forH2Integrate._classify_slc_technologies()h2integrate/core/test/inputs/tech_connection_cases.yaml: input file for tests inh2integrate/core/test/test_slc_framework.pyexamples/35_system_level_control/upstream_demand/*: new example for integration testing of new functionalitySection 5.2: Modified Files
H2IntegrateModelinh2integrate/core/h2integrate_model.py__init__(): Updated call tocreate_technology_graph()create_technology_graph(): updated to take an input list of tech connections and return the graph (rather than set it as an attribute) so it can be used in_classify_slc_technologies()_classify_slc_technologies():demand_componentspecified in thesystem_level_controlconfig instead of looping throughtechnology_interconnections. This included adding in checking for the following cases where an error is raised:demand_techis missing from thesystem_level_controlsection in the plant configdemand_techis missing from the technology configdemand_techis not connected intechnology_interconnectionsdemand_techis not a valid demand technology type (i.e., the performance model name does not include "DemandComponent")demand_techare included in thetech_to_commodityandtechnology_graphparameters of the SLC config.examples/35_system_level_control/*/plant_config.yaml: added indemand_componenttosystem_level_controlsection.h2integrate/control/control_strategies/system_level/test/test_slc_examples.py: added new test namedtest_slc_upstream_demandthat tests the exampleexamples/35_system_level_control/upstream_demand/Section 6: Additional Supporting Information
Section 7: Test Results, if applicable