diff --git a/src/data_model/transformations/dss2eng.jl b/src/data_model/transformations/dss2eng.jl index ca68b4544..6abe8d04e 100644 --- a/src/data_model/transformations/dss2eng.jl +++ b/src/data_model/transformations/dss2eng.jl @@ -502,15 +502,9 @@ function _dss2eng_line!(data_eng::Dict{String,<:Any}, data_dss::OpenDssDataModel delete!(eng_obj, "linecode") # ENGINEERING model switches are zero-length objects - for k in ["b_fr", "b_to", "g_fr", "g_to"] + for k in ["b_fr", "b_to", "g_fr", "g_to", "rs", "xs"] if haskey(eng_obj, k) - _admittance_conversion(data_eng, eng_obj, k) - end - end - - for k in ["rs", "xs"] - if haskey(eng_obj, k) - eng_obj[k] = _impedance_conversion(data_eng, eng_obj, k) + eng_obj[k] .*= get(eng_obj, length, 1.0) end end delete!(eng_obj, "length") diff --git a/test/multinetwork.jl b/test/multinetwork.jl index 5ebaa87a4..a2bc1d56d 100644 --- a/test/multinetwork.jl +++ b/test/multinetwork.jl @@ -30,12 +30,12 @@ @testset "solve_mc_opf_oltc" begin result_mn = PowerModelsDistribution.solve_mn_mc_opf_oltc(IEEE13_Feeder_engr, ACPUPowerModel, ipopt_solver) @test result_mn["termination_status"] == LOCALLY_SOLVED - + @test all(isapprox.(result_mn["solution"]["nw"]["1"]["voltage_source"]["source"]["pg"], [738.58786, 788.38272, 787.79729]; atol=1e-5)) @test all(isapprox.(result_mn["solution"]["nw"]["1"]["voltage_source"]["source"]["qg"], [237.68517, 209.61208, 266.77223]; atol=1e-5)) @test all(isapprox.(result_mn["solution"]["nw"]["8"]["voltage_source"]["source"]["pg"], [847.77707, 889.87745, 918.34146]; atol=1e-5)) @test all(isapprox.(result_mn["solution"]["nw"]["8"]["voltage_source"]["source"]["qg"], [284.46267, 227.28860, 292.33564]; atol=1e-5)) - + @test all(isapprox.(result_mn["solution"]["nw"]["1"]["transformer"]["reg1"]["tap"][2], [1.02358, 1.01724, 1.02169]; atol=1e-5)) @test all(isapprox.(result_mn["solution"]["nw"]["8"]["transformer"]["reg1"]["tap"][2], [1.02719, 1.01984, 1.02414]; atol=1e-5)) end diff --git a/test/test_cases.jl b/test/test_cases.jl index a0e046de2..1d3e03cb6 100644 --- a/test/test_cases.jl +++ b/test/test_cases.jl @@ -66,5 +66,5 @@ test_trans_dy = parse_file("../test/data/en_validation_case_data/test_trans_dy.d dist_transformer = parse_file("../test/data/opendss/dist_transformer.dss") # IEEE13 Feeder -IEEE13_Feeder_engr = parse_file("../test/data/opendss/ieee13_feeder.dss", multinetwork=true, - time_series="daily", transformations=[remove_line_limits!, remove_transformer_limits!]) \ No newline at end of file +IEEE13_Feeder_engr = parse_file("../test/data/opendss/ieee13_feeder.dss", multinetwork=true, + time_series="daily", transformations=[remove_line_limits!, remove_transformer_limits!])