From 54d1d91753a2d81bc4f151aab75a64e60b66a94e Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Wed, 2 Oct 2024 16:53:44 -0700 Subject: [PATCH] remove Direction Constraint --- src/core/constraints.jl | 1 - .../devices/TwoTerminalDC_branches.jl | 48 ------------------- 2 files changed, 49 deletions(-) diff --git a/src/core/constraints.jl b/src/core/constraints.jl index 28afddd5c..817130ba4 100644 --- a/src/core/constraints.jl +++ b/src/core/constraints.jl @@ -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 diff --git a/src/devices_models/devices/TwoTerminalDC_branches.jl b/src/devices_models/devices/TwoTerminalDC_branches.jl index b2a0372c1..53aee2bae 100644 --- a/src/devices_models/devices/TwoTerminalDC_branches.jl +++ b/src/devices_models/devices/TwoTerminalDC_branches.jl @@ -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},