Skip to content

Commit 0ca4a20

Browse files
authored
Merge pull request #691 from johnjasa/rename_demand
Rename demand in converters
2 parents 2822073 + 42c1b47 commit 0ca4a20

20 files changed

Lines changed: 92 additions & 89 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Change commodity in DRI and EAF model from pig iron to sponge iron based on likely carbon content [PR 670](https://github.com/NatLabRockies/H2Integrate/pull/670)
55
- Bugfix for round-trip efficiency handling when calling `check_inputs` around `StoragePerformanceModel` [PR 684](https://github.com/NatLabRockies/H2Integrate/pull/684)
66
- Bugfix. Include nuclear in electricity producing tech list and improve error message for zero-length electricity producing techs in model when electricity is specified as the commodity. [PR 685](https://github.com/NatLabRockies/H2Integrate/pull/685)
7+
- Renamed `{commodity}_demand` inputs to `{commodity}_set_point` on all converter performance components to align with storage baseclass naming and distinguish converter operating targets from demand components. [PR 691](https://github.com/NatLabRockies/H2Integrate/pull/691)
78
- Add electric arc furnace performance and cost models based on the Carnegie Mellon University DecarbSTEEL v5 excel model [PR 686](https://github.com/NatLabRockies/H2Integrate/pull/686)
89
- Adds scrap-only performance model
910
- Adds DRI + scrap performance model

docs/technology_models/grid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Multiple grid instances may be used within the same plant to represent different
2424
| ------------------------ | ------------------ | ----- | ----------------------------------------------------------------- |
2525
| `interconnection_size` | scalar | kW | Maximum power capacity for grid connection. |
2626
| `electricity_in` | array[n_timesteps] | kW | Electricity flowing into the grid (selling to grid). |
27-
| `electricity_demand` | array[n_timesteps] | kW | Electricity demand from downstream technologies. |
27+
| `electricity_set_point` | array[n_timesteps] | kW | Electricity set point from downstream technologies. |
2828

2929
**Outputs**
3030
| Name | Shape | Units | Description |

docs/technology_models/natural_gas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The performance model requires the following parameters:
1414
- **NGCT (Combustion Turbine)**: 10-14 MMBtu/MWh (lower efficiency, faster response)
1515

1616
Optional parameter:
17-
- `electricity_demand` (optional): Defaults to the `system_capacity` but can be set to a particular demand profile.
18-
- See example `16_natural_gas` to see how missed load from the battery is set as the electricity demand for the natural gas plant.
17+
- `electricity_set_point` (optional): Defaults to the `system_capacity` but can be set to a particular set point profile.
18+
- See example `16_natural_gas` to see how missed load from the battery is set as the electricity set point for the natural gas plant.
1919

2020
The model implements the relationship:
2121

docs/technology_models/nuclear.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The performance model limits electricity production by the rated capacity and an
1414
| Name | Shape | Units | Description |
1515
| --- | --- | --- | --- |
1616
| `system_capacity` | scalar | kW | Rated electrical capacity. |
17-
| `electricity_demand` | array[n_timesteps] | kW | Optional demand profile; defaults to rated capacity. |
17+
| `electricity_set_point` | array[n_timesteps] | kW | Optional set point profile; defaults to rated capacity. |
1818

1919
**Outputs**
2020
| Name | Shape | Units | Description |

examples/16_natural_gas/plant_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ technology_interconnections:
2626
# subtract the combined generation from the demand profile
2727
- [elec_combiner, electrical_load_demand, electricity, cable]
2828
# connect the remaining electricity demand to the NG plant
29-
- [electrical_load_demand, natural_gas_plant, [unmet_electricity_demand_out, electricity_demand]]
29+
- [electrical_load_demand, natural_gas_plant, [unmet_electricity_demand_out, electricity_set_point]]
3030
# connect NG feedstock to NG plant
3131
- [ng_feedstock, natural_gas_plant, natural_gas, pipe]
3232
# connect natural gas and solar to finance combiner

examples/23_solar_wind_ng_demand/plant_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ technology_interconnections:
2727
# connect NG feedstock to NG plant
2828
- [combiner, electrical_load_demand, [electricity_out, electricity_in]]
2929
# subtract wind and solar from demand
30-
- [electrical_load_demand, natural_gas_plant, [unmet_electricity_demand_out, electricity_demand]]
30+
- [electrical_load_demand, natural_gas_plant, [unmet_electricity_demand_out, electricity_set_point]]
3131
# give remaining load demand to natural gas plant
3232
- [combiner, fin_combiner, electricity, cable]
3333
- [natural_gas_plant, fin_combiner, electricity, cable]

examples/24_solar_battery_grid/plant_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ technology_interconnections:
2727
# subtract variable generation from the demand
2828
- [bat_combiner, electrical_load_demand, electricity, cable]
2929
# connect remaining demand to grid buying
30-
- [electrical_load_demand, grid_buy, [unmet_electricity_demand_out, electricity_demand]]
30+
- [electrical_load_demand, grid_buy, [unmet_electricity_demand_out, electricity_set_point]]
3131
# connect surplus generation to grid selling
3232
- [electrical_load_demand, grid_sell, [unused_electricity_out, electricity_in]]
3333
# combine electricity generated from solar and electricity bought from grid

examples/33_peak_load_management/plant_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ technology_interconnections:
1111
# include battery charge/discharge in the load
1212
- [battery, electrical_load_demand, [electricity_out, electricity_in]]
1313
# buy power from the grid to fulfill demand including to accommodate battery operation
14-
- [electrical_load_demand, grid_buy, [unmet_electricity_demand_out, electricity_demand]]
14+
- [electrical_load_demand, grid_buy, [unmet_electricity_demand_out, electricity_set_point]]

examples/test/test_all_examples.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,9 @@ def test_natural_gas_example(subtests, temp_copy_of_example):
10571057
pre_ng_missed_load = model.prob.get_val(
10581058
"electrical_load_demand.unmet_electricity_demand_out", units="kW"
10591059
)
1060-
ng_electricity_demand = model.prob.get_val("natural_gas_plant.electricity_demand", units="kW")
1060+
ng_electricity_set_point = model.prob.get_val(
1061+
"natural_gas_plant.electricity_set_point", units="kW"
1062+
)
10611063
ng_electricity_production = model.prob.get_val("natural_gas_plant.electricity_out", units="kW")
10621064
bat_init_charge = 200000.0 * 0.1 # max capacity in kW and initial charge rate percentage
10631065

@@ -1091,11 +1093,11 @@ def test_natural_gas_example(subtests, temp_copy_of_example):
10911093
== sum(ng_electricity_production) + solar_aep
10921094
)
10931095

1094-
with subtests.test("Check missed load is natural gas plant electricity demand"):
1095-
assert pytest.approx(ng_electricity_demand, rel=1e-6) == pre_ng_missed_load
1096+
with subtests.test("Check missed load is natural gas plant electricity set point"):
1097+
assert pytest.approx(ng_electricity_set_point, rel=1e-6) == pre_ng_missed_load
10961098

1097-
with subtests.test("Check natural_gas_plant electricity out equals demand"):
1098-
assert pytest.approx(ng_electricity_demand, rel=1e-6) == ng_electricity_production
1099+
with subtests.test("Check natural_gas_plant electricity out equals set point"):
1100+
assert pytest.approx(ng_electricity_set_point, rel=1e-6) == ng_electricity_production
10991101

11001102
# Subtests for checking specific values
11011103
with subtests.test("Check Natural Gas CapEx"):

h2integrate/converters/grid/grid.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class GridPerformanceModel(PerformanceModelBaseClass):
4141
Inputs
4242
interconnection_size (float): Maximum power capacity for grid connection (kW).
4343
electricity_in (array): Power flowing into the grid (selling) (kW).
44-
electricity_demand (array): Downstream electricity demand (kW).
44+
electricity_set_point (array): Downstream electricity set point (kW).
4545
4646
Outputs
4747
electricity_out (array): Power flowing out of the grid (buying) (kW).
@@ -84,13 +84,13 @@ def setup(self):
8484
desc="Electricity flowing into grid interconnection point (selling to grid)",
8585
)
8686

87-
# Electricity demand from downstream (for buying from grid)
87+
# Electricity set point from downstream (for buying from grid)
8888
self.add_input(
89-
"electricity_demand",
89+
"electricity_set_point",
9090
val=0.0,
9191
shape=n_timesteps,
9292
units=self.commodity_rate_units,
93-
desc="Electricity demand from downstream technologies",
93+
desc="Electricity set point from downstream technologies",
9494
)
9595

9696
# electricity_out is electricity flowing OUT OF the grid (buying from grid)
@@ -126,12 +126,12 @@ def compute(self, inputs, outputs):
126126
electricity_sold = np.clip(inputs["electricity_in"], 0, interconnection_size)
127127
outputs["electricity_sold"] = electricity_sold
128128

129-
# Buying: electricity flows out of grid to meet demand, limited by interconnection
130-
electricity_bought = np.clip(inputs["electricity_demand"], 0, interconnection_size)
129+
# Buying: electricity flows out of grid to meet set point, limited by interconnection
130+
electricity_bought = np.clip(inputs["electricity_set_point"], 0, interconnection_size)
131131
outputs["electricity_out"] = electricity_bought
132132

133-
# Unmet demand if demand exceeds interconnection size
134-
outputs["electricity_unmet_demand"] = inputs["electricity_demand"] - electricity_bought
133+
# Unmet demand if set point exceeds interconnection size
134+
outputs["electricity_unmet_demand"] = inputs["electricity_set_point"] - electricity_bought
135135

136136
# Not sold electricity if demand exceeds interconnection size
137137
outputs["electricity_excess"] = inputs["electricity_in"] - electricity_sold

0 commit comments

Comments
 (0)