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

Feature/nr_pf_solver #54

Open
wants to merge 12 commits into
base: hrgks/psse_exporter_psy4
Choose a base branch
from
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
KLU = "ef3ab10e-7fda-4108-b977-705223b18434"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
Expand All @@ -22,6 +23,7 @@ DataStructures = "0.18"
Dates = "1"
InfrastructureSystems = "2"
JSON3 = "1"
KLU = "^0.6"
LinearAlgebra = "1"
Logging = "1"
NLsolve = "4"
Expand Down
8 changes: 6 additions & 2 deletions src/PowerFlowData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ NOTE: use it for AC power flow computations.
WARNING: functions for the evaluation of the multi-period AC PF still to be implemented.
"""
function PowerFlowData(
::ACPowerFlow,
::ACPowerFlow{<:ACPowerFlowSolverType},
sys::PSY.System;
time_steps::Int = 1,
timestep_names::Vector{String} = String[],
Expand Down Expand Up @@ -440,7 +440,11 @@ Create an appropriate `PowerFlowContainer` for the given `PowerFlowEvaluationMod
"""
function make_power_flow_container end

make_power_flow_container(pfem::ACPowerFlow, sys::PSY.System; kwargs...) =
make_power_flow_container(
pfem::ACPowerFlow{<:ACPowerFlowSolverType},
sys::PSY.System;
kwargs...,
) =
PowerFlowData(pfem, sys; kwargs...)

make_power_flow_container(pfem::DCPowerFlow, sys::PSY.System; kwargs...) =
Expand Down
8 changes: 6 additions & 2 deletions src/PowerFlows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export solve_powerflow
export solve_ac_powerflow!
export PowerFlowData
export DCPowerFlow
export NLSolveACPowerFlow
export KLUACPowerFlow
export ACPowerFlow
Copy link
Contributor

Choose a reason for hiding this comment

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

For backwards compatibility, we may want something like

const ACPowerFlow = NLSolveACPowerFlow

somewhere.

export ACPowerFlowSolverType
export PTDFDCPowerFlow
export vPTDFDCPowerFlow
export PSSEExportPowerFlow
Expand All @@ -20,10 +23,11 @@ import PowerSystems
import PowerSystems: System
import LinearAlgebra
import NLsolve
import KLU
import SparseArrays
import InfrastructureSystems
import PowerNetworkMatrices
import SparseArrays: SparseMatrixCSC
import SparseArrays: SparseMatrixCSC, sparse
import JSON3
import DataStructures: OrderedDict
import Dates
Expand All @@ -40,6 +44,6 @@ include("psse_export.jl")
include("solve_dc_powerflow.jl")
include("ac_power_flow.jl")
include("ac_power_flow_jacobian.jl")
include("nlsolve_ac_powerflow.jl")
include("newton_ac_powerflow.jl")
include("post_processing.jl")
end
3 changes: 3 additions & 0 deletions src/definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ const DEFAULT_MAX_REDISTRIBUTION_ITERATIONS = 10

const ISAPPROX_ZERO_TOLERANCE = 1e-6

const DEFAULT_NR_MAX_ITER::Int64 = 30 # default maxIter for the NR power flow
const DEFAULT_NR_TOL::Float64 = 1e-9 # default tolerance for the NR power flow

const AC_PF_KW = []
Loading
Loading