Skip to content

Commit

Permalink
error in ERP if multiple elec stor
Browse files Browse the repository at this point in the history
  • Loading branch information
hdunham committed Aug 29, 2024
1 parent e3a7656 commit 3ce3e32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/outagesim/backup_reliability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ function backup_reliability_reopt_inputs(;d::Dict, p::REoptInputs, r::Dict = Dic
!haskey(d, "Outages") ||
Bool(get(d["Outages"], "electric_storage_microgrid_upgraded", false))
)
if typeof(d["ElectricStorage"]) <: AbstractArray && length(d["ElectricStorage"]) == 1
d["ElectricStorage"] = d["ElectricStorage"][1]
elseif !(typeof(d["ElectricStorage"]) <: AbstractDict)
throw(@error("Calculating resilience metrics for a REopt solution with multiple ElectricStorage is not yet supported."))
end
r2[:battery_charge_efficiency] = p.s.storage.attr["ElectricStorage"].charge_efficiency
r2[:battery_discharge_efficiency] = p.s.storage.attr["ElectricStorage"].discharge_efficiency
r2[:battery_size_kw] = get(d["ElectricStorage"], "size_kw", 0)
Expand Down

0 comments on commit 3ce3e32

Please sign in to comment.