Skip to content

Commit

Permalink
update powermodels translator
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Dec 16, 2024
1 parent 5ca5287 commit 8fb3a8f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/network_models/pm_translator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PM_BUSTYPES = Dict{PSY.ACBusTypes, Int}(
struct PMmap
bus::Dict{Int, PSY.ACBus}
arcs::Dict{PM_MAP_TUPLE, <:PSY.ACBranch}
arcs_dc::Dict{PM_MAP_TUPLE, PSY.TwoTerminalHVDCLine}
arcs_dc::Dict{PM_MAP_TUPLE, Union{PSY.TwoTerminalHVDCLine, PSY.TwoTerminalVSCLine}}
end

function get_branch_to_pm(
Expand Down Expand Up @@ -341,6 +341,15 @@ function get_branch_to_pm(
return PM_branch
end

function get_branch_to_pm(
ix::Int,
branch::PSY.TwoTerminalVSCLine,
::Type{HVDCTwoTerminalVSCLossBilinear},
::Type{<:PM.AbstractPowerModel},
)
return Dict{String, Any}()
end

function get_branch_to_pm(
ix::Int,
branch::PSY.TwoTerminalHVDCLine,
Expand Down Expand Up @@ -429,6 +438,10 @@ function get_branches_to_pm(
for (d, device_model) in branch_template
comp_type = get_component_type(device_model)
!(comp_type <: T) && continue
if comp_type <: PSY.TwoTerminalVSCLine &&
get_formulation(device_model) <: HVDCTwoTerminalVSCLossBilinear
continue
end
start_idx += length(PM_branches)
for (i, branch) in enumerate(get_available_components(device_model, sys))
ix = i + start_idx
Expand Down

0 comments on commit 8fb3a8f

Please sign in to comment.