Add traits to static injectors about active power, reactive power, voltage control#1645
Add traits to static injectors about active power, reactive power, voltage control#1645
Conversation
…control traits for StaticInjection types Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/b4e1573e-353e-4de2-a675-beeeb8ddbd2e
|
@copilot the traits implemented for FACTs and some other components depend on the flags in the data. For components with specific enum values that describe the control objectives these should be taken into consideration. For synchronous condenser the control voltage is dependent on the bus type as well. Fix these trait calculations |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1645 +/- ##
==========================================
- Coverage 84.13% 84.05% -0.09%
==========================================
Files 204 204
Lines 10536 10558 +22
==========================================
+ Hits 8864 8874 +10
- Misses 1672 1684 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ontrol_mode and bus type Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/65d79b71-2f1c-4c06-b213-6b72d532bed5
…omment Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/65d79b71-2f1c-4c06-b213-6b72d532bed5
Fixed in 2fc6c08 and 72065ed. The traits are now instance-based for FACTSControlDevice and SynchronousCondenser:
Tests cover all enum values and bus type combinations. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
|
||
| # supports_active_power overrides for types without controllable active power | ||
| supports_active_power(::SynchronousCondenser) = false | ||
| supports_active_power(::FACTSControlDevice) = false |
There was a problem hiding this comment.
@copilot This should also depend on the control mode of the FACTSControlDevice. if the control mode of the facts is NML, this should return true
There was a problem hiding this comment.
Fixed in 18b43f6. supports_active_power(::FACTSControlDevice) is now instance-based — returns true for NML (both Series and Shunt links operating), false for BYP (series bypassed, shunt acts as STATCOM for reactive only), OOS, and nothing.
…e for NML mode) Co-authored-by: m-bossart <67015312+m-bossart@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/4e8ef608-6efd-4060-b37e-d9bbcfceef46
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| # supports_reactive_power overrides for types without controllable reactive power | ||
| supports_reactive_power(::InterconnectingConverter) = false | ||
| supports_reactive_power(::FixedAdmittance) = false | ||
| supports_reactive_power(::SwitchedAdmittance) = false |
|
|
||
| function supports_voltage_control(d::SynchronousCondenser) | ||
| bustype = get_bustype(get_bus(d)) | ||
| return !isnothing(bustype) && |
There was a problem hiding this comment.
@copilot the bus can't never be nothing change this check to be based on the bustype only
There was a problem hiding this comment.
Fixed in 09b672a. Removed the !isnothing(bustype) guard — now checks only bustype ∈ (ACBusTypes.PV, ACBusTypes.REF, ACBusTypes.SLACK). Also removed the SynchronousCondenser(nothing) test case and added a REF bus test instead.
…ride) Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/48a5642f-e0b8-4fac-b6fa-a26153919ad0
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…bus is never nothing) Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> Agent-Logs-Url: https://github.com/NREL-Sienna/PowerSystems.jl/sessions/514ef393-9a13-4754-bbd1-ccff32acb69b
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
luke-kiernan
left a comment
There was a problem hiding this comment.
Looks fine at a glance. Details fall under power systems engineering stuff, outside my knowledge base. Question: why does the supports_voltage_control for SC depend on the bus type (true for PV/REF)? Also, what's the intended use case (determining bus types)?
Extends the existing
supports_servicestrait pattern to static injectors with three new capability traits, enabling cross-referencing component capabilities across the Sienna platform. Traits are instance-based where device data (enum flags, bus type) determines the result.Changes
supports_active_power(::StaticInjection)— defaultstrue;falseforSynchronousCondenser,FixedAdmittance,SwitchedAdmittance;FACTSControlDevicecheckscontrol_modeenum (trueforNML,falsefornothing/OOS/BYP)supports_reactive_power(::StaticInjection)— defaultstrue;falseforInterconnectingConverter,FixedAdmittance;FACTSControlDevicecheckscontrol_modeenum (falsefornothing/OOS,trueforNML/BYP);SwitchedAdmittancedefaults totrue(can control reactive power)supports_voltage_control(::StaticInjection)— defaultsfalse;trueforGenerator,Source,Storage,StaticInjectionSubsystem;FACTSControlDevicecheckscontrol_modeenum (falsefornothing/OOS,trueforNML/BYP);SynchronousCondenserchecks bustype directly (trueforPV/REF/SLACK,falseotherwise — nonothingguard since bus is always present)PowerSystems.jlStaticInjectionsubtypes, including data-dependent behavior for FACTS control modes and bus typesUsage
Default dispatch is on
StaticInjectioninstatic_models.jl; concrete/abstract overrides and instance-based methods live insupplemental_accessors.jl(loaded after generated types, matching the existingsupports_services(::AreaInterchange)pattern).Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.