Skip to content

Commit

Permalink
* nemo/generators.py (Battery.durations): New class member.
Browse files Browse the repository at this point in the history
  Add 12 and 24 hour batteries per GenCost 2024-25.
  • Loading branch information
bje- committed Dec 13, 2024
1 parent 67ca193 commit c259e33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nemo/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ class Battery(Generator):
# Lifespan of the battery in years
lifetime = 15

# storage durations (in hours)
durations = (1, 2, 4, 8, 12, 24)

patch = Patch(facecolor='#00a2fa')
"""Colour for plotting"""

Expand All @@ -840,7 +843,7 @@ def __init__(self, polygon, capacity, shours, battery,
self.battery = battery
self.runhours = 0
self.shours = shours
if shours not in [1, 2, 4, 8]:
if shours not in self.durations:
raise ValueError(shours)
if capacity * shours != battery.maxstorage:
raise ValueError
Expand Down Expand Up @@ -883,7 +886,7 @@ def soc(self):
def capcost(self, costs):
"""Return the capital cost."""
kwh = self.battery.maxstorage * 1000
if self.shours not in [1, 2, 4, 8]:
if self.shours not in self.durations:
raise ValueError(self.shours)
cost_per_kwh = costs.totcost_per_kwh[type(self)][self.shours]
return kwh * cost_per_kwh
Expand Down

0 comments on commit c259e33

Please sign in to comment.