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

PowerFlows.jl unified develop branch #53

Open
wants to merge 133 commits into
base: main
Choose a base branch
from

Conversation

GabrielKS
Copy link
Contributor

@GabrielKS GabrielKS commented Nov 5, 2024

The hrgks/psse_exporter_psy4 branch has become a unified develop-type branch for lots of new PowerFlows.jl functionality. It now contains the PSS/E exporter implementation as well as some new power flow implementations from @rbolgaryn. Pull requests include:

  1. PSSE Exporter Part 1: Add Tests and Formalize Exporter Implementation #42
  2. PSSE Exporter Part 2: Integrate with PowerSimulations #48
  3. Feature/nr_pf_solver #54
  4. Fix bug 74: enforcing reactive power limits for AC power flow #76
  5. Modify PowerFlowData fields for multi-period AC PF #78
  6. Implement power flow-specific (re)active power limits proxies #79

plus some more commits only in this branch.

HaleyRoss and others added 30 commits August 13, 2024 10:58
Add fields to `PowerFlowEvaluationModel`s to support further PSI integration
src/psse_export.jl Outdated Show resolved Hide resolved
src/psse_export.jl Outdated Show resolved Hide resolved
@GabrielKS GabrielKS marked this pull request as ready for review January 31, 2025 11:10
@GabrielKS GabrielKS requested a review from jd-lara January 31, 2025 11:10
)

# Shapes to reuse
zeros_bus_time = () -> zeros(Float64, n_buses, time_steps)
Copy link
Member

Choose a reason for hiding this comment

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

There is no need to have anonymous functions do this. The compiler can't infer this until call time. Just use zeros(Float64, n_buses, time_steps)

src/newton_ac_powerflow.jl Outdated Show resolved Hide resolved
src/newton_ac_powerflow.jl Outdated Show resolved Hide resolved
data.bus_angles[pq, t] .= angle.(V[pq])
data.bus_angles[pv, t] .= angle.(V[pv])
else
data.bus_activepower_injection[:, t] .= NaN64
Copy link
Member

Choose a reason for hiding this comment

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

you just use NaN

src/newton_ac_powerflow.jl Outdated Show resolved Hide resolved
src/newton_ac_powerflow.jl Outdated Show resolved Hide resolved
@@ -270,7 +258,7 @@ function _power_redistribution_ref(
@debug "Remaining residual $q_residual, $(PSY.get_name(bus))"
p_set_point = PSY.get_active_power(device) + p_residual
PSY.set_active_power!(device, p_set_point)
p_limits = PSY.get_reactive_power_limits(device)
p_limits = get_reactive_power_limits_for_power_flow(device) # TODO should this be active_power_limits? It was reactive in the existing codebase
Copy link
Member

Choose a reason for hiding this comment

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

This has to be active yes

src/newton_ac_powerflow.jl Outdated Show resolved Hide resolved
src/post_processing.jl Outdated Show resolved Hide resolved
src/post_processing.jl Outdated Show resolved Hide resolved
@@ -24,18 +24,19 @@ function PolarPowerFlowJacobian(data::ACPowerFlowData, x0::Vector{Float64})
end

function _create_jacobian_matrix_structure(data::ACPowerFlowData)
time_step = 1 # TODO placeholder time_step
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolution: the NLSolve implementation of AC power flow does not support multi period, so @rbolgaryn will implement code to throw an error if the user tries to do that, and then all these time_step placeholders can be deleted.

Choose a reason for hiding this comment

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

Right now, it is not even possible that the NLSolve is used with multiperiod power flow (see below). I think we can just safely remove it without raising an error.

# Multiperiod power flow
function solve_powerflow!(
    data::ACPowerFlowData;
    kwargs...,
)
    pf = ACPowerFlow()  # todo: somehow store in data which PF to use (see issue #50)

Choose a reason for hiding this comment

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

time_step can remain in the functions because it is possible to provide time_step as an optional input to set which time step to use for the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance Improvements PSSe Exporter
5 participants