Skip to content

Commit

Permalink
remove Direction Constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Oct 2, 2024
1 parent 4d3770e commit 54d1d91
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
1 change: 0 additions & 1 deletion src/core/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ The specified constraint is formulated as:
```
"""
struct PhaseAngleControlLimit <: ConstraintType end
struct HVDCDirection <: ConstraintType end
struct InterfaceFlowLimit <: ConstraintType end
struct HVDCFlowCalculationConstraint <: ConstraintType end

Expand Down
48 changes: 0 additions & 48 deletions src/devices_models/devices/TwoTerminalDC_branches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -601,54 +601,6 @@ function add_constraints!(
return
end

function add_constraints!(
container::OptimizationContainer,
::Type{T},
devices::IS.FlattenIteratorWrapper{U},
::DeviceModel{U, HVDCTwoTerminalDispatch},
::NetworkModel{<:PM.AbstractDCPModel},
) where {T <: HVDCDirection, U <: PSY.TwoTerminalHVDCLine}
time_steps = get_time_steps(container)
names = [PSY.get_name(d) for d in devices]

tf_var = get_variable(container, FlowActivePowerToFromVariable(), U)
ft_var = get_variable(container, FlowActivePowerFromToVariable(), U)
direction_var = get_variable(container, HVDCFlowDirectionVariable(), U)

constraint_ft_ub =
add_constraints_container!(container, T(), U, names, time_steps; meta = "ft_ub")
constraint_tf_ub =
add_constraints_container!(container, T(), U, names, time_steps; meta = "tf_ub")
constraint_ft_lb =
add_constraints_container!(container, T(), U, names, time_steps; meta = "ft_lb")
constraint_tf_lb =
add_constraints_container!(container, T(), U, names, time_steps; meta = "tf_lb")
for d in devices
min_rate_to, max_rate_to = PSY.get_active_power_limits_to(d)
min_rate_from, max_rate_from = PSY.get_active_power_limits_to(d)
name = PSY.get_name(d)
for t in time_steps
constraint_tf_ub[name, t] = JuMP.@constraint(
get_jump_model(container),
tf_var[name, t] <= max_rate_to * (1 - direction_var[name, t])
)
constraint_ft_ub[name, t] = JuMP.@constraint(
get_jump_model(container),
ft_var[name, t] <= max_rate_from * (1 - direction_var[name, t])
)
constraint_tf_lb[name, t] = JuMP.@constraint(
get_jump_model(container),
direction_var[name, t] * min_rate_to <= tf_var[name, t]
)
constraint_ft_lb[name, t] = JuMP.@constraint(
get_jump_model(container),
direction_var[name, t] * min_rate_from <= tf_var[name, t]
)
end
end
return
end

function add_constraints!(
container::OptimizationContainer,
::Type{HVDCPowerBalance},
Expand Down

0 comments on commit 54d1d91

Please sign in to comment.