diff --git a/src/definitions.jl b/src/definitions.jl index 03af2999..d8ecad1a 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -6,6 +6,7 @@ const MAX_INIT_RESIDUAL = 10.0 const MAX_NLSOLVE_INTERATIONS = 10 const BOUNDS_TOLERANCE = 1e-6 const MAX_REACTIVE_POWER_ITERATIONS = 10 +const DEFAULT_MAX_REDISTRIBUTION_ITERATIONS = 10 const ISAPPROX_ZERO_TOLERANCE = 1e-6 diff --git a/src/nlsolve_ac_powerflow.jl b/src/nlsolve_ac_powerflow.jl index bc9ccfc8..6eb29a2d 100644 --- a/src/nlsolve_ac_powerflow.jl +++ b/src/nlsolve_ac_powerflow.jl @@ -41,7 +41,8 @@ function solve_ac_powerflow!(system::PSY.System; kwargs...) system; check_connectivity = get(kwargs, :check_connectivity, true), ) - max_iterations = get(kwargs, :max_redistribution_iterations, 10) + max_iterations = + get(kwargs, :max_redistribution_iterations, DEFAULT_MAX_REDISTRIBUTION_ITERATIONS) res = _solve_powerflow!(data, check_reactive_power_limits; kwargs...) if res.f_converged write_powerflow_solution!(system, res.zero, max_iterations)