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

Solidify a consistent interface for running power flows #38

Open
GabrielKS opened this issue Jul 12, 2024 · 1 comment
Open

Solidify a consistent interface for running power flows #38

GabrielKS opened this issue Jul 12, 2024 · 1 comment

Comments

@GabrielKS
Copy link
Contributor

GabrielKS commented Jul 12, 2024

Here are the extant claims about how the user can run a power flow using PowerFlows.jl:

  • Function solve_powerflow is exported, it can run lots of types of power flows and outputs a possibly nested Dict of DataFrames
  • Function solve_ac_powerflow! is exported, it does the same calculation as solve_powerflow(::ACPowerFlow, ...) but updates the System with the results rather than returning them
  • The docs mention functions run_powerflow and run_powerflow! but these do not exist

My first thought for how to clean this up is to just have a pair of functions solve_powerflow, solve_powerflow! (or run_powerflow, run_powerflow!) where the non-! version returns results and the ! version updates the System.

Also there is an exported function write_results whose PF methods always take a PowerFlowData, but there does not seem to be a way for one to get a populated PowerFlowData from any exported function. We should think about whether/how we want the user to be interacting with PowerFlowData and adjust the interface accordingly.

Another inconsistency is that solve_powerflow(::DCPowerFlow, ...) gives results indexed by time (currently only "1") and solve_powerflow(::ACPowerFlow, ...) does not.

@GabrielKS
Copy link
Contributor Author

GabrielKS commented Oct 28, 2024

Though we are not currently planning for end users to interact with the PowerFlowData struct, we need to have a stable function for solving a power flow in-place given a PowerFlowData for use elsewhere in Sienna, like in the PowerSimulations power flow in the loop feature. Right now that function is called solve_powerflow! and it isn't exported.

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

No branches or pull requests

1 participant