Skip to content

Commit 66c655e

Browse files
committed
Merge branch 'system_level_control' of https://github.com/NREL/H2Integrate into system_level_control
2 parents 883c0b9 + aac36d4 commit 66c655e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

h2integrate/core/h2integrate_model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,10 @@ def add_system_level_controller(self, slc_config):
590590
4. Creates connections between the controller and each technology
591591
5. For cost/profit strategies, connects marginal cost inputs
592592
"""
593+
plant_slc_config = self.plant_config["system_level_control"]
593594

594595
# 1. Select controller class based on strategy
595-
strategy_name = self.plant_config["system_level_control"].get("control_strategy")
596+
strategy_name = plant_slc_config.get("control_strategy")
596597
slc_cls = self.supported_models.get(strategy_name)
597598
if slc_cls is None:
598599
raise ValueError(
@@ -609,7 +610,7 @@ def add_system_level_controller(self, slc_config):
609610
self.plant.add_subsystem("system_level_controller", slc_comp)
610611

611612
# 2. Configure the nonlinear solver
612-
solver_config = SLCSolverOptionsConfig.from_dict(slc_config.get("solver_options", {}))
613+
solver_config = SLCSolverOptionsConfig.from_dict(plant_slc_config.get("solver_options", {}))
613614
solver_cls = solver_config.return_nonlinear_solver()
614615
solver = solver_cls()
615616
solver_options = solver_config.get_solver_options()
@@ -659,7 +660,7 @@ def add_system_level_controller(self, slc_config):
659660

660661
# 4. For cost-aware strategies, connect cost inputs based on cost_per_tech
661662
if strategy_name in ("CostMinimizationControl", "ProfitMaximizationControl"):
662-
cost_per_tech = slc_config.get("cost_per_tech", {})
663+
cost_per_tech = plant_slc_config.get("cost_per_tech", {})
663664
for tech_name, _ in slc_config["tech_to_commodity"]:
664665
if self.tech_control_classifiers[tech_name] == "dispatchable":
665666
cost_spec = cost_per_tech.get(tech_name, 0.0)

0 commit comments

Comments
 (0)