Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unbounded HVDC model for Copperplate #1159

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,37 @@
return
end

function construct_device!(

Check warning on line 544 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L544

Added line #L544 was not covered by tests
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
model::DeviceModel{T, HVDCTwoTerminalUnbounded},
network_model::NetworkModel{CopperPlatePowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices = get_available_components(model, sys)
add_variables!(container, FlowActivePowerVariable, devices, HVDCTwoTerminalUnbounded())
add_to_expression!(

Check warning on line 553 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L551-L553

Added lines #L551 - L553 were not covered by tests
container,
ActivePowerBalance,
FlowActivePowerVariable,
devices,
model,
network_model,
)
return

Check warning on line 561 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L561

Added line #L561 was not covered by tests
end

function construct_device!(

Check warning on line 564 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L564

Added line #L564 was not covered by tests
container::OptimizationContainer,
sys::PSY.System,
::ModelConstructStage,
device_model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
::NetworkModel{CopperPlatePowerModel},
)
add_constraint_dual!(container, sys, device_model)
return

Check warning on line 572 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L571-L572

Added lines #L571 - L572 were not covered by tests
end

# Repeated method to avoid ambiguity between HVDCTwoTerminalUnbounded and HVDCTwoTerminalLossless
function construct_device!(
container::OptimizationContainer,
Expand Down
Loading