Skip to content

Commit

Permalink
Fix #559: report electrolyzer power per-zone (#596)
Browse files Browse the repository at this point in the history
Previously, electrolyzers reported their power as if they were in every zone.
  • Loading branch information
cfe316 authored Dec 5, 2023
1 parent 0a35ba2 commit 090fecc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/write_outputs/write_power_balance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ function write_power_balance(path::AbstractString, inputs::Dict, setup::Dict, EP
powerbalance[(z-1)*L+9, :] = -(value.(EP[:eLosses_By_Zone][z, :]))
end
powerbalance[(z-1)*L+10, :] = (((-1) * inputs["pD"][:, z]))' # Transpose
if (!isempty(ELECTROLYZER))
powerbalance[(z-1)*L+11, :] = (-1) * sum(value.(EP[:vUSE][ELECTROLYZER, :].data), dims = 1)
if !isempty(ELECTROLYZER)
ELECTROLYZER_ZONE = intersect(dfGen[dfGen.Zone.==z, :R_ID], ELECTROLYZER)
powerbalance[(z-1)*L+11, :] = (-1) * sum(value.(EP[:vUSE][ELECTROLYZER_ZONE, :].data), dims = 1)
end
end
if setup["ParameterScale"] == 1
Expand Down

0 comments on commit 090fecc

Please sign in to comment.