Skip to content

Commit 27c1bdb

Browse files
committed
fixed storage performance model and storage baseclass
1 parent 3aaca71 commit 27c1bdb

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

h2integrate/storage/storage_baseclass.py

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def setup(self):
161161
self.add_input(
162162
"storage_capacity",
163163
val=self.config.max_capacity,
164-
units=self.commodity_ammount_units,
164+
units=self.commodity_amount_units,
165165
desc="Storage capacity",
166166
)
167167

@@ -219,14 +219,6 @@ def setup(self):
219219
desc=f"{self.commodity} input and output from storage",
220220
)
221221

222-
self.add_input(
223-
f"{self.commodity}_demand",
224-
val=0.0,
225-
shape=self.n_timesteps,
226-
units=self.commodity_rate_units,
227-
desc=f"{self.commodity} demand",
228-
)
229-
230222
self.add_output(
231223
f"unmet_{self.commodity}_demand_out",
232224
val=0.0,
@@ -276,17 +268,18 @@ def compute(self, inputs, outputs, discrete_inputs=[], discrete_outputs=[]):
276268
# Below is an example of what the compute method would look like in the
277269
# StoragePerformanceModel
278270
# Do whatever pre-calculations are necessary, then run storage
279-
self.current_soc = self.config.init_soc_fraction
280-
281-
charge_rate = inputs["max_charge_rate"][0]
282-
if "max_discharge_rate" in inputs:
283-
discharge_rate = inputs["max_discharge_rate"][0]
284-
else:
285-
discharge_rate = inputs["max_charge_rate"][0]
286-
storage_capacity = inputs["storage_capacity"]
287-
outputs = self.run_storage(
288-
charge_rate, discharge_rate, storage_capacity, inputs, outputs, discrete_inputs
289-
)
271+
# self.current_soc = self.config.init_soc_fraction
272+
273+
# charge_rate = inputs["max_charge_rate"][0]
274+
# if "max_discharge_rate" in inputs:
275+
# discharge_rate = inputs["max_discharge_rate"][0]
276+
# else:
277+
# discharge_rate = inputs["max_charge_rate"][0]
278+
# storage_capacity = inputs["storage_capacity"]
279+
# outputs = self.run_storage(
280+
# charge_rate, discharge_rate, storage_capacity, inputs, outputs, discrete_inputs
281+
# )
282+
raise NotImplementedError("This method should be implemented in a subclass")
290283

291284
def run_storage(
292285
self, charge_rate, discharge_rate, storage_capacity, inputs, outputs, discrete_inputs

h2integrate/storage/storage_performance_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def compute(self, inputs, outputs, discrete_inputs=[], discrete_outputs=[]):
199199
discharge_rate = inputs["max_discharge_rate"][0]
200200
else:
201201
discharge_rate = inputs["max_charge_rate"][0]
202-
storage_capacity = inputs["storage_capacity"]
202+
storage_capacity = inputs["storage_capacity"][0]
203203
outputs = self.run_storage(
204204
charge_rate, discharge_rate, storage_capacity, inputs, outputs, discrete_inputs
205205
)

0 commit comments

Comments
 (0)