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

Add LCC and VSC Data Model, including parser #1205

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add reactive power limits
  • Loading branch information
rodrigomha committed Dec 11, 2024
commit 3fc6b33aaa082db9dc658e36bb61c581ac38328c
1 change: 1 addition & 0 deletions src/PowerSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export Line
export MonitoredLine
export DCBranch
export TwoTerminalHVDCLine
# TODO: Remove VSCDC Line for PSY 5.0
export TwoTerminalVSCDCLine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment that this will be dropped in PSY 5.0 please.

export TwoTerminalVSCLine
export TModelHVDCLine
Expand Down
14 changes: 14 additions & 0 deletions src/descriptors/power_system_structs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,20 @@
"data_type": "MinMax",
"default": "(min=0.0, max=999.9)"
},
{
"name": "reactive_power_limits_from",
"comment": "Limits on the Reactive Power at the from side.",
"null_value": "(min=0.0, max=0.0)",
"data_type": "MinMax",
"default": "(min=0.0, max=0.0)"
},
{
"name": "reactive_power_limits_to",
"comment": "Limits on the Reactive Power at the from side.",
"null_value": "(min=0.0, max=0.0)",
"data_type": "MinMax",
"default": "(min=0.0, max=0.0)"
},
{
"name": "services",
"data_type": "Vector{Service}",
Expand Down
26 changes: 22 additions & 4 deletions src/models/generated/TwoTerminalVSCLine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
max_dc_current::Float64
g::Float64
voltage_limits::MinMax
reactive_power_limits_from::MinMax
reactive_power_limits_to::MinMax
services::Vector{Service}
ext::Dict{String, Any}
internal::InfrastructureSystemsInternal
Expand All @@ -40,6 +42,8 @@
- `max_dc_current::Float64`: (default: `1e8`) Maximum stable dc current limits (A). Includes converter and DC line.
- `g::Float64`: (default: `0.0`) Series conductance of the DC line in pu ([`SYSTEM_BASE`](@ref per_unit))
- `voltage_limits::MinMax`: (default: `(min=0.0, max=999.9)`) Limits on the Voltage at the DC Bus.
- `reactive_power_limits_from::MinMax`: (default: `(min=0.0, max=0.0)`) Limits on the Reactive Power at the from side.
- `reactive_power_limits_to::MinMax`: (default: `(min=0.0, max=0.0)`) Limits on the Reactive Power at the from side.
- `services::Vector{Service}`: (default: `Device[]`) Services that this device contributes to
- `ext::Dict{String, Any}`: (default: `Dict{String, Any}()`) An [*ext*ra dictionary](@ref additional_fields) for users to add metadata that are not used in simulation, such as latitude and longitude.
- `internal::InfrastructureSystemsInternal`: (**Do not modify.**) PowerSystems.jl internal reference
Expand Down Expand Up @@ -69,6 +73,10 @@
g::Float64
"Limits on the Voltage at the DC Bus."
voltage_limits::MinMax
"Limits on the Reactive Power at the from side."
reactive_power_limits_from::MinMax
"Limits on the Reactive Power at the from side."
reactive_power_limits_to::MinMax
"Services that this device contributes to"
services::Vector{Service}
"An [*ext*ra dictionary](@ref additional_fields) for users to add metadata that are not used in simulation, such as latitude and longitude."
Expand All @@ -77,12 +85,12 @@
internal::InfrastructureSystemsInternal
end

function TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), services=Device[], ext=Dict{String, Any}(), )
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, services, ext, InfrastructureSystemsInternal(), )
function TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), reactive_power_limits_from=(min=0.0, max=0.0), reactive_power_limits_to=(min=0.0, max=0.0), services=Device[], ext=Dict{String, Any}(), )
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, reactive_power_limits_from, reactive_power_limits_to, services, ext, InfrastructureSystemsInternal(), )

Check warning on line 89 in src/models/generated/TwoTerminalVSCLine.jl

View check run for this annotation

Codecov / codecov/patch

src/models/generated/TwoTerminalVSCLine.jl#L88-L89

Added lines #L88 - L89 were not covered by tests
end

function TwoTerminalVSCLine(; name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), services=Device[], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, services, ext, internal, )
function TwoTerminalVSCLine(; name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), reactive_power_limits_from=(min=0.0, max=0.0), reactive_power_limits_to=(min=0.0, max=0.0), services=Device[], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, reactive_power_limits_from, reactive_power_limits_to, services, ext, internal, )
end

# Constructor for demo purposes; non-functional.
Expand All @@ -100,6 +108,8 @@
max_dc_current=0.0,
g=0.0,
voltage_limits=(min=0.0, max=0.0),
reactive_power_limits_from=(min=0.0, max=0.0),
reactive_power_limits_to=(min=0.0, max=0.0),
services=Device[],
ext=Dict{String, Any}(),
)
Expand Down Expand Up @@ -129,6 +139,10 @@
get_g(value::TwoTerminalVSCLine) = value.g
"""Get [`TwoTerminalVSCLine`](@ref) `voltage_limits`."""
get_voltage_limits(value::TwoTerminalVSCLine) = value.voltage_limits
"""Get [`TwoTerminalVSCLine`](@ref) `reactive_power_limits_from`."""
get_reactive_power_limits_from(value::TwoTerminalVSCLine) = value.reactive_power_limits_from
"""Get [`TwoTerminalVSCLine`](@ref) `reactive_power_limits_to`."""
get_reactive_power_limits_to(value::TwoTerminalVSCLine) = value.reactive_power_limits_to
"""Get [`TwoTerminalVSCLine`](@ref) `services`."""
get_services(value::TwoTerminalVSCLine) = value.services
"""Get [`TwoTerminalVSCLine`](@ref) `ext`."""
Expand Down Expand Up @@ -158,6 +172,10 @@
set_g!(value::TwoTerminalVSCLine, val) = value.g = val
"""Set [`TwoTerminalVSCLine`](@ref) `voltage_limits`."""
set_voltage_limits!(value::TwoTerminalVSCLine, val) = value.voltage_limits = val
"""Set [`TwoTerminalVSCLine`](@ref) `reactive_power_limits_from`."""
set_reactive_power_limits_from!(value::TwoTerminalVSCLine, val) = value.reactive_power_limits_from = val
"""Set [`TwoTerminalVSCLine`](@ref) `reactive_power_limits_to`."""
set_reactive_power_limits_to!(value::TwoTerminalVSCLine, val) = value.reactive_power_limits_to = val
"""Set [`TwoTerminalVSCLine`](@ref) `services`."""
set_services!(value::TwoTerminalVSCLine, val) = value.services = val
"""Set [`TwoTerminalVSCLine`](@ref) `ext`."""
Expand Down
Loading