Skip to content

Commit

Permalink
fix FF problems
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jul 31, 2024
1 parent b6c8219 commit 07b8f2b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
14 changes: 6 additions & 8 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ function construct_device!(
if get_use_slacks(model)
throw(ArgumentError("StaticBranchBounds is not compatible with the use of slacks"))
end
devices = get_available_components(model, sys)
if has_subnetworks(network_model)
devices =
get_available_components(model, sys)
add_variables!(
container,
FlowActivePowerVariable,
Expand Down Expand Up @@ -122,9 +121,8 @@ function construct_device!(
NetworkModel{AreaBalancePowerModel},
},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
if has_subnetworks(network_model)
devices =
get_available_components(model, sys)
branch_rate_bounds!(
container,
devices,
Expand All @@ -146,9 +144,8 @@ function construct_device!(
NetworkModel{AreaBalancePowerModel},
},
) where {T <: PSY.ACBranch}
devices = get_available_components(model, sys)
if has_subnetworks(network_model)
devices =
get_available_components(model, sys)
add_variables!(
container,
FlowActivePowerVariable,
Expand All @@ -171,14 +168,15 @@ end

function construct_device!(
::OptimizationContainer,
::PSY.System,
sys::PSY.System,
::ModelConstructStage,
::DeviceModel{<:PSY.ACBranch, StaticBranchUnbounded},
model::DeviceModel{<:PSY.ACBranch, StaticBranchUnbounded},
network_model::Union{
NetworkModel{CopperPlatePowerModel},
NetworkModel{AreaBalancePowerModel},
},
)
devices = get_available_components(model, sys)
add_feedforward_constraints!(container, model, devices)
return
end
Expand Down
12 changes: 11 additions & 1 deletion src/devices_models/devices/area_interchange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function add_variables!(
model::NetworkModel{T},
devices::IS.FlattenIteratorWrapper{PSY.AreaInterchange},
formulation::AbstractBranchFormulation,
) where {T <: PM.AbstractActivePowerModel}
) where {T <: PM.AbstractPowerModel}
time_steps = get_time_steps(container)

variable = add_variable_container!(
Expand All @@ -53,6 +53,16 @@ function add_variables!(
return
end

function add_variables!(
container::OptimizationContainer,
::Type{FlowActivePowerVariable},
model::NetworkModel{CopperPlatePowerModel},
devices::IS.FlattenIteratorWrapper{PSY.AreaInterchange},
formulation::AbstractBranchFormulation,
)
@warn("CopperPlatePowerModel ignores AreaInterchanges. Instead use AreaBalancePowerModel.")
end

"""
Add flow constraints for area interchanges
"""
Expand Down

0 comments on commit 07b8f2b

Please sign in to comment.