diff --git a/Project.toml b/Project.toml index 278cb445f..47e4fdbe0 100644 --- a/Project.toml +++ b/Project.toml @@ -20,6 +20,7 @@ PolyhedralRelaxations = "2e741578-48fa-11ea-2d62-b52c946f73a0" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] CSV = "0.8.5, 0.9, 0.10" @@ -34,6 +35,7 @@ LoggingExtras = "0.4.7, 1" PolyhedralRelaxations = "0.3.5" SCS = "0.9, 1.0, 1.1" SpecialFunctions = "2" +UUIDs = "1.11.0" julia = "1.6" [extras] diff --git a/src/PowerModelsDistribution.jl b/src/PowerModelsDistribution.jl index 0a8443a3a..97612bb3e 100644 --- a/src/PowerModelsDistribution.jl +++ b/src/PowerModelsDistribution.jl @@ -24,6 +24,7 @@ module PowerModelsDistribution import LinearAlgebra import Statistics import SparseArrays + import UUIDs import LinearAlgebra: diagm, factorize import Statistics: mean, std @@ -69,8 +70,10 @@ module PowerModelsDistribution include("data_model/transformations/dss2eng.jl") include("data_model/transformations/eng2math.jl") include("data_model/transformations/math2eng.jl") + include("data_model/transformations/math2ravens.jl") include("data_model/transformations/utils.jl") include("data_model/transformations/reduce.jl") + include("data_model/transformations/ravens2math.jl") include("core/data.jl") include("core/ref.jl") @@ -113,6 +116,7 @@ module PowerModelsDistribution include("io/common.jl") include("data_model/utils.jl") + include("data_model/utils_ravens.jl") include("data_model/checks.jl") include("data_model/components.jl") include("data_model/multinetwork.jl") diff --git a/src/data_model/transformations/dss2eng.jl b/src/data_model/transformations/dss2eng.jl index 59f4b2d96..ea2b29376 100644 --- a/src/data_model/transformations/dss2eng.jl +++ b/src/data_model/transformations/dss2eng.jl @@ -410,6 +410,24 @@ function _dss2eng_linecode!(data_eng::Dict{String,<:Any}, data_dss::OpenDssDataM _import_all!(eng_obj, dss_obj) end + # kron reduction on linecode only if kron key is found + reduce = get(dss_obj, "kron", false) + if reduce == true + nphases = nphases - 1 + Z = eng_obj["rs"] + im*eng_obj["xs"] + Y = (eng_obj["g_fr"].* 2.0) + (im*eng_obj["b_fr"] .* 2.0) + z, y = _kron(Z, Y, nphases) + rs, xs = real(z), imag(z) + g, b = real(y), imag(y) + eng_obj["rs"] = rs + eng_obj["xs"] = xs + eng_obj["b_fr"] = b ./ 2.0 + eng_obj["b_to"] = b ./ 2.0 + eng_obj["g_fr"] = g ./ 2.0 + eng_obj["g_to"] = g ./ 2.0 + eng_obj["cm_ub"] = fill(dss_obj["emergamps"], nphases) + end + _add_eng_obj!(data_eng, "linecode", id, eng_obj) end end diff --git a/src/data_model/transformations/eng2math.jl b/src/data_model/transformations/eng2math.jl index f82208778..60e75bf2e 100644 --- a/src/data_model/transformations/eng2math.jl +++ b/src/data_model/transformations/eng2math.jl @@ -487,6 +487,7 @@ function _map_eng2math_transformer!(data_math::Dict{String,<:Any}, data_eng::Dic # 2-WINDING TRANSFORMER # make virtual bus and mark it for reduction tm_nom = eng_obj["configuration"][w]==DELTA ? eng_obj["vm_nom"][w]*sqrt(3) : eng_obj["vm_nom"][w] + transformer_2wa_obj = Dict{String,Any}( "name" => "_virtual_transformer.$name.$w", "source_id" => "_virtual_transformer.$(eng_obj["source_id"]).$w", diff --git a/src/data_model/transformations/math2ravens.jl b/src/data_model/transformations/math2ravens.jl new file mode 100644 index 000000000..a1e5c5fb5 --- /dev/null +++ b/src/data_model/transformations/math2ravens.jl @@ -0,0 +1,436 @@ + +function _make_curve_data(nws, data_math, path_func) + curve_data = [Dict( + "ArCurveData.xvalue" => parse(Float64, nw) * data_math["nw"][nw]["time_elapsed"], + "ArCurveData.DataValues" => path_func(nw) + ) for nw in nws] + + return Dict("AnalysisResultCurve.xUnit" => "UnitSymbol.h", "AnalysisResultCurve.CurveDatas" => curve_data) +end + +function _get_phases(terminals, phase_mapping) + return [phase_mapping[x] for x in terminals] +end + +function _push_result!(container::Dict, key::String, data::Dict) + push!(container["AnalysisResult"]["OptimalPowerFlow"][key], data) +end + +function _build_voltage_entry(phase, conn_node, data) + entry = Dict( + "AnalysisResultData.phase" => phase, + "ArVoltage.ConnectivityNode" => "ConnectivityNode::'$(conn_node)'", + ) + merged_entry = merge(entry, data) + return merged_entry +end + +function _build_powerflow_entry(phase, eq_type, eq_name, data) + entry = Dict( + "AnalysisResultData.phase" => phase, + "ArPowerFlow.ConductingEquipment" => "$(eq_type)::'$(eq_name)'", + ) + merged_entry = merge(entry, data) + return merged_entry +end + +function _build_status_entry(eq_type, eq_name, data) + entry = Dict( + "ArStatus.ConductingEquipment" => "$(eq_type)::'$(eq_name)'", + ) + merged_entry = merge(entry, data) + return merged_entry +end + +function _build_switch_entry(eq_type, eq_name, data) + entry = Dict( + "ArSwitch.Switch" => "$(eq_type)::'$(eq_name)'", + ) + merged_entry = merge(entry, data) + return merged_entry +end + + +# -------- FIX States solution from Gurobi ---- Some "state" values for switches are -1.0287133995719573e-10 +function _zero_tiny(x; tol=1e-4) + return abs(x) < tol ? 0.0 : x +end + +function _round_almost_integer(x; tol=1e-4) + # Get the nearest integer to x. + r = round(Int, x) + + # Check if the absolute difference between x and the nearest integer is within the tolerance. + # If so, return the integer. Otherwise, return the original floating-point number. + return abs(x - r) < tol ? r : x +end + +function _fix_noninteger_states!(solution_math; mn_flag::Bool=false) + if mn_flag + for (nw_id, nw_data) in solution_math["nw"] + for (sw_id, sw_sol) in nw_data["switch"] + sw_sol["state"] = _zero_tiny(sw_sol["state"]) + sw_sol["state"] = _round_almost_integer(sw_sol["state"]) + end + end + else + for (sw_id, sw_sol) in solution_math["switch"] + sw_sol["state"] = _zero_tiny(sw_sol["state"]) + sw_sol["state"] = _round_almost_integer(sw_sol["state"]) + end + end +end + +################################# + + +function transform_solution_ravens( + solution_math::Dict{String,<:Any}, + data_math::Dict{String,<:Any}; + map::Union{Vector{<:Dict{String,<:Any}},Missing}=missing, + make_si::Bool=true, + convert_rad2deg::Bool=true, + map_math2eng_extensions::Dict{String,<:Function}=Dict{String,Function}(), + make_si_extensions::Vector{<:Function}=Function[], + dimensionalize_math_extensions::Dict{String,<:Dict{String,<:Vector{<:String}}}=Dict{String,Dict{String,Vector{String}}}(), + fix_switch_states::Bool=false +)::Dict{String,Any} + + @assert ismath(data_math) "cannot be converted. Not a MATH model." + + # convert solution to si + solution_math = solution_make_si( + solution_math, + data_math; + mult_vbase=make_si, + mult_sbase=make_si, + convert_rad2deg=convert_rad2deg, + make_si_extensions=make_si_extensions, + dimensionalize_math_extensions=dimensionalize_math_extensions + ) + + mn_flag = ismultinetwork(data_math) + nws = mn_flag ? sort(collect(keys(solution_math["nw"])), by = x -> parse(Int, x)) : [] + nw_data = mn_flag ? data_math["nw"]["1"] : data_math + sol = mn_flag ? solution_math["nw"]["1"] : solution_math + time_elapsed = get(data_math, "time_elapsed", 1.0) + + # Fix Switch states - "state" values for switches are -1.0287133995719573e-10 coming from some solvers + if fix_switch_states + _fix_noninteger_states!(solution_math; mn_flag=mn_flag) + end + + # PowerFlow solutions for Transformers elements + seen_xfrmrs = Set{String}() # Set to save xfrmr names + + # Phase mapping + phase_mapping = Dict(1 => "SinglePhaseKind.A", 2 => "SinglePhaseKind.B", 3 => "SinglePhaseKind.C") + + solution_ravens = Dict( + "AnalysisResult" => Dict( + "OptimalPowerFlow" => Dict( + "Ravens.cimObjectType" => "OperationsResult", + "IdentifiedObject.name" => "OptimalPowerFlow", + "IdentifiedObject.mRID" => "#_$(uppercase(string(UUIDs.uuid4())))", + "OperationsResult.Voltages" => [], + "OperationsResult.PowerFlows" => [], + "OperationsResult.Statuses" => [], + "OperationsResult.Switches" => [] + ) + ) + ) + + # --- Voltages --- + for (bus_id, bus_data) in sol["bus"] + terminals = nw_data["bus"][bus_id]["terminals"] + phases = _get_phases(terminals, phase_mapping) + conn_node = split(nw_data["bus"][bus_id]["source_id"], '.')[2] + + # Filter virtual buses that exist in the MATH model + if !occursin("virtual", nw_data["bus"][bus_id]["name"]) + for (i, phase) in enumerate(phases) + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + nw_bus = solution_math["nw"][nw]["bus"][bus_id] + v_info = Dict( + "AvVoltage.v" => nw_bus["vm"][i] * solution_math["nw"][nw]["settings"]["voltage_scale_factor"], + "Ravens.cimObjectType" => "AvVoltage" + ) + # Conditionally add the angle (some do not have it) + if haskey(nw_bus, "va") + v_info["AvVoltage.angle"] = nw_bus["va"][i] + end + return v_info + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict( + "AvVoltage.v" => bus_data["vm"][i] * solution_math["settings"]["voltage_scale_factor"], + "AvVoltage.angle" => bus_data["va"][i], + "Ravens.cimObjectType" => "AvVoltage" + ) + ) + end + _push_result!(solution_ravens, "OperationsResult.Voltages", _build_voltage_entry(phase, conn_node, data)) + end + end + end + + + # --- Transformers --- + for (tr_id, tr_data) in get(sol, "transformer", Dict{Any,Dict{String,Any}}()) + # Get xfrmr data + terminals = nw_data["transformer"][tr_id]["f_connections"] + phases = _get_phases(terminals, phase_mapping) + source_id_vect = split(nw_data["transformer"][tr_id]["source_id"], '.') + cond_eq_type = source_id_vect[2] + cond_eq_name = source_id_vect[3] + end_n = parse(Int, source_id_vect[4]) + + # PowerFlow + for (i, phase) in enumerate(phases) + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + nw_tr = solution_math["nw"][nw]["transformer"][tr_id] + Dict( + "AvPowerFlow.p" => nw_tr["pf"][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "AvPowerFlow.q" => nw_tr["qf"][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "AvPowerFlow.endNumber" => end_n, + "Ravens.cimObjectType" => "AvPowerFlow" + ) + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict( + "AvPowerFlow.p" => tr_data["pf"][i]*solution_math["settings"]["power_scale_factor"], + "AvPowerFlow.q" => tr_data["qf"][i]*solution_math["settings"]["power_scale_factor"], + "AvPowerFlow.endNumber" => end_n, + "Ravens.cimObjectType" => "AvPowerFlow" + ) + ) + end + _push_result!(solution_ravens, "OperationsResult.PowerFlows", _build_powerflow_entry(phase, cond_eq_type, cond_eq_name, data)) + end + + # Status + if !(cond_eq_name in seen_xfrmrs) + # Original status from data_math + tr_status = nw_data["transformer"][tr_id]["status"] == 1 ? true : false + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math,nw -> + begin + if haskey(solution_math["nw"][nw]["transformer"][tr_id], "status") + tr_status = Int(solution_math["nw"][nw]["transformer"][tr_id]["status"]) == 1 ? true : false + else + # deduce the element status based on status of f_bus - t_bus + f_bus_id = nw_data["transformer"][tr_id]["f_bus"] # index for f_bus of edge element + t_bus_id = nw_data["transformer"][tr_id]["t_bus"] # index for t_bus of edge element + f_bus_status = Int(solution_math["nw"][nw]["bus"]["$(f_bus_id)"]["status"]) + t_bus_status = Int(solution_math["nw"][nw]["bus"]["$(t_bus_id)"]["status"]) + if (f_bus_status == 0 || t_bus_status == 0) + tr_status = false + else + tr_status = true + end + end + Dict("AvStatus.inService" => tr_status) + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict("AvStatus.inService" => tr_status)) + end + _push_result!(solution_ravens, "OperationsResult.Statuses", _build_status_entry(cond_eq_type, cond_eq_name, data)) + end + # Store the xfrmr name + push!(seen_xfrmrs, "$(cond_eq_name)") + end + + # --- Edge elements (branches, switches, etc.) --- + edge_elements = ["branch", "switch"] + for ed in edge_elements + for (ed_id, ed_data) in get(sol, ed, Dict{Any,Dict{String,Any}}()) + # Filter virtual elements that exist in the MATH model + if !occursin("virtual", nw_data[ed][ed_id]["name"]) + cond_eq_type = split(nw_data[ed][ed_id]["source_id"], '.')[1] + cond_eq_name = split(nw_data[ed][ed_id]["source_id"], '.')[2] + # ---- EXCLUSIVE state for Switches ---- + if ed == "switch" + # initial state from math network data + sw_state = nw_data[ed][ed_id]["state"] == 1 ? false : true + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + nw_ed = solution_math["nw"][nw][ed][ed_id] + if haskey(nw_ed, "state") + sw_state = Int(nw_ed["state"]) == 0 ? true : false + end + Dict("AvSwitch.open" => sw_state) + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict("AvSwitch.open" => sw_state)) + end + _push_result!(solution_ravens, "OperationsResult.Switches", _build_switch_entry(cond_eq_type, cond_eq_name, data)) + end + + # --- PowerFlow --- + num_ends = 1 # TODO: (Optional) Change to 2 if you would like to get both 'to' and 'from' flows for edge elements + for end_n in num_ends + # information related to direction flow, terminals, and phases + conn_flow, p_flow, q_flow = end_n == 1 ? ("f_connections", "pf", "qf") : ("t_connections", "pt", "qt") + terminals = nw_data[ed][ed_id][conn_flow] + phases = _get_phases(terminals, phase_mapping) + for (i, phase) in enumerate(phases) + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + nw_ed = solution_math["nw"][nw][ed][ed_id] + Dict( + "AvPowerFlow.p" => nw_ed[p_flow][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "AvPowerFlow.q" => nw_ed[q_flow][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "AvPowerFlow.endNumber" => end_n, + "Ravens.cimObjectType" => "AvPowerFlow" + ) + end + ) + ) + else + data = Dict( + "AnalysisResultData.DataValues" => Dict( + "AvPowerFlow.p" => ed_data[p_flow][i]*solution_math["settings"]["power_scale_factor"], + "AvPowerFlow.q" => ed_data[q_flow][i]*solution_math["settings"]["power_scale_factor"], + "AvPowerFlow.endNumber" => end_n, + "Ravens.cimObjectType" => "AvPowerFlow" + ) + ) + end + _push_result!(solution_ravens, "OperationsResult.PowerFlows", _build_powerflow_entry(phase, cond_eq_type, cond_eq_name, data)) + end + end + + # --- Statuses ---- + obj_prfx = "" + if ed == "branch" + obj_prfx = "br_" + end + + ed_status = nw_data[ed][ed_id]["$(obj_prfx)status"] == 1 ? true : false + + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + if haskey(solution_math["nw"][nw][ed][ed_id], "status") + ed_status = Int(solution_math["nw"][nw][ed][ed_id]["status"]) == 1 ? true : false + else + # deduce the element status based on status of t_bus + f_bus_id = nw_data[ed][ed_id]["f_bus"] # index for f_bus of edge element + t_bus_id = nw_data[ed][ed_id]["t_bus"] # index for t_bus of edge element + f_bus_status = Int(solution_math["nw"][nw]["bus"]["$(f_bus_id)"]["status"]) + t_bus_status = Int(solution_math["nw"][nw]["bus"]["$(t_bus_id)"]["status"]) + if (f_bus_status == 0 || t_bus_status == 0) + ed_status = false + else + ed_status = true + end + end + Dict("AvStatus.inService" => ed_status) + end + ) + ) + + else + data = Dict("AnalysisResultData.DataValues" => Dict("AvStatus.inService" => ed_status)) + end + _push_result!(solution_ravens, "OperationsResult.Statuses", _build_status_entry(cond_eq_type, cond_eq_name, data)) + + end + end + end + + # --- Node elements (gens, loads, storage) --- + node_elements = ["load", "gen", "storage"] + for nd in node_elements + for (nd_id, nd_data) in get(sol, nd, Dict{Any,Dict{String,Any}}()) + # Filter virtual elements that exist in the MATH model + if !occursin("virtual", nw_data[nd][nd_id]["name"]) + cond_eq_type = split(nw_data[nd][nd_id]["source_id"], '.')[1] + cond_eq_name = split(nw_data[nd][nd_id]["source_id"], '.')[2] + terminals = nw_data[nd][nd_id]["connections"] + phases = _get_phases(terminals, phase_mapping) + + if nd == "load" + p_key = "pd" + q_key = "qd" + elseif nd == "gen" + p_key = "pg" + q_key = "qg" + elseif nd == "storage" + p_key = "ps" + q_key = "qs" + else + p_key = "p" + q_key = "q" + end + + # PowerFlow + for (i, phase) in enumerate(phases) + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + nw_nd = solution_math["nw"][nw][nd][nd_id] + Dict( + "AvPowerFlow.p" => nw_nd[p_key][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "AvPowerFlow.q" => nw_nd[q_key][i]*solution_math["nw"][nw]["settings"]["power_scale_factor"], + "Ravens.cimObjectType" => "AvPowerFlow" + ) + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict( + "AvPowerFlow.p" => nd_data[p_key][i]*solution_math["settings"]["power_scale_factor"], + "AvPowerFlow.q" => nd_data[q_key][i]*solution_math["settings"]["power_scale_factor"], + "Ravens.cimObjectType" => "AvPowerFlow" + ) + ) + end + _push_result!(solution_ravens, "OperationsResult.PowerFlows", _build_powerflow_entry(phase, cond_eq_type, cond_eq_name, data)) + end + + # --- Statuses ---- + obj_prfx = "" + if nd == "gen" + obj_prfx = "gen_" + end + + nd_status = nw_data[nd][nd_id]["$(obj_prfx)status"] == 1 ? true : false + if mn_flag + data = Dict("AnalysisResultData.Curve" => _make_curve_data(nws, data_math, nw -> + begin + if haskey(solution_math["nw"][nw][nd][nd_id], "status") + nd_status = Int(solution_math["nw"][nw][nd][nd_id]["status"]) == 1 ? true : false + end + Dict("AvStatus.inService" => nd_status) + end + ) + ) + else + data = Dict("AnalysisResultData.DataValues" => Dict("AvStatus.inService" => nd_status)) + end + _push_result!(solution_ravens, "OperationsResult.Statuses", _build_status_entry(cond_eq_type, cond_eq_name, data)) + end + end + end + + return solution_ravens + +end + + + diff --git a/src/data_model/transformations/ravens2math.jl b/src/data_model/transformations/ravens2math.jl new file mode 100644 index 000000000..97270e4ff --- /dev/null +++ b/src/data_model/transformations/ravens2math.jl @@ -0,0 +1,2110 @@ +"cim-ravens to math object mapping" +const _math_to_ravens = Dict{String,String}( + "bus" => "connectivity_node", + "transformer" => "power_transformer", + "switch" => "switch", + "shunt" => "shunt_compensator", + "load" => "energy_consumer", + "generator" => "rotating_machine", + "solar" => "photovoltaic_unit", + "storage" => "battery_unit", + "voltage_source" => "energy_source", +) + + +"list of nodal type elements in the ravens model" +const _ravens_node_elements = String[ + "energy_consumer", "shunt_compensator", "rotating_machine", "power_electronics", "energy_source" +] + +"list of edge type elements in the ravens model" +const _ravens_edge_elements = String[ + "conductor", "switch", "power_transformer" +] + +"list of all ravens asset types" +const pmd_ravens_asset_types = String[ + "connectivity_node", _ravens_edge_elements..., _ravens_node_elements... +] + + +function transform_data_model_ravens( + data::Dict{String,<:Any}; + kron_reduce::Bool=true, + phase_project::Bool=false, + multinetwork::Bool=false, + global_keys::Set{String}=Set{String}(), + ravens2math_passthrough::Dict{String,<:Vector{<:String}}=Dict{String,Vector{String}}(), + ravens2math_extensions::Vector{<:Function}=Function[], + make_pu::Bool=true, + make_pu_extensions::Vector{<:Function}=Function[], + correct_network_data::Bool=true, + )::Dict{String,Any} + + data_math = _map_ravens2math( + data; + multinetwork=multinetwork, + kron_reduce=kron_reduce, + phase_project=phase_project, + ravens2math_extensions=ravens2math_extensions, + ravens2math_passthrough=ravens2math_passthrough, + global_keys=global_keys, + ) + + correct_network_data && correct_network_data!(data_math; make_pu=make_pu, make_pu_extensions=make_pu_extensions) + + return data_math + +end + + +"base function for converting ravens model to mathematical model" +function _map_ravens2math( + data_ravens::Dict{String,<:Any}; + multinetwork::Bool=false, + kron_reduce::Bool=true, + phase_project::Bool=false, + ravens2math_extensions::Vector{<:Function}=Function[], + ravens2math_passthrough::Dict{String,Vector{String}}=Dict{String,Vector{String}}(), + global_keys::Set{String}=Set{String}(), + )::Dict{String,Any} + + _data_ravens = deepcopy(data_ravens) + + add_base_voltages!(_data_ravens; overwrite=false) + + # TODO: Add settings (defaults) + basemva = 1 + _settings = Dict("sbase_default" => basemva * 1e3, + "voltage_scale_factor" => 1e3, + "power_scale_factor" => 1e3, + "base_frequency" => get(_data_ravens, "BaseFrequency", 60.0), + "vbases_default" => Dict{String,Real}(), + ) + + # Multinetwork + if multinetwork + data_math = Dict{String,Any}( + "name" => get(_data_ravens, "name", ""), + "data_model" => MATHEMATICAL, + "multinetwork" => multinetwork, + "nw" => Dict{String,Any}() + ) + + if haskey(data_ravens, "BasicIntervalSchedule") + schdls = get(data_ravens, "BasicIntervalSchedule", Dict{String,Any}()) # Get schedules/timeseries + + # Check for shortest timeseries. Use that length for mn + min_length = Inf + for (name, ravens_obj) in schdls + if haskey(ravens_obj, "EnergyConsumerSchedule.RegularTimePoints") + points = ravens_obj["EnergyConsumerSchedule.RegularTimePoints"] + length_points = length(points) + + if length_points < min_length + min_length = length_points + end + end + end + + # Throw error if no schedule/timeseries is found. + if min_length == Inf + throw("Minimum length is equal to Inf. Cannot do multinetwork with Inf timepoints.") + end + + # Vector to store nws dictionaries + nws_vect = Vector{Dict{String,Any}}(undef, min_length) + + # Multithreaded loop to create each nw dictionary. Store them in vector (to allow multithreading) + Threads.@threads for n=1:1:min_length + nw_dict = Dict{String,Any}( + string(n) => Dict{String,Any}( + "per_unit" => get(_data_ravens, "per_unit", false), + "is_projected" => get(_data_ravens, "is_projected", false), + "is_kron_reduced" => get(_data_ravens, "is_kron_reduced", true), # TODO: Kron reduction? + "settings" => deepcopy(_settings), + "time_elapsed" => get(_data_ravens, "time_elapsed", 1.0), + ) + ) + + # Store nw dict in vector + nws_vect[n] = nw_dict + + # Perform conversion ravens2math + apply_pmd!(_map_ravens2math_nw!, nws_vect[n], _data_ravens; ravens2math_passthrough=ravens2math_passthrough, ravens2math_extensions=ravens2math_extensions, nw=n) + + end + + # Merge dict in vector into data_math dictionary (other for loop to allow multithreading) + for nw_dict in nws_vect + merge!(data_math["nw"], nw_dict) + end + + else + @error("No timeseries and/or multinetwork information detected.") + end + + else # No multinetwork + data_math = Dict{String,Any}( + "name" => get(_data_ravens, "name", ""), + "per_unit" => get(_data_ravens, "per_unit", false), + "data_model" => MATHEMATICAL, + "is_projected" => get(_data_ravens, "is_projected", false), + "is_kron_reduced" => get(_data_ravens, "is_kron_reduced", true), # TODO: Kron reduction? + "settings" => deepcopy(_settings), + "time_elapsed" => get(_data_ravens, "time_elapsed", 1.0), + ) + apply_pmd!(_map_ravens2math_nw!, data_math, _data_ravens; ravens2math_passthrough=ravens2math_passthrough, ravens2math_extensions=ravens2math_extensions) + end + + # multinetwork collections + if multinetwork + _collect_nw_maps!(data_math) + _collect_nw_bus_lookups!(data_math) + end + + return data_math +end + + +""" +""" +function _map_ravens2math_nw!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; ravens2math_passthrough::Dict{String,Vector{String}}=Dict{String,Vector{String}}(), ravens2math_extensions::Vector{<:Function}=Function[], nw::Int=nw_id_default) + + if nw==0 + + data_math["map"] = Vector{Dict{String,Any}}([ + Dict{String,Any}("unmap_function" => "_map_math2eng_root!") + ]) + + _init_base_components!(data_math) + + for property in get(ravens2math_passthrough, "root", String[]) + if haskey(data_ravens, property) + data_math[property] = deepcopy(data_ravens[property]) + end + end + + for type in pmd_ravens_asset_types + getfield(PowerModelsDistribution, Symbol("_map_ravens2math_$(type)!"))(data_math, data_ravens; pass_props=get(ravens2math_passthrough, type, String[])) + end + + # Custom ravens2math transformation functions + for ravens2math_func! in ravens2math_extensions + ravens2math_func!(data_math, data_ravens) + end + + find_conductor_ids!(data_math) + _map_conductor_ids!(data_math) + _map_settings_vbases_default!(data_math) + + else + + data_math[string(nw)]["map"] = Vector{Dict{String,Any}}([ + Dict{String,Any}("unmap_function" => "_map_math2eng_root!") + ]) + + _init_base_components!(data_math[string(nw)]) + + for property in get(ravens2math_passthrough, "root", String[]) + if haskey(data_ravens, property) + data_math[property] = deepcopy(data_ravens[property]) + end + end + + for type in pmd_ravens_asset_types + getfield(PowerModelsDistribution, Symbol("_map_ravens2math_$(type)!"))(data_math[string(nw)], data_ravens; pass_props=get(ravens2math_passthrough, type, String[]), nw=nw) + end + + # Custom ravens2math transformation functions + for ravens2math_func! in ravens2math_extensions + ravens2math_func!(data_math[string(nw)], data_ravens) + end + + find_conductor_ids!(data_math[string(nw)]) + _map_conductor_ids!(data_math[string(nw)]) + _map_settings_vbases_default!(data_math[string(nw)]) + + end + +end + + +""" +Converts ravens connectivity_node components into mathematical bus components. +""" +function _map_ravens2math_connectivity_node!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + voltage_scale_factor_sqrt3 = data_math["settings"]["voltage_scale_factor"] * sqrt(3) + connectivity_nodes = get(data_ravens, "ConnectivityNode", Dict{String,Any}()) + + for (name, ravens_obj) in connectivity_nodes + index = length(data_math["bus"]) + 1 + math_obj = _init_math_obj_ravens("ConnectivityNode", name, ravens_obj, index; pass_props=pass_props) + + # Set basic bus properties + math_obj["bus_i"] = index + math_obj["source_id"] = "ConnectivityNode.$name" + math_obj["bus_type"] = 4 # Default bus_type, - DISABLED + math_obj["vm_pair_lb"] = Tuple{Any, Any, Real}[] + math_obj["vm_pair_ub"] = Tuple{Any, Any, Real}[] + + # Set voltage magnitude and angle + if haskey(ravens_obj, "SvVoltage.v") + math_obj["vm"] = (ravens_obj["SvVoltage.v"] / voltage_scale_factor_sqrt3) + end + + if haskey(ravens_obj, "SvVoltage.angle") + math_obj["va"] = ravens_obj["SvVoltage.angle"] + end + + # Store the mathematical bus object + data_math["bus"]["$(index)"] = math_obj + + # Update bus lookup if necessary + data_math["bus_lookup"] = get(data_math, "bus_lookup", Dict{Any,Int}()) + data_math["bus_lookup"][name] = index + + # Map the ravens object to the math object + push!(data_math["map"], Dict( + "from" => name, + "to" => "bus.$index", + "unmap_function" => "_map_math2eng_bus!" + )) + end +end + + +""" +Converts ravens conductors (e.g., ACLineSegments) into mathematical branches. +""" +function _map_ravens2math_conductor!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + + if haskey(data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"], "Conductor") + conductors = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["Conductor"] + + for (name, ravens_obj) in get(conductors, "ACLineSegment", Dict{Any,Dict{String,Any}}()) + math_obj = _init_math_obj_ravens("ACLineSegment", name, ravens_obj, length(data_math["branch"]) + 1; pass_props=pass_props) + nconds = length(ravens_obj["ACLineSegment.ACLineSegmentPhase"]) # number of conductors/wires + nphases = 0 # init number of phases + terminals = ravens_obj["ConductingEquipment.Terminals"] + + f_node = _extract_name(terminals[1]["Terminal.ConnectivityNode"]) + t_node = _extract_name(terminals[2]["Terminal.ConnectivityNode"]) + + math_obj["f_bus"] = data_math["bus_lookup"][f_node] + math_obj["t_bus"] = data_math["bus_lookup"][t_node] + + bus_terminals = nconds >= 4 ? collect(1:nconds) : [_phase_map[phase["ACLineSegmentPhase.phase"]] for phase in ravens_obj["ACLineSegment.ACLineSegmentPhase"]] + + # TODO: Kron reduce bus terminals by removing conn 4 + reduce = false # flag for Kron reduction + if 4 in bus_terminals + reduce = true + bus_terminals = filter!(x -> x != 4, bus_terminals) + nphases = nconds - 1 + else + nphases = nconds + end + + # Add vmin/vmax/terminals info to fbus and tbus if missing + for bus in [math_obj["f_bus"], math_obj["t_bus"]] + bus_data = data_math["bus"][string(bus)] + if !(haskey(bus_data, "terminals")) || (length(bus_data["terminals"]) < length(bus_terminals)) + bus_data["terminals"] = bus_terminals + bus_data["vmin"] = fill(0.0, nphases) + bus_data["vmax"] = fill(Inf, nphases) + bus_data["grounded"] = zeros(Bool, nphases) + end + end + + math_obj["f_connections"] = bus_terminals + math_obj["t_connections"] = bus_terminals + + # System frequency + base_freq = data_math["settings"]["base_frequency"] + + if (haskey(ravens_obj, "ACLineSegment.PerLengthImpedance")) + + impedance_name = _extract_name(ravens_obj["ACLineSegment.PerLengthImpedance"]) + impedance_data = data_ravens["PerLengthLineParameter"]["PerLengthImpedance"]["PerLengthPhaseImpedance"][impedance_name] + + math_obj["br_r"] = _impedance_conversion_ravens(impedance_data, ravens_obj, "PhaseImpedanceData.r") + math_obj["br_x"] = _impedance_conversion_ravens(impedance_data, ravens_obj, "PhaseImpedanceData.x") + + for (key, param) in [("b_fr", "PhaseImpedanceData.b"), ("b_to", "PhaseImpedanceData.b"), ("g_fr", "PhaseImpedanceData.g"), ("g_to", "PhaseImpedanceData.g")] + math_obj[key] = _admittance_conversion_ravens(impedance_data, ravens_obj, param) + end + + elseif (haskey(ravens_obj, "ACLineSegment.WireSpacingInfo")) + + # Get WireSpacingInfo + spacinginfo_name = _extract_name(ravens_obj["ACLineSegment.WireSpacingInfo"]) + spacinginfo_data = data_ravens["AssetInfo"]["WireSpacingInfo"][spacinginfo_name] + wire_positions = spacinginfo_data["WireSpacingInfo.WirePositions"] + num_of_wires = length(wire_positions) + + # TODO: Kron reduce bus terminals by removing conn 4 based on number of wires + if num_of_wires > nconds + reduce = true + end + + # Coordinates + x_coords = Vector{Float64}(undef, num_of_wires) + y_coords = Vector{Float64}(undef, num_of_wires) + + for i in 1:1:num_of_wires + seq_num = get(wire_positions[i], "WirePosition.sequenceNumber", i) + x_coords[seq_num] = get(wire_positions[i], "WirePosition.xCoord", 0.0) + y_coords[seq_num] = get(wire_positions[i], "WirePosition.yCoord", 0.0) + end + + # angular frequency + ω = 2π * base_freq + ω₀ = 2π * base_freq + + # Get data for each specific ACLineSegmentPhase + segmentphase_data = ravens_obj["ACLineSegment.ACLineSegmentPhase"] + + # Wire Info. + gmr = Vector{Float64}(undef, nconds) # gmr of Wire, default: radius of wire * 0.7788 + radius = Vector{Float64}(undef, nconds) # radius of Wire + rac = Vector{Float64}(undef, nconds) # AC resistance + rdc = Vector{Float64}(undef, nconds) # DC resistance, default: AC resistance / 1.02 + dcable = Vector{Float64}(undef, nconds) # diameter of Wire: radius of wire * 2 + + # Concentric Neutrals Info. + rstrand = Vector{Float64}(undef, nconds) # resistance of CN cable + nstrand = Vector{Float64}(undef, nconds) # number of CN conductors + dstrand = Vector{Float64}(undef, nconds) # diameter of CN conductor + gmrstrand = Vector{Float64}(undef, nconds) # gmr of CN conductor, default: radius of CN * 0.7788 + + # insulation info. + dins = Vector{Float64}(undef, nconds) # diameter over insulation (over jacket) + tins = Vector{Float64}(undef, nconds) # thickness of insulation + + # tape shield info. + diashield = Vector{Float64}(undef, nconds) + tapelayer = Vector{Float64}(undef, nconds) + tapelap = Vector{Float64}(undef, nconds) + + for i in 1:1:nconds + + wireinfo_name = _extract_name(segmentphase_data[i]["PowerSystemResource.AssetDatasheet"]) + wireinfo_data = data_ravens["AssetInfo"]["WireInfo"][wireinfo_name] + + radius[i] = get(wireinfo_data, "WireInfo.radius", NaN) + @assert radius[i] != NaN "WireInfo radius not found! using NaN. Revise data." + + # Note: gets rewritten as missing if not needed + dcable[i] = get(wireinfo_data, "ConcentricNeutralCableInfo.diameterOverNeutral", radius[i] * 2.0) + + gmr[i] = get(wireinfo_data, "WireInfo.gmr", radius[i] * 0.778) + + if wireinfo_data["Ravens.cimObjectType"] == "OverheadWireInfo" + rac[i] = get(wireinfo_data, "WireInfo.rAC25", NaN) + @assert rac[i] != NaN "WireInfo AC25 resistance is not found! using NaN. Revise input data." + rdc[i] = rac[i] / 1.02 + elseif wireinfo_data["Ravens.cimObjectType"] == "ConcentricNeutralCableInfo" + rdc[i] = get(wireinfo_data, "WireInfo.rDC20", NaN) + @assert rdc[i] != NaN "WireInfo rDC20 resistance is not found! using NaN. Revise input data." + rac[i] = rdc[i] * 1.02 + elseif wireinfo_data["Ravens.cimObjectType"] == "TapeShieldCableInfo" + rdc[i] = get(wireinfo_data, "WireInfo.rDC20", NaN) + @assert rdc[i] != NaN "WireInfo rDC20 resistance is not found! using NaN. Revise input data." + rac[i] = rdc[i] * 1.02 + else + @error("Cable type not supported. Resistances (AC or DC) not found!") + end + + # Concentric Neutrals Information. + rstrand[i] = get(wireinfo_data, "ConcentricNeutralCableInfo.neutralStrandRDC20", NaN) + nstrand[i] = get(wireinfo_data, "ConcentricNeutralCableInfo.neutralStrandCount", NaN) + dstrand[i] = get(wireinfo_data, "ConcentricNeutralCableInfo.neutralStrandRadius", NaN) * 2.0 + gmrstrand[i] = get(wireinfo_data, "ConcentricNeutralCableInfo.neutralStrandGmr", (dstrand[i]/2.0) * 0.778) + + # insulation information + dins[i] = get(wireinfo_data, "CableInfo.diameterOverJacket", NaN) + tins[i] = get(wireinfo_data, "WireInfo.insulationThickness", NaN) + + # Tape shielded cables information + diashield[i] = get(wireinfo_data, "CableInfo.diameterOverJacket", NaN) # diameter over tape shield + tapelayer[i] = get(wireinfo_data, "TapeShieldCableInfo.tapeThickness", NaN) # tape shield thickness + tapelap[i] = get(wireinfo_data, "TapeShieldCableInfo.tapeLap", NaN) #tape lap (default 20.0) + + end + + # Check for NaNs and replace with missing. + rstrand = findfirst(isnan, rstrand) !== nothing ? missing : rstrand + nstrand = findfirst(isnan, nstrand) !== nothing ? missing : nstrand + dcable = findfirst(isnan, dstrand) !== nothing ? missing : dcable # use dstrand as signal for dcable to be missing + dstrand = findfirst(isnan, dstrand) !== nothing ? missing : dstrand + gmrstrand = findfirst(isnan, gmrstrand) !== nothing ? missing : gmrstrand + epsr = findfirst(isnan, dins) !== nothing ? missing : ones(nconds).*2.3 # use dins as signal for epsr to be missing + dins = findfirst(isnan, dins) !== nothing ? missing : dins + tins = findfirst(isnan, tins) !== nothing ? missing : tins + diashield = findfirst(isnan, tapelayer) !== nothing ? missing : diashield + tapelayer = findfirst(isnan, tapelayer) !== nothing ? missing : tapelayer # use tapelayer as signal for diashield to be missing + tapelap = findfirst(isnan, tapelap) !== nothing ? missing : tapelap + + # TODO: earth model (using default) + earth_model = "deri" + + # rho (default) - ρ = earth resistivity = 100 Ω-m + rho = 100 + + # Calculate line constants + z, y = calculate_line_constants( + x_coords, + y_coords, + ω, + gmr, + radius, + nconds, + earth_model, + rac, + ω₀, + rdc, + rho, + nphases, + rstrand, + nstrand, + dcable, + dstrand, + gmrstrand, + epsr, + dins, + tins, + diashield, + tapelayer, + tapelap + ) + + # Kron reduction + if reduce + z, y = _kron(z, y, nphases) + end + + rs, xs = real(z), imag(z) + g, b = real(y), imag(y) + + b_fr = (b ./ 2.0) .* base_freq + b_to = (b ./ 2.0) .* base_freq + g_fr = (g ./ 2.0) .* base_freq + g_to = (g ./ 2.0) .* base_freq + + math_obj["br_r"] = _impedance_conversion_ravens(ravens_obj, rs) + math_obj["br_x"] = _impedance_conversion_ravens(ravens_obj, xs) + + math_obj["b_fr"] = _admittance_conversion_ravens(ravens_obj, b_fr) + math_obj["b_to"] = _admittance_conversion_ravens(ravens_obj, b_to) + + math_obj["g_fr"] = _admittance_conversion_ravens(ravens_obj, g_fr) + math_obj["g_to"] = _admittance_conversion_ravens(ravens_obj, g_to) + + end + + math_obj["angmin"] = get(ravens_obj, "vad_lb", fill(-60.0, nphases)) + math_obj["angmax"] = get(ravens_obj, "vad_ub", fill(60.0, nphases)) + + if (haskey(terminals[1], "ACDCTerminal.OperationalLimitSet")) + oplimitset_id = _extract_name(terminals[1]["ACDCTerminal.OperationalLimitSet"]) + oplimitset_valslist = data_ravens["OperationalLimitSet"][oplimitset_id]["OperationalLimitSet.OperationalLimitValue"] + oplimitset = Vector{Dict}(undef, length(oplimitset_valslist)) + for i in 1:length(oplimitset_valslist) + oplimitset[i] = data_ravens["OperationalLimitSet"][oplimitset_id]["OperationalLimitSet.OperationalLimitValue"][i] + end + else + oplimitset =[Dict()] + end + + limit_keys = [("CurrentLimit.value", "c_rating_a"), ("CurrentLimit.value", "c_rating_b"), ("CurrentLimit.value", "c_rating_c"), + ("ApparentPowerLimit.value", "rate_a"), ("ApparentPowerLimit.value", "rate_b"), ("ApparentPowerLimit.value", "rate_c")] + + for i in 1:length(oplimitset) + val = fill(0.0, nphases) + for (f_key, t_key) in limit_keys + val = haskey(oplimitset[i], f_key) && val[1] <= oplimitset[i][f_key] ? fill(oplimitset[i][f_key], nphases) : fill(Inf, nphases) + math_obj[t_key] = val + end + end + + math_obj["br_status"] = get(ravens_obj, "Equipment.inService", true) == true ? 1 : 0 + f_bus_data = data_math["bus"][string(math_obj["f_bus"])] + t_bus_data = data_math["bus"][string(math_obj["t_bus"])] + if(math_obj["br_status"] == 1) + f_bus_data["bus_type"] = 1 + t_bus_data["bus_type"] = 1 + end + + data_math["branch"]["$(math_obj["index"])"] = math_obj + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "branch.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_line!", + )) + + end + + end +end + + + +"converts ravens n-winding transformers into mathematical ideal 2-winding lossless transformer branches and impedance branches to represent the loss model" +function _map_ravens2math_power_transformer!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + + conducting_equipment = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"] + power_scale_factor = data_math["settings"]["power_scale_factor"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + voltage_scale_factor_sqrt3 = voltage_scale_factor * sqrt(3) + + for (name, ravens_obj) in get(conducting_equipment, "PowerTransformer", Dict{Any,Dict{String,Any}}()) + + # Build map first, so we can update it as we decompose the transformer + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => String[], + "unmap_function" => "_map_math2eng_transformer!", + )) + + to_map = data_math["map"][end]["to"] + + if haskey(ravens_obj, "PowerTransformer.PowerTransformerEnd") + + # Get nrw: number of windings + wdgs = ravens_obj["PowerTransformer.PowerTransformerEnd"] + nrw = length(wdgs) + + # connections + connections = Vector{Vector{Int64}}(undef, nrw) + + # configurations + wdgs_confs = Vector{ConnConfig}(undef, nrw) + + # RegulatorControls flag + reg_controls = [false for _ in 1:nrw] + reg_obj = [Dict() for _ in 1:nrw] + + # Transformer data for each winding + vnom = Vector{Float64}(undef, nrw) + snom = Vector{Float64}(undef, nrw) + zbase = Vector{Float64}(undef, nrw) + x_sc = Vector{Float64}(undef, nrw) + r_s = Vector{Float64}(undef, nrw) + g_sh = zeros(Float64, nrw) + b_sh = zeros(Float64, nrw) + + # Init RatioTapChanger data (default) + tm_set = Vector{Vector{Float64}}(undef, nrw) + tm_lb = Vector{Vector{Float64}}(undef, nrw) + tm_ub = Vector{Vector{Float64}}(undef, nrw) + tm_fix = Vector{Vector{Bool}}(undef, nrw) + tm_step = Vector{Vector{Float64}}(undef, nrw) + + for wdg_id in 1:nrw + + # wdg phasecode & terminals + wdg_terminals = ravens_obj["ConductingEquipment.Terminals"][wdg_id] + wdg_phasecode = wdg_terminals["Terminal.phases"] + + # wdg endNumber + wdg_endNumber = wdgs[wdg_id]["TransformerEnd.endNumber"] + + # Connections (based on _phasecode_map) + if haskey(_phasecode_map, wdg_phasecode) + connections[wdg_endNumber] = _phasecode_map[wdg_phasecode] + else + @error("PhaseCode not supported yet!") + end + + # nphases + nphases = length(connections[wdg_endNumber]) + + # Add terminals and voltage limits info. if missing + node = _extract_name(wdg_terminals["Terminal.ConnectivityNode"]) + bus = data_math["bus_lookup"][node] + bus_data = data_math["bus"][string(bus)] + if !(haskey(bus_data, "terminals")) || (length(bus_data["terminals"]) < length(connections[wdg_endNumber])) + bus_data["terminals"] = connections[wdg_endNumber] + bus_data["vmin"] = fill(0.0, nphases) + bus_data["vmax"] = fill(Inf, nphases) + bus_data["grounded"] = zeros(Bool, nphases) + end + + # wdgs configurations + if wdgs[wdg_endNumber]["PowerTransformerEnd.connectionKind"] == "WindingConnection.Y" || wdgs[wdg_endNumber]["PowerTransformerEnd.connectionKind"] == "WindingConnection.Yn" + wdgs_confs[wdg_endNumber] = WYE + elseif wdgs[wdg_endNumber]["PowerTransformerEnd.connectionKind"] == "WindingConnection.D" + wdgs_confs[wdg_endNumber] = DELTA + else + @error("PowerTransformer ConnectionKind not supported yet!") + end + + # Transformer data for each winding + vnom[wdg_endNumber] = wdgs[wdg_endNumber]["PowerTransformerEnd.ratedU"] + snom[wdg_endNumber] = wdgs[wdg_endNumber]["PowerTransformerEnd.ratedS"] + zbase[wdg_endNumber] = (vnom[wdg_endNumber]^2)/snom[wdg_endNumber] + + # Transformer impedance when values are missing for other windings. + xfmr_star_impedance = get(wdgs[wdg_endNumber], "TransformerEnd.StarImpedance", Dict()) + xfmr_star_impedance_r = get(xfmr_star_impedance, "TransformerStarImpedance.r", 0.0) + + if (xfmr_star_impedance == Dict()) + xfmr_star_impedance_wdg1 = get(wdgs[1], "TransformerEnd.StarImpedance", Dict()) + if (xfmr_star_impedance_wdg1 != Dict()) + xfmr_star_impedance_r = get(xfmr_star_impedance_wdg1, "TransformerStarImpedance.r", 0.0).*(zbase[wdg_endNumber]/zbase[1]) + end + end + + xfmr_mesh_impedance = get(wdgs[wdg_endNumber], "TransformerEnd.MeshImpedance", Dict()) + xfmr_mesh_impedance_r = get(xfmr_mesh_impedance, "TransformerMeshImpedance.r", 0.0) + + if (xfmr_mesh_impedance == Dict()) + xfmr_mesh_impedance_wdg1 = get(wdgs[1], "TransformerEnd.MeshImpedance", Dict()) + if (xfmr_mesh_impedance_wdg1 != Dict()) + xfmr_mesh_impedance_r = get(xfmr_mesh_impedance_wdg1, "TransformerMeshImpedance.r", 0.0).*(zbase[wdg_endNumber]/zbase[1]) + end + end + + # resistance + r_s[wdg_endNumber] = get(wdgs[wdg_endNumber], "PowerTransformerEnd.r", (xfmr_star_impedance_r != 0.0 ? xfmr_star_impedance_r : xfmr_mesh_impedance_r)./2) # divide by 2 because XFRMR Star Resistance includes both windings. + + # reactance + x_sc[wdg_endNumber] = get(xfmr_mesh_impedance, "TransformerMeshImpedance.x", + get(xfmr_star_impedance, "TransformerStarImpedance.x", 0.0)) + + # admittance + transf_core_impedance = get(wdgs[wdg_endNumber], "TransformerEnd.CoreAdmittance", Dict()) + g_sh[wdg_id] = get(transf_core_impedance, "TransformerCoreAdmittance.g", 0.0) + b_sh[wdg_id] = - get(transf_core_impedance, "TransformerCoreAdmittance.b", 0.0) + + + # Set RatioTapChanger in specific wdg + if haskey(wdgs[wdg_endNumber], "TransformerEnd.RatioTapChanger") + + rtc_name = _extract_name(wdgs[wdg_endNumber]["TransformerEnd.RatioTapChanger"]) + rtc_data = data_ravens["PowerSystemResource"]["TapChanger"]["RatioTapChanger"][rtc_name] + + # tm_step + hstep = get(rtc_data, "TapChanger.highStep", 16) + lstep = get(rtc_data, "TapChanger.lowStep", -16) + step_dist = abs(hstep) + abs(lstep) + step_tap = 1/step_dist + tm_step[wdg_endNumber] = fill(step_tap, nphases) + + # tm_set + step = get(rtc_data, "TapChanger.step", 1.0) # Starting Tap changer position/step + tm_set[wdg_endNumber] = fill(step, nphases) + + # tm_fix + ltcFlag = get(rtc_data, "TapChanger.ltcFlag", false) + if (ltcFlag == true) + tm_fix[wdg_endNumber] = zeros(Bool, nphases) + else + tm_fix[wdg_endNumber] = ones(Bool, nphases) + end + + # tm_ub/tm_lb + neutralVoltPu = get(rtc_data, "TapChanger.neutralU", vnom[wdg_endNumber])/vnom[wdg_endNumber] + step_volt_increment = get(rtc_data, "RatioTapChanger.stepVoltageIncrement", 100.0) + volt_lb = neutralVoltPu + step_tap * (step_volt_increment/100.0) * lstep + volt_ub = neutralVoltPu + step_tap * (step_volt_increment/100.0) * hstep + tm_lb[wdg_endNumber] = fill(volt_lb, nphases) + tm_ub[wdg_endNumber] = fill(volt_ub, nphases) + + # Regulator Control + if haskey(rtc_data, "TapChanger.TapChangerControl") && !all(tm_fix[wdg_endNumber]) + reg_controls[wdg_endNumber] = true + + if haskey(rtc_data, "TapChanger.TapChangerRatio") + ptRatio = get(rtc_data["TapChanger.TapChangerRatio"], "TapChanger.ptRatio", 60.0) + ctRating = get(rtc_data["TapChanger.TapChangerRatio"], "TapChanger.ctRating", 0.2) + else + ptRatio = 60.0 + ctRating = 0.2 + end + + reg_obj[wdg_endNumber] = Dict{String,Any}( + "vreg" => fill(rtc_data["TapChanger.TapChangerControl"]["RegulatingControl.targetValue"], nphases), + "band" => fill(rtc_data["TapChanger.TapChangerControl"]["RegulatingControl.targetDeadband"], nphases), + "ptratio" => fill(ptRatio, nphases), + "ctprim" => fill(ctRating, nphases), + "r" => fill(rtc_data["TapChanger.TapChangerControl"]["TapChangerControl.lineDropR"], nphases), + "x" => fill(rtc_data["TapChanger.TapChangerControl"]["TapChangerControl.lineDropX"], nphases) + ) + end + + else # default + tm_set[wdg_id] = fill(1.0, nphases) + tm_lb[wdg_id] = fill(0.9, nphases) + tm_ub[wdg_id] = fill(1.1, nphases) + tm_fix[wdg_id] = ones(Bool, nphases) + tm_step[wdg_id] = fill(1/32, nphases) + end + + end + + # data is measured externally, but we now refer it to the internal side - some values are referred to wdg 1 + ratios = vnom/voltage_scale_factor + x_sc = (x_sc./ratios[1]^2) + r_s = r_s./ratios.^2 + g_sh = g_sh[1]*ratios[1]^2 + b_sh = b_sh[1]*ratios[1]^2 + + # convert x_sc from list of upper triangle elements to an explicit dict + y_sh = g_sh + im*b_sh + z_sc = Dict([(key, im*x_sc[i]) for (i,key) in enumerate([(i,j) for i in 1:nrw for j in i+1:nrw])]) + + # dimesions + dims = length(tm_set[1]) + + # init polarity + polarity = fill(1, nrw) + + # Status + status = haskey(ravens_obj, "Equipment.inService") ? ravens_obj["Equipment.inService"] : true + status = status == true ? 1 : 0 + + # Build loss model + transformer_t_bus_w = _build_loss_model!(data_math, name, to_map, r_s, z_sc, y_sh, connections[1]; nphases=dims, status=status) + + # Mathematical model for transformer + for wdg_id in 1:nrw + + # 2-WINDING TRANSFORMER + # correct polarity and connections + if wdg_id > 1 + if wdgs_confs[1] == DELTA && wdgs_confs[wdg_id] == WYE + polarity[wdg_id] = -1 + connections[wdg_id] = _barrel_roll(connections[wdg_id][1:end], 1) + end + if wdgs_confs[1] == WYE && wdgs_confs[wdg_id] == DELTA + polarity[wdg_id] = -1 + connections[wdg_id] = _barrel_roll(connections[wdg_id], -1) + end + end + + # make virtual bus and mark it for reduction + tm_nom = wdgs_confs[wdg_id]==DELTA ? wdgs[wdg_id]["PowerTransformerEnd.ratedU"]*sqrt(3)/voltage_scale_factor : wdgs[wdg_id]["PowerTransformerEnd.ratedU"]/voltage_scale_factor + + # Get correct f_node for winding + wdg_term = ravens_obj["ConductingEquipment.Terminals"][wdg_id] + f_node_wdgterm = _extract_name(wdg_term["Terminal.ConnectivityNode"]) + + # Transformer Object + transformer_2wa_obj = Dict{String,Any}( + "name" => "_virtual_transformer.$name.$wdg_id", + "source_id" => "_virtual_transformer.PowerTransformer.$name.$wdg_id", + "f_bus" => data_math["bus_lookup"][f_node_wdgterm], + "t_bus" => transformer_t_bus_w[wdg_id], + "tm_nom" => tm_nom, + "f_connections" => connections[wdg_id], + "t_connections" => connections[1], + "configuration" => wdgs_confs[wdg_id], + "polarity" => polarity[wdg_id], + "tm_set" => tm_set[wdg_id], + "tm_fix" => tm_fix[wdg_id], + "sm_ub" => get(wdgs[wdg_id], "PowerTransformerEnd.ratedS", Inf)/power_scale_factor, + "cm_ub" => get(wdgs[wdg_id], "PowerTransformerEnd.ratedI", Inf), + "status" => status, + "index" => length(data_math["transformer"])+1 + ) + + + transformer_2wa_obj["tm_lb"] = tm_lb[wdg_id] + transformer_2wa_obj["tm_ub"] = tm_ub[wdg_id] + transformer_2wa_obj["tm_step"] = tm_step[wdg_id] + + data_math["transformer"]["$(transformer_2wa_obj["index"])"] = transformer_2wa_obj + + # Add Regulator Controls (only if flag is true) + if (reg_controls[wdg_id] == true) + data_math["transformer"]["$(transformer_2wa_obj["index"])"]["controls"] = reg_obj[wdg_id] + end + + # TODO: Center-Tapped Transformers (3 Windings) + # if w==3 && eng_obj["polarity"][w]==-1 # identify center-tapped transformer and mark all secondary-side nodes as triplex by adding va_start + # end + + push!(to_map, "transformer.$(transformer_2wa_obj["index"])") + + end + + elseif haskey(ravens_obj, "PowerTransformer.TransformerTank") + + # Get tanks data + tanks = ravens_obj["PowerTransformer.TransformerTank"] + + # number of tanks + ntanks = length(tanks) + + # TODO: IMPORTANT ASSUMPTIONS + # 1) assume there is at least 1 tank and that all tanks have the same number of windings (i.e., TransformerTankEnds) + # 2) assume the number of phases is equal to the number of tanks - DEPRECATED + # 3) assumes number of phases are indicated correctly in terminal # 1 + phasecode = ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.phases"] # terminal 1 phasecode + nphases = length(_phasecode_map[phasecode]) + # nphases = length(tanks) # assume nphases == ntanks + + nrw = length(tanks[1]["TransformerTank.TransformerTankEnd"]) + + # init connections vector for combined transformer windings + connections = [zeros(Int64, nphases) for _ in 1:nrw] + + # init nodes vector for combined transformer windings + nodes = ["" for _ in 1:nrw] + + # init rs, x_sc, g_sh, and b_sh data per wdg/tank(phase) + r_s = [zeros(Float64, nphases) for _ in 1:nrw] + x_sc = [zeros(Float64, nphases) for _ in 1:nrw] + g_sh = zeros(Float64, nphases) + b_sh = zeros(Float64, nphases) + + # init sm_ub and cm_ub + sm_ub = zeros(Float64, nrw) + cm_ub = zeros(Float64, nrw) + + # init configuration - default WYE-WYE + configuration = [WYE for _ in 1:nrw] + + # RegulatorControls flag + reg_controls = [false for _ in 1:nrw] + reg_obj = [Dict() for _ in 1:nrw] + + # init vnom for all windings + vnom = zeros(Float64, nrw) + ratios = zeros(Float64, nrw) + zbase = zeros(Float64, nrw) + + # temp store previous for checking + nodes_prev = [] + configuration_prev = [] + vnom_prev = [] + + # Init RatioTapChanger data (default) + tm_set = Vector{Vector{Float64}}(fill(fill(1.0, nphases), nrw)) + tm_lb = Vector{Vector{Float64}}(fill(fill(0.9, nphases), nrw)) + tm_ub = Vector{Vector{Float64}}(fill(fill(1.1, nphases), nrw)) + tm_fix = Vector{Vector{Bool}}(fill(ones(Bool, nphases), nrw)) + tm_step = Vector{Vector{Float64}}(fill(fill(1/32, nphases), nrw)) + + for tank_id in 1:ntanks + + # Get wdg data + wdgs = tanks[tank_id]["TransformerTank.TransformerTankEnd"] + + # Tank Asset + tank_asset_name = _extract_name(tanks[tank_id]["PowerSystemResource.AssetDatasheet"]) + tank_asset_data = data_ravens["AssetInfo"]["PowerTransformerInfo"][tank_asset_name] + + for wdg_id in 1:nrw + + # wdg terminals & phasecode + wdg_terminals = ravens_obj["ConductingEquipment.Terminals"][wdg_id] + wdg_phasecode = wdg_terminals["Terminal.phases"] + + # wdg endNumber + wdg_endNumber = wdgs[wdg_id]["TransformerEnd.endNumber"] + + # from-and-to-nodes for wdgs + nodes[wdg_endNumber] = _extract_name(wdg_terminals["Terminal.ConnectivityNode"]) + + # Connections (based on _phasecode_map) + if haskey(_phasecode_map, wdg_phasecode) + phasecode_conns = _phasecode_map[wdg_phasecode] + if !(length(phasecode_conns)>1) + connections[wdg_endNumber][tank_id] = phasecode_conns[1] + else + connections[wdg_endNumber] = phasecode_conns + end + else + @error("PhaseCode not supported yet!") + end + + # transformer tank end info. + transf_end_info = tank_asset_data["PowerTransformerInfo.TransformerTankInfos"][tank_asset_name]["TransformerTankInfo.TransformerEndInfos"] + vnom[wdg_endNumber] = transf_end_info[wdg_endNumber]["TransformerEndInfo.ratedU"] + snom_wdg = transf_end_info[wdg_endNumber]["TransformerEndInfo.ratedS"] + zbase[wdg_endNumber] = (vnom[wdg_endNumber]^2) / snom_wdg + + # Compute voltage ratios + ratios[wdg_endNumber] = vnom[wdg_endNumber]/voltage_scale_factor + + # Transformer star impedance when values are missing for other windings. + xfmr_star_impedance = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.TransformerStarImpedance", Dict()) + xfmr_star_impedance_r = get(xfmr_star_impedance, "TransformerStarImpedance.r", 0.0) + if (xfmr_star_impedance == Dict()) + xfmr_star_impedance_wdg1 = get(transf_end_info[1], "TransformerEndInfo.TransformerStarImpedance", Dict()) + if (xfmr_star_impedance_wdg1 != Dict()) + xfmr_star_impedance_r = get(xfmr_star_impedance_wdg1, "TransformerStarImpedance.r", 0.0).*(zbase[wdg_endNumber]/zbase[1]) + end + end + + # resistance computation + r_s[wdg_endNumber][tank_id] = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.r", xfmr_star_impedance_r./2) # divide by 2 because XFRMR Star Resistance includes both windings. + + # reactance computation + x_sc[wdg_endNumber][tank_id] = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.x", + get(xfmr_star_impedance, "TransformerStarImpedance.x", 0.0)) + + # -- alternative computation of xsc using sc tests + if haskey(transf_end_info[wdg_endNumber], "TransformerEndInfo.EnergisedEndShortCircuitTests") + leak_impedance_wdg = transf_end_info[wdg_endNumber]["TransformerEndInfo.EnergisedEndShortCircuitTests"][1]["ShortCircuitTest.leakageImpedance"] + rs_pct = (r_s[wdg_endNumber][tank_id]/zbase[wdg_endNumber])*100.0 + x_sc[wdg_endNumber][tank_id] = (sqrt((leak_impedance_wdg/zbase[wdg_endNumber])^2 - (rs_pct+rs_pct)^2)/100)*zbase[wdg_endNumber] + end + + # RS and XSC computation based on ratios + r_s[wdg_endNumber][tank_id] = r_s[wdg_endNumber][tank_id]/ratios[wdg_endNumber]^2 + x_sc[wdg_endNumber][tank_id] = (x_sc[wdg_endNumber][tank_id]/ratios[1]^2) # w.r.t wdg1 + + # b_sh and g_sh are always w.r.t wdg #1 + if wdg_endNumber == 1 + transf_end_noloadtest = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.EnergisedEndNoLoadTests", [Dict()]) + loss = get(transf_end_noloadtest[1], "NoLoadTest.loss", 0.0) + pctNoLoadLoss = (loss*100)/(snom_wdg/1000.0) # loss is in kW, thus snom_wdg/1000.0 + noLoadLoss = pctNoLoadLoss/100.0 + g_sh_tank = noLoadLoss/zbase[wdg_endNumber] + exct_current = get(transf_end_noloadtest[1], "NoLoadTest.excitingCurrent", pctNoLoadLoss) + cmag = sqrt(exct_current^2 - pctNoLoadLoss^2)/100 # cmag = pctImag/100 = sqrt(pctIexc^2 - pctNoLoadLoss^2)/100 + b_sh_tank = -(cmag)/zbase[wdg_endNumber] + # data is measured externally, but we now refer it to the internal side + g_sh[tank_id] = g_sh_tank*ratios[1]^2 # w.r.t wdg1 + b_sh[tank_id] = b_sh_tank*ratios[1]^2 # w.r.t wdg1 + end + + # configuration + conf = transf_end_info[wdg_endNumber]["TransformerEndInfo.connectionKind"] + if conf == "WindingConnection.Y" || conf == "WindingConnection.I" || conf == "WindingConnection.Yn" + configuration[wdg_endNumber] = WYE + elseif conf == "WindingConnection.D" + configuration[wdg_endNumber] = DELTA + else + @error("TransformerTank ConnectionKind not supported yet!") + end + + # add sm_ub if greater than existing (assumes the greatest value as the ratings for all phases in wdg) + semerg_wdg = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.emergencyS", get(transf_end_info[wdg_endNumber], "TransformerEndInfo.ratedS", Inf)) + if semerg_wdg > sm_ub[wdg_endNumber] + sm_ub[wdg_endNumber] = semerg_wdg + end + + # add cm_ub if greater than existing for winding (assumes the greatest value as the ratings for all phases in wdg) + cm_wdg = get(transf_end_info[wdg_endNumber], "TransformerEndInfo.ratedI", Inf) + if cm_wdg > cm_ub[wdg_endNumber] + cm_ub[wdg_endNumber] = cm_wdg + end + + # Set RatioTapChanger in specific wdg + if haskey(wdgs[wdg_endNumber], "TransformerEnd.RatioTapChanger") + + rtc_name = _extract_name(wdgs[wdg_endNumber]["TransformerEnd.RatioTapChanger"]) + rtc_data = data_ravens["PowerSystemResource"]["TapChanger"]["RatioTapChanger"][rtc_name] + + # tm_step + hstep = get(rtc_data, "TapChanger.highStep", 16) + lstep = get(rtc_data, "TapChanger.lowStep", -16) + step_dist = abs(hstep) + abs(lstep) + step_tap = 1/step_dist + tm_step[wdg_endNumber] = fill(step_tap, nphases) + + # tm_set + step = get(rtc_data, "TapChanger.step", 1.0) # Starting Tap changer position/step + tm_set[wdg_endNumber] = fill(step, nphases) + + # tm_fix + ltcFlag = get(rtc_data, "TapChanger.ltcFlag", false) + if (ltcFlag == true) + tm_fix[wdg_endNumber] = zeros(Bool, nphases) + else + tm_fix[wdg_endNumber] = ones(Bool, nphases) + end + + # tm_ub/tm_lb + neutralVoltPu = get(rtc_data, "TapChanger.neutralU", vnom[wdg_endNumber])/vnom[wdg_endNumber] + step_volt_increment = get(rtc_data, "RatioTapChanger.stepVoltageIncrement", 100.0) + volt_lb = neutralVoltPu + step_tap * (step_volt_increment/100.0) * lstep + volt_ub = neutralVoltPu + step_tap * (step_volt_increment/100.0) * hstep + tm_lb[wdg_endNumber] = fill(volt_lb, nphases) + tm_ub[wdg_endNumber] = fill(volt_ub, nphases) + + # Regulator Control + if haskey(rtc_data, "TapChanger.TapChangerControl") && !all(tm_fix[wdg_endNumber]) + reg_controls[wdg_endNumber] = true + + if haskey(rtc_data, "TapChanger.TapChangerRatio") + ptRatio = get(rtc_data["TapChanger.TapChangerRatio"], "TapChanger.ptRatio", 60.0) + ctRating = get(rtc_data["TapChanger.TapChangerRatio"], "TapChanger.ctRating", 0.2) + else + ptRatio = 60.0 + ctRating = 0.2 + end + + reg_obj[wdg_endNumber] = Dict{String,Any}( + "vreg" => fill(rtc_data["TapChanger.TapChangerControl"]["RegulatingControl.targetValue"], nphases), + "band" => fill(rtc_data["TapChanger.TapChangerControl"]["RegulatingControl.targetDeadband"], nphases), + "ptratio" => fill(ptRatio, nphases), + "ctprim" => fill(ctRating, nphases), + "r" => fill(rtc_data["TapChanger.TapChangerControl"]["TapChangerControl.lineDropR"], nphases), + "x" => fill(rtc_data["TapChanger.TapChangerControl"]["TapChangerControl.lineDropX"], nphases) + ) + end + + end + + end + + ### --- Consistency checks across tanks --- + # check that nodes are the same after first tank iter + if tank_id != 1 + @assert nodes == nodes_prev "nodes are not the same for all tanks! check ConnectivityNodes." # check if node names are the same as expected + else + nodes_prev = deepcopy(nodes) + end + + # check that configurations across tanks are consistent + if tank_id != 1 + @assert configuration == configuration_prev "Configurations (e.g., WYE, DELTA) are not the same for all tanks and windings! check Configurations." # check if node names are the same as expected + else + configuration_prev = deepcopy(configuration) + end + + # check that vnoms across tanks are consistent for wdgs + if tank_id != 1 + @assert vnom == vnom_prev "rated Voltages are not consistent for all tanks and windings! check TransformerEndInfo.ratedU values." # check if node names are the same as expected + else + vnom_prev = deepcopy(vnom) + end + + end + + # Add information about bus/node if missing + for i in 1:length(nodes) + node = nodes[i] + bus = data_math["bus_lookup"][node] + bus_data = data_math["bus"][string(bus)] + if !(haskey(bus_data, "terminals")) || (length(bus_data["terminals"]) < length(connections[i])) + bus_data["terminals"] = connections[i] + bus_data["vmin"] = fill(0.0, nphases) + bus_data["vmax"] = fill(Inf, nphases) + bus_data["grounded"] = zeros(Bool, nphases) + end + end + + # wdg i, tank 1 - assumes tank 1 always exists + r_s = [r_s[i][1] for i in 1:nrw] + x_sc = [x_sc[i][1] for i in 1:nrw] # sum the x_sc for all tanks per wdg + x_sc = [x_sc[1][1]] # get x_sc wrt to wdg 1 + g_sh = g_sh[1] # wrt to wdg 1 + b_sh = b_sh[1] # wrt to wdg 1 + + # convert x_sc from list of upper triangle elements to an explicit dict + y_sh = g_sh + im*b_sh + z_sc = Dict([(key, im*x_sc[i]) for (i,key) in enumerate([(i,j) for i in 1:nrw for j in i+1:nrw])]) + + # init Polarity + polarity = fill(1, nrw) + + # Status + status = haskey(ravens_obj, "Equipment.inService") ? ravens_obj["Equipment.inService"] : true + status = status == true ? 1 : 0 + + # Build loss model + transformer_t_bus_w = _build_loss_model!(data_math, name, to_map, r_s, z_sc, y_sh, connections[1]; nphases=nphases, status=status) + + # Compute total upper bounds based on number of tanks + sm_ub = sm_ub.*ntanks + cm_ub = cm_ub.*ntanks + + # Mathematical model for transformer + for wdg_id in 1:nrw + # 2-WINDING TRANSFORMER + + # correct polarity and connections + if wdg_id>1 + if configuration[1] == DELTA && configuration[wdg_id] == WYE + polarity[wdg_id] = -1 + connections[wdg_id] = _barrel_roll(connections[wdg_id][1:end], 1) + end + if configuration[1] == WYE && configuration[wdg_id] == DELTA + polarity[wdg_id] = -1 + connections[wdg_id] = _barrel_roll(connections[wdg_id], -1) + end + end + + # tm_nom depending on wdg configuration + if ntanks >= 3 + tm_nom = configuration[wdg_id]==DELTA ? vnom[wdg_id]/voltage_scale_factor : vnom[wdg_id]/voltage_scale_factor*sqrt(3) + else + tm_nom = configuration[wdg_id]==DELTA ? vnom[wdg_id]/voltage_scale_factor : vnom[wdg_id]/voltage_scale_factor + end + + # Transformer Object + transformer_2wa_obj = Dict{String,Any}( + "name" => "_virtual_transformer.$name.$wdg_id", + "source_id" => "_virtual_transformer.PowerTransformer.$name.$wdg_id", + "f_bus" => data_math["bus_lookup"][nodes[wdg_id]], + "t_bus" => transformer_t_bus_w[wdg_id], + "tm_nom" => tm_nom, + "f_connections" => connections[wdg_id], + "t_connections" => connections[1], + "configuration" => configuration[wdg_id], + "polarity" => polarity[wdg_id], + "tm_set" => tm_set[wdg_id], + "tm_fix" => tm_fix[wdg_id], + "sm_ub" => sm_ub[wdg_id]/power_scale_factor, + "cm_ub" => cm_ub[wdg_id], # TODO: this may need scaling + "status" => status, + "index" => length(data_math["transformer"])+1 + ) + + # RatioTapChanger + transformer_2wa_obj["tm_lb"] = tm_lb[wdg_id] + transformer_2wa_obj["tm_ub"] = tm_ub[wdg_id] + transformer_2wa_obj["tm_step"] = tm_step[wdg_id] + + data_math["transformer"]["$(transformer_2wa_obj["index"])"] = transformer_2wa_obj + + # Add Regulator Controls (only if flag is true) + if (reg_controls[wdg_id] == true) + data_math["transformer"]["$(transformer_2wa_obj["index"])"]["controls"] = reg_obj[wdg_id] + end + + # TODO: Center-Tapped Transformers (3 Windings) + # if w==3 && eng_obj["polarity"][w]==-1 # identify center-tapped transformer and mark all secondary-side nodes as triplex by adding va_start + # end + + push!(to_map, "transformer.$(transformer_2wa_obj["index"])") + + end + + end + end + +end + + +""" +Converts ravens load components into mathematical load components. +""" +function _map_ravens2math_energy_consumer!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + energy_connections = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["EnergyConnection"] + power_scale_factor = data_math["settings"]["power_scale_factor"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + voltage_scale_factor_sqrt3 = voltage_scale_factor * sqrt(3) + + for (name, ravens_obj) in get(energy_connections, "EnergyConsumer", Dict{Any,Dict{String,Any}}()) + math_obj = _init_math_obj_ravens("EnergyConsumer", name, ravens_obj, length(data_math["load"]) + 1; pass_props=pass_props) + + # Set the load bus based on connectivity node + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + math_obj["load_bus"] = data_math["bus_lookup"][connectivity_node] + + # Handle Load Response Characteristics + load_response_characts = _extract_name(ravens_obj["EnergyConsumer.LoadResponse"]) + if load_response_characts == "Constant Z" + math_obj["model"] = IMPEDANCE + elseif load_response_characts == "Motor" + @error("Load model not supported yet!") + elseif load_response_characts == "Mix Motor/Res" + @error("Load model not supported yet!") + elseif load_response_characts == "Constant I" + math_obj["model"] = CURRENT + elseif load_response_characts == "Variable P, Fixed Q" + @error("Load model not supported yet!") + elseif load_response_characts == "Variable P, Fixed X" + @error("Load model not supported yet!") + else + if load_response_characts != "Constant kVA" + @warn("Load model (response characteristic) for $(name) not supported! Defaulting to 'Constant kVA'") + end + # Set default model and consumption values + math_obj["model"] = POWER + end + + # Set voltage bounds for the bus connected + bus_info = string(math_obj["load_bus"]) + bus_conn = data_math["bus"][bus_info] + + # OperationalLimitSets + if haskey(data_ravens["ConnectivityNode"][connectivity_node], "ConnectivityNode.OperationalLimitSet") + op_limit_id = _extract_name(data_ravens["ConnectivityNode"][connectivity_node]["ConnectivityNode.OperationalLimitSet"]) + op_limits = data_ravens["OperationalLimitSet"][op_limit_id]["OperationalLimitSet.OperationalLimitValue"] + + # Loop through op. limits + for lim in op_limits + + if haskey(data_ravens, "OperationalLimitType") + lim_type_name = _extract_name(lim["OperationalLimit.OperationalLimitType"]) + lim_type = data_ravens["OperationalLimitType"][lim_type_name]["OperationalLimitType.direction"] + else + lim_type = lim["OperationalLimit.OperationalLimitType"]["OperationalLimitType.direction"] + end + + if lim_type == "OperationalLimitDirectionKind.high" + op_limit_max = lim["VoltageLimit.value"]/voltage_scale_factor_sqrt3 + elseif lim_type == "OperationalLimitDirectionKind.low" + op_limit_min = lim["VoltageLimit.value"]/voltage_scale_factor_sqrt3 + end + end + + else + op_limit_max = Inf + op_limit_min = 0.0 + end + + # Handle phase-specific or three-phase connection + nphases = 0 + if haskey(ravens_obj, "EnergyConsumer.EnergyConsumerPhase") + connections = Vector{Int64}() + for phase_info in ravens_obj["EnergyConsumer.EnergyConsumerPhase"] + phase = _phase_map[phase_info["EnergyConsumerPhase.phase"]] + phase_index = findfirst(==(phase), bus_conn["terminals"]) + bus_conn["vmax"][phase_index] = op_limit_max + bus_conn["vmin"][phase_index] = op_limit_min + push!(connections, phase) + end + math_obj["connections"] = connections + nphases = length(math_obj["connections"]) + else + nphases = length(bus_conn["terminals"]) + bus_conn["vmax"] = fill(op_limit_max, nphases) + bus_conn["vmin"] = fill(op_limit_min, nphases) + math_obj["connections"] = bus_conn["terminals"] + end + + # Set the nominal voltage + base_voltage_ref = _extract_name(ravens_obj["ConductingEquipment.BaseVoltage"]) + base_voltage = data_ravens["BaseVoltage"][base_voltage_ref]["BaseVoltage.nominalVoltage"] + + if nphases >= 3 + math_obj["vnom_kv"] = (base_voltage / voltage_scale_factor_sqrt3) + else + math_obj["vnom_kv"] = (base_voltage / voltage_scale_factor) + end + + # Set p and q (w/ multinetwork support) + if nw==0 + math_obj["pd"] = fill(get(ravens_obj, "EnergyConsumer.p", 0.0) / (power_scale_factor*nphases), nphases) + math_obj["qd"] = fill(get(ravens_obj, "EnergyConsumer.q", 0.0) / (power_scale_factor*nphases), nphases) + else + # Get timeseries schedule + if haskey(ravens_obj, "EnergyConsumer.LoadProfile") + + # get active (P) and reactive power (Q) of the load + active_power = zeros(Float64, nphases) + reactive_power = zeros(Float64, nphases) + + if haskey(ravens_obj, "EnergyConsumer.EnergyConsumerPhase") + for id in 1:nphases + phase_info = ravens_obj["EnergyConsumer.EnergyConsumerPhase"][id] + active_power[id] = get(phase_info, "EnergyConsumerPhase.p", 0.0) + reactive_power[id] = get(phase_info, "EnergyConsumerPhase.q", 0.0) + end + else + active_power = fill(get(ravens_obj, "EnergyConsumer.p", 0.0) / (power_scale_factor*nphases), nphases) + reactive_power = fill(get(ravens_obj, "EnergyConsumer.q", 0.0) / (power_scale_factor*nphases), nphases) + end + + schdl_name = _extract_name(ravens_obj["EnergyConsumer.LoadProfile"]) + schdl = data_ravens["BasicIntervalSchedule"][schdl_name] + + # units and multiplier modifiers + if haskey(schdl, "BasicIntervalSchedule.value1Multiplier") + value1_multiplier = _multipliers_map[schdl["BasicIntervalSchedule.value1Multiplier"]] + else + value1_multiplier = 1.0 + end + + if haskey(schdl, "BasicIntervalSchedule.value2Multiplier") + value2_multiplier = _multipliers_map[schdl["BasicIntervalSchedule.value2Multiplier"]] + else + value2_multiplier = 1.0 + end + + if haskey(schdl, "BasicIntervalSchedule.value1Unit") + unit_symbol = schdl["BasicIntervalSchedule.value1Unit"] + value1_unit = lowercase(unit_symbol[findfirst(isequal('.'), unit_symbol) + 1:end]) + if value1_unit == "w" + math_obj["pd"] = fill(get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value1", 0.0) * value1_multiplier / (power_scale_factor*nphases), nphases) + end + if value1_unit == "var" + math_obj["qd"] = fill(get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value1", 0.0) * value1_multiplier / (power_scale_factor*nphases), nphases) + end + end + + if haskey(schdl, "BasicIntervalSchedule.value2Unit") + unit_symbol = schdl["BasicIntervalSchedule.value2Unit"] + value2_unit = lowercase(unit_symbol[findfirst(isequal('.'), unit_symbol) + 1:end]) + if value2_unit == "w" + math_obj["pd"] = fill(get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value2", 0.0) * value2_multiplier / (power_scale_factor*nphases), nphases) + end + if value2_unit == "var" + math_obj["qd"] = fill(get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value2", 0.0) * value2_multiplier / (power_scale_factor*nphases), nphases) + end + end + + # Multipliers instead of actual values + if !haskey(schdl, "BasicIntervalSchedule.value1Unit") + math_obj["pd"] = get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value1", 1.0) .* active_power ./ power_scale_factor + math_obj["qd"] = get(schdl["EnergyConsumerSchedule.RegularTimePoints"][nw], "RegularTimePoint.value1", 1.0) .* reactive_power ./ power_scale_factor + end + + else + @error("No timeseries, load forecast or multinetwork information found!") + end + end + + + # Set the configuration + # TODO: ADD: "PhaseShuntConnectionKind.I", "PhaseShuntConnectionKind.G" + config_map = Dict("PhaseShuntConnectionKind.Y" => WYE, "PhaseShuntConnectionKind.D" => DELTA, "PhaseShuntConnectionKind.Yn" => WYE) + config = get(config_map, ravens_obj["EnergyConsumer.phaseConnection"], nothing) + if config !== nothing + math_obj["configuration"] = config + else + @error("Configuration of load $(name) is not supported.") + end + + # Correct (if needed) single-phase DELTA connections + if (math_obj["configuration"] == DELTA) + math_obj["vnom_kv"] = math_obj["vnom_kv"]*sqrt(3) + if (nphases == 1) + math_obj["configuration"] = WYE + @warn "EnergyConsumer (load): $name has DELTA configuration but only 1 connection (phase). DELTA configurations must have at least 2 or 3 connections!. EnergyConsumer converted to WYE connection." + math_obj["vnom_kv"] = math_obj["vnom_kv"]/sqrt(3) + end + end + + # Set status, dispatchable flag, and index + math_obj["status"] = haskey(ravens_obj, "Equipment.inService") ? ravens_obj["Equipment.inService"] : true + math_obj["status"] = math_obj["status"] == true ? 1 : 0 + math_obj["dispatchable"] = 0 + data_math["load"]["$(math_obj["index"])"] = math_obj + + # Handle grounding + if !(haskey(bus_conn, "grounded")) + if ravens_obj["EnergyConsumer.grounded"] == true + bus_conn["grounded"] = ones(Bool, length(math_obj["connections"])) + else + bus_conn["grounded"] = zeros(Bool, length(math_obj["connections"])) + end + end + + # Set bus type to PQ bus + if(math_obj["status"] == 1) + bus_conn["bus_type"] = 1 + end + + # Map the object + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "load.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_load!", + )) + end +end + + +""" +Converts ravens voltage sources into mathematical generators and (if needed) impedance branches to represent the loss model. +""" +function _map_ravens2math_energy_source!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + energy_connections = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["EnergyConnection"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + voltage_scale_factor_sqrt3 = voltage_scale_factor * sqrt(3) + + for (name, ravens_obj) in get(energy_connections, "EnergySource", Dict{Any,Dict{String,Any}}()) + math_obj = _init_math_obj_ravens("EnergySource", name, ravens_obj, length(data_math["gen"]) + 1; pass_props=pass_props) + math_obj["name"] = "_virtual_gen.energy_source.$name" + + # Get connectivity node info (bus info) + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + gen_bus = data_math["bus_lookup"][connectivity_node] + math_obj["gen_bus"] = gen_bus + bus_conn = data_math["bus"][string(gen_bus)] + + # Handle phase-specific or three-phase connection + connections = Vector{Int64}() + + if haskey(ravens_obj, "EnergySource.EnergySourcePhase") + for phase_info in ravens_obj["EnergySource.EnergySourcePhase"] + phase = _phase_map[phase_info["EnergySourcePhase.phase"]] + push!(connections, phase) + end + math_obj["connections"] = connections + else + # Terminal Phases + if haskey(ravens_obj["ConductingEquipment.Terminals"][1], "Terminal.phases") + phasecode = ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.phases"] + math_obj["connections"] = _phasecode_map[phasecode] + else + math_obj["connections"] = bus_conn["terminals"] + end + end + + # Check that connections and bus terminals have the same number of phases, if not, assume connections is correct + if (bus_conn["terminals"] != math_obj["connections"]) + bus_conn["terminals"] = math_obj["connections"] + nphases = length(bus_conn["terminals"]) + # Add vmin and vmax to bus if missing (correct number of terminals) + bus_conn["vmin"] = fill(0.0, nphases) + bus_conn["vmax"] = fill(Inf, nphases) + bus_conn["grounded"] = zeros(Bool, nphases) + end + + nconductors = length(get(ravens_obj, "EnergySource.EnergySourcePhase", bus_conn["terminals"])) + + # Generator status and configuration + math_obj["gen_status"] = haskey(ravens_obj, "Equipment.inService") ? ravens_obj["Equipment.inService"] : true + math_obj["gen_status"] = math_obj["gen_status"] == true ? 1 : 0 + + if(math_obj["gen_status"] == 1) + bus_conn["bus_type"] = 3 + end + + math_obj["configuration"] = get(ravens_obj, "EnergySource.connectionKind", WYE) + + # Set the nominal voltage + if haskey(ravens_obj, "ConductingEquipment.BaseVoltage") + base_voltage_ref = _extract_name(ravens_obj["ConductingEquipment.BaseVoltage"]) + vnom = data_ravens["BaseVoltage"][base_voltage_ref]["BaseVoltage.nominalVoltage"] / sqrt(nconductors) + data_math["settings"]["vbases_default"][connectivity_node] = vnom / voltage_scale_factor + else + vnom = ravens_obj["EnergySource.nominalVoltage"] / sqrt(nconductors) + data_math["settings"]["vbases_default"][connectivity_node] = vnom / voltage_scale_factor + end + + # Power, voltage, and limits + nphases = nconductors # You can adjust nphases based on your specific kron reduction logic if needed + fill_values = (v) -> fill(v, nphases) + math_obj["pg"] = get(ravens_obj, "EnergySource.activePower", fill_values(0.0)) + math_obj["qg"] = get(ravens_obj, "EnergySource.reactivePower", fill_values(0.0)) + math_obj["vg"] = fill(get(ravens_obj, "EnergySource.voltageMagnitude", voltage_scale_factor_sqrt3) / voltage_scale_factor_sqrt3, nphases) + math_obj["pmin"] = get(ravens_obj, "EnergySource.pMin", fill_values(-Inf)) + math_obj["pmax"] = get(ravens_obj, "EnergySource.pMax", fill_values(Inf)) + math_obj["qmin"] = get(ravens_obj, "EnergySource.qMin", fill_values(-Inf)) + math_obj["qmax"] = get(ravens_obj, "EnergySource.qMax", fill_values(Inf)) + + # Control mode and source ID + math_obj["control_mode"] = Int(get(ravens_obj, "EnergySource.connectionKind", ISOCHRONOUS)) + math_obj["source_id"] = "EnergySource.$name" + + # Add generator cost model + _add_gen_cost_model!(math_obj, ravens_obj) + + + rs = fill(get(ravens_obj, "EnergySource.r", zeros(1, 1)), nconductors, nconductors) + xs = fill(get(ravens_obj, "EnergySource.x", zeros(1, 1)), nconductors, nconductors) + + # Check for impedance and adjust bus type if necessary + map_to = "gen.$(math_obj["index"])" + if !all(isapprox.(rs, 0)) && !all(isapprox.(xs, 0)) + + if(math_obj["gen_status"] == 1) + bus_conn["bus_type"] = 1 + else + bus_conn["bus_type"] = 4 # Virtual bus becomes the new slack bus + end + + bus_obj = Dict( + "bus_i" => length(data_math["bus"]) + 1, + "index" => length(data_math["bus"]) + 1, + "terminals" => math_obj["connections"], + "grounded" => zeros(Bool, nphases), + "name" => "_virtual_bus.EnergySource.$name", + "bus_type" => math_obj["gen_status"] == 0 ? 4 : math_obj["control_mode"] == Int(ISOCHRONOUS) ? 3 : 2, + "vm" => fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases), + "va" => rad2deg.(_wrap_to_pi.([-2 * π / nphases * (i - 1) + get(ravens_obj, "EnergySource.voltageAngle", 0.0) for i in 1:nphases])), + "vmin" => fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases), + "vmax" => fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases), + "vm_pair_lb" => deepcopy(get(ravens_obj, "EnergySource.vpairMin", Tuple{Any,Any,Real}[])), + "vm_pair_ub" => deepcopy(get(ravens_obj, "EnergySource.vpairMax", Tuple{Any,Any,Real}[])), + "source_id" => "EnergySource.$name", + ) + + math_obj["gen_bus"] = bus_obj["bus_i"] + data_math["bus"]["$(bus_obj["index"])"] = bus_obj + + # Impedance calculation + r = get(ravens_obj, "EnergySource.r", 0.0) + r0 = get(ravens_obj, "EnergySource.r0", 0.0) + x = get(ravens_obj, "EnergySource.x", 0.0) + x0 = get(ravens_obj, "EnergySource.x0", 0.0) + Z_ABC = _impedance_conversion_ravens_energy_source(data_ravens, ravens_obj, r+x*1im, r0+x0*1im) + + branch_obj = Dict( + "name" => "_virtual_branch.EnergySource.$name", + "source_id" => "EnergySource.$name", + "f_bus" => bus_obj["bus_i"], + "t_bus" => gen_bus, + "f_connections" => math_obj["connections"], + "t_connections" => math_obj["connections"], + "angmin" => fill(-10.0, nconductors), + "angmax" => fill(10.0, nconductors), + "c_rating_a" => fill(Inf, nconductors), + "br_status" => math_obj["gen_status"], + "br_r" => real(Z_ABC), + "br_x" => imag(Z_ABC), + "g_fr" => zeros(nconductors, nconductors), + "g_to" => zeros(nconductors, nconductors), + "b_fr" => zeros(nconductors, nconductors), + "b_to" => zeros(nconductors, nconductors), + "index" => length(data_math["branch"]) + 1 + ) + + data_math["branch"]["$(branch_obj["index"])"] = branch_obj + map_to = [map_to, "bus.$(bus_obj["index"])", "branch.$(branch_obj["index"])"] + else + # Handle bus voltage limits if no impedance is present + vm_lb = math_obj["control_mode"] == Int(ISOCHRONOUS) ? fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases) : get(ravens_obj, "EnergySource.vMin", fill(1.0, nphases)) + vm_ub = math_obj["control_mode"] == Int(ISOCHRONOUS) ? fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases) : get(ravens_obj, "EnergySource.vMax", fill(1.0, nphases)) + + data_math["bus"]["$gen_bus"]["vmin"] = [vm_lb..., fill(0.0, nconductors - nphases)...] + data_math["bus"]["$gen_bus"]["vmax"] = [vm_ub..., fill(Inf, nconductors - nphases)...] + data_math["bus"]["$gen_bus"]["vm"] = fill(ravens_obj["EnergySource.voltageMagnitude"] / voltage_scale_factor_sqrt3, nphases) + data_math["bus"]["$gen_bus"]["va"] = rad2deg.(_wrap_to_pi.([-2 * π / nphases * (i - 1) + get(ravens_obj, "EnergySource.voltageAngle", 0.0) for i in 1:nphases])) + data_math["bus"]["$gen_bus"]["bus_type"] = _compute_bus_type(bus_conn["bus_type"], math_obj["gen_status"], math_obj["control_mode"]) + end + + data_math["gen"]["$(math_obj["index"])"] = math_obj + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => map_to, + "unmap_function" => "_map_math2eng_voltage_source!", + )) + end +end + + + +"converts engineering generators into mathematical generators" +function _map_ravens2math_rotating_machine!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + energy_connections = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["EnergyConnection"] + + if haskey(energy_connections, "RegulatingCondEq") + + regulating_cond_eq = energy_connections["RegulatingCondEq"] + power_scale_factor = data_math["settings"]["power_scale_factor"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + + for (name, ravens_obj) in get(regulating_cond_eq, "RotatingMachine", Dict{Any,Dict{String,Any}}()) + + math_obj = _init_math_obj_ravens("RotatingMachine", name, ravens_obj, length(data_math["gen"])+1; pass_props=pass_props) + + # Connections/phases obtained from Terminals + connections = _phasecode_map[get(ravens_obj["ConductingEquipment.Terminals"][1], "Terminal.phases", "PhaseCode.ABC")] + + nconductors = length(connections) + math_obj["connections"] = connections + + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + math_obj["gen_bus"] = data_math["bus_lookup"][connectivity_node] + math_obj["gen_status"] = get(ravens_obj, "Equipment.inService", true) + math_obj["gen_status"] = status = math_obj["gen_status"] == true ? 1 : 0 + + # TODO: control mode do not exist in the RAVENS-CIM (Need to be added) + math_obj["control_mode"] = control_mode = Int(get(ravens_obj, "control_mode", FREQUENCYDROOP)) + + # Set Pmax and Pmin for generator + if haskey(ravens_obj, "RotatingMachine.GeneratingUnit") + math_obj["pmin"] = ((get(ravens_obj["RotatingMachine.GeneratingUnit"], "GeneratingUnit.minOperatingP", 0) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + math_obj["pmax"] = ((get(ravens_obj["RotatingMachine.GeneratingUnit"], "GeneratingUnit.maxOperatingP", Inf) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + else + math_obj["pmin"] = (zeros(nconductors) ./ nconductors)./(power_scale_factor) + math_obj["pmax"] = ((get(ravens_obj, "RotatingMachine.ratedS", Inf) * get(ravens_obj, "RotatingMachine.ratedPowerFactor", 1.0) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + end + + # Set bus type + bus_type = 4 + if(status == 1) + bus_type = 1 + end + + data_math["bus"]["$(math_obj["gen_bus"])"]["bus_type"] = _compute_bus_type(bus_type, status, control_mode) + + # Set the nominal voltage + bus_conn = data_math["bus"]["$(math_obj["gen_bus"])"] + base_voltage_ref = _extract_name(ravens_obj["ConductingEquipment.BaseVoltage"]) + nominal_voltage = data_ravens["BaseVoltage"][base_voltage_ref]["BaseVoltage.nominalVoltage"] + base_voltage = nominal_voltage / sqrt(nconductors) + math_obj["vbase"] = base_voltage / voltage_scale_factor + + + if control_mode == Int(ISOCHRONOUS) && status == 1 + data_math["bus"]["$(math_obj["gen_bus"])"]["vm"] = ((get(ravens_obj, "RotatingMachine.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["vmax"] = ((get(ravens_obj, "RotatingMachine.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["vmin"] = ((get(ravens_obj, "RotatingMachine.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["va"] = [0.0, -120, 120, zeros(length(data_math["bus"]["$(math_obj["gen_bus"])"]) - 3)...][data_math["bus"]["$(math_obj["gen_bus"])"]["terminals"]] + end + + # Set min and max Q + if haskey(ravens_obj, "RotatingMachine.minQ") + math_obj["qmin"] = ((ravens_obj["RotatingMachine.minQ"] * ones(nconductors)) ./ nconductors)./(power_scale_factor) + elseif haskey(ravens_obj, "SynchronousMachine.minQ") + math_obj["qmin"] = ((ravens_obj["SynchronousMachine.minQ"] * ones(nconductors)) ./ nconductors)./(power_scale_factor) + elseif haskey(ravens_obj, "RotatingMachine.ratedPowerFactor") + Srated = get(ravens_obj, "RotatingMachine.ratedS", Inf) + PFrated = get(ravens_obj, "RotatingMachine.ratedPowerFactor", 1.0) + Prated = Srated*PFrated + math_obj["qmin"] = -((sqrt(Srated^2 - Prated^2) * ones(nconductors)) ./ nconductors) ./ (power_scale_factor) + else + math_obj["qmin"] = fill(-Inf, nconductors) + end + + if haskey(ravens_obj, "RotatingMachine.maxQ") + math_obj["qmax"] = ((ravens_obj["RotatingMachine.maxQ"] * ones(nconductors)) ./ nconductors)./(power_scale_factor) + elseif haskey(ravens_obj, "SynchronousMachine.maxQ") + math_obj["qmax"] = ((ravens_obj["SynchronousMachine.maxQ"] * ones(nconductors)) ./ nconductors)./(power_scale_factor) + elseif haskey(ravens_obj, "RotatingMachine.ratedPowerFactor") + Srated = get(ravens_obj, "RotatingMachine.ratedS", Inf) + PFrated = get(ravens_obj, "RotatingMachine.ratedPowerFactor", 1.0) + Prated = Srated*PFrated + math_obj["qmax"] = ((sqrt(Srated^2 - Prated^2) * ones(nconductors)) ./ nconductors) ./ (power_scale_factor) + else + math_obj["qmax"] = fill(Inf, nconductors) + end + + # Set pg and qg + math_obj["pg"] = (get(ravens_obj, "RotatingMachine.p", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + math_obj["qg"] = (get(ravens_obj, "RotatingMachine.q", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + + # TODO: add a polynomial parameters to be added to gen cost + _add_gen_cost_model!(math_obj, ravens_obj) + + # TODO: configuration for generators is not available on CIM (yet) + math_obj["configuration"] = get(ravens_obj, "configuration", WYE) + + # Set index + data_math["gen"]["$(math_obj["index"])"] = math_obj + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "gen.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_generator!", + )) + end + + end + +end + + +"converts ravens power_electronics units such as PVs and Batteries into mathematical components" +function _map_ravens2math_power_electronics!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + energy_connections = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["EnergyConnection"] + + if haskey(energy_connections, "RegulatingCondEq") + + regulating_cond_eq = energy_connections["RegulatingCondEq"] + power_scale_factor = data_math["settings"]["power_scale_factor"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + + for (name, ravens_obj) in get(regulating_cond_eq, "PowerElectronicsConnection", Dict{Any,Dict{String,Any}}()) + + # Get type of PowerElectronicsUnit + pec_type = get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "Ravens.cimObjectType", "") + + if (pec_type == "PhotoVoltaicUnit") + + math_obj = _init_math_obj_ravens("PhotoVoltaicUnit", name, ravens_obj, length(data_math["gen"])+1; pass_props=pass_props) + + # Connections/phases + connections = _phasecode_map[get(ravens_obj["ConductingEquipment.Terminals"][1], "Terminal.phases", "PhaseCode.ABC")] + + nconductors = length(connections) + math_obj["connections"] = connections + + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + math_obj["gen_bus"] = data_math["bus_lookup"][connectivity_node] + math_obj["gen_status"] = get(ravens_obj, "Equipment.inService", true) + math_obj["gen_status"] = status = math_obj["gen_status"] == true ? 1 : 0 + + # TODO: control mode do not exist in the RAVENS-CIM (Need to be added) + math_obj["control_mode"] = control_mode = Int(get(ravens_obj, "control_mode", FREQUENCYDROOP)) + + # Set bus type + bus_type = 4 + if(status == 1) + bus_type = 1 + end + + data_math["bus"]["$(math_obj["gen_bus"])"]["bus_type"] = _compute_bus_type(bus_type, status, control_mode) + + # Set the nominal voltage + bus_conn = data_math["bus"]["$(math_obj["gen_bus"])"] + base_voltage_ref = _extract_name(ravens_obj["ConductingEquipment.BaseVoltage"]) + nominal_voltage = data_ravens["BaseVoltage"][base_voltage_ref]["BaseVoltage.nominalVoltage"] + base_voltage = nominal_voltage / sqrt(nconductors) + math_obj["vbase"] = base_voltage / voltage_scale_factor + + if control_mode == Int(ISOCHRONOUS) && status == 1 + data_math["bus"]["$(math_obj["gen_bus"])"]["vm"] = ((get(ravens_obj, "PowerElectronicsConnection.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["vmax"] = ((get(ravens_obj, "PowerElectronicsConnection.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["vmin"] = ((get(ravens_obj, "PowerElectronicsConnection.ratedU", nominal_voltage))/nominal_voltage)* ones(nconductors) + data_math["bus"]["$(math_obj["gen_bus"])"]["va"] = [0.0, -120, 120, zeros(length(data_math["bus"]["$(math_obj["gen_bus"])"]) - 3)...][data_math["bus"]["$(math_obj["gen_bus"])"]["terminals"]] + data_math["bus"]["$(math_obj["gen_bus"])"]["bus_type"] = 3 + end + + # Set vg + if nconductors > 1 + m = sqrt(3) + else + m = 1 + end + for (fr_k, to_k) in [("PowerElectronicsConnection.ratedU", "vg")] + if haskey(ravens_obj, fr_k) + math_obj[to_k] = (nominal_voltage/m)*ones(nconductors)/voltage_scale_factor + end + end + + # TODO: configuration for generators is not available on CIM (yet) + math_obj["configuration"] = get(ravens_obj, "configuration", WYE) + + + # TODO: refactor the calculation of N when connections and configuration issues are solved. + N = math_obj["configuration"]==DELTA && length(connections)==1 ? 1 : _infer_int_dim(connections, math_obj["configuration"], false) # if solar is delta-connected to triplex node, N can be equal to 1 + + # Set pg/pmax and qg/qmax (w/ multinetwork support) + if nw==0 + if !haskey(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.maxP") + math_obj["pmax"] = ((get(ravens_obj, "PowerElectronicsConnection.ratedS", Inf) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + else + math_obj["pmax"] = ((get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.maxP", Inf) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + end + math_obj["pg"] = (get(ravens_obj, "PowerElectronicsConnection.p", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + else + + # Get timeseries schedule + if haskey(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PhotoVoltaicUnit.GenerationProfile") + + # initialization of pg values for multiplier case + pmax = zeros(Float64, nconductors) + pg = zeros(Float64, nconductors) + pmax = (get(ravens_obj, "PowerElectronicsConnection.p", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + pg = (get(ravens_obj, "PowerElectronicsConnection.p", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + + curve_name = _extract_name(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"]["PhotoVoltaicUnit.GenerationProfile"]) + curve = data_ravens["Curve"][curve_name] + + # multiplier modifier + if haskey(curve, "Curve.y1Multiplier") + value1_multiplier = _multipliers_map[curve["Curve.y1Multiplier"]] + else + value1_multiplier = 1.0 + end + + # Actual values + if haskey(curve, "Curve.y1Unit") + unit_symbol = curve["Curve.y1Unit"] + value1_unit = lowercase(unit_symbol[findfirst(isequal('.'), unit_symbol) + 1:end]) + if value1_unit == "w" + math_obj["pg"] = (get(curve["Curve.CurveDatas"][nw], "CurveData.y1value", 0.0) * value1_multiplier * -ones(nconductors) ./ nconductors)./(power_scale_factor) + math_obj["pmax"] = math_obj["pg"].*-1 + end + end + + # Multipliers instead of actual values + if !haskey(curve, "Curve.y1Unit") + math_obj["pg"] = -get(curve["Curve.CurveDatas"][nw], "CurveData.y1value", 1.0) .* pg + math_obj["pmax"] = math_obj["pg"].*-1 + end + + else + @error("No timeseries, dispatch profile or multinetwork information found!") + end + + end + + math_obj["pmin"] = ((get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.minP", 0.0) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + math_obj["qmin"] = ((get(ravens_obj, "PowerElectronicsConnection.minQ", -0) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + math_obj["qmax"] = ((get(ravens_obj, "PowerElectronicsConnection.maxQ", 0) * ones(nconductors)) ./ nconductors)./(power_scale_factor) + math_obj["qg"] = (get(ravens_obj, "PowerElectronicsConnection.q", 0.0) * -ones(nconductors) ./ nconductors)./(power_scale_factor) + + # TODO: add a polynomial parameters to be added to gen cost + _add_gen_cost_model!(math_obj, ravens_obj) + + # Set index + data_math["gen"]["$(math_obj["index"])"] = math_obj + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "gen.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_solar!", + )) + + elseif (pec_type == "BatteryUnit") + + math_obj = _init_math_obj_ravens("BatteryUnit", name, ravens_obj, length(data_math["storage"])+1; pass_props=pass_props) + + # Connections/phases + connections = _phasecode_map[get(ravens_obj["ConductingEquipment.Terminals"][1], "Terminal.phases", "PhaseCode.ABC")] + nconductors = length(connections) + math_obj["connections"] = connections + + # Set the bus + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + math_obj["storage_bus"] = data_math["bus_lookup"][connectivity_node] + math_obj["status"] = get(ravens_obj, "Equipment.inService", true) + math_obj["status"] = status = math_obj["status"] == true ? 1 : 0 + + # TODO: configuration for generators is not available on CIM (yet) + math_obj["configuration"] = get(ravens_obj, "configuration", WYE) + + # Set battery parameters + math_obj["energy"] = ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"]["BatteryUnit.storedE"]/power_scale_factor + + if !haskey(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "BatteryUnit.BatteryUnitEfficiency") + math_obj["energy_rating"] = ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"]["BatteryUnit.ratedE"]/power_scale_factor + math_obj["charge_efficiency"] = 100.0 + math_obj["discharge_efficiency"] = 100.0 + math_obj["p_loss"] = 0 + math_obj["q_loss"] = 0 + else + math_obj["energy_rating"] = ((get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"]["BatteryUnit.BatteryUnitEfficiency"], "BatteryUnitEfficiency.limitEnergy", 100.0)/100.0)*ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"]["BatteryUnit.ratedE"])/power_scale_factor + math_obj["charge_efficiency"] = get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "BatteryUnitEfficiency.efficiencyCharge", 100.0) / 100.0 + math_obj["discharge_efficiency"] = get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "BatteryUnitEfficiency.efficiencyDischarge", 100.0) / 100.0 + # TODO: These are still missing from the RAVENS Schema + math_obj["p_loss"] = get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "BatteryUnitEfficiency.idlingActivePower", 0)./(power_scale_factor) + math_obj["q_loss"] = get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "BatteryUnitEfficiency.idlingReactivePower", 0)./(power_scale_factor) + end + + if !haskey(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.maxP") + math_obj["charge_rating"] = (get(ravens_obj, "PowerElectronicsConnection.ratedS", Inf))./(power_scale_factor) + math_obj["discharge_rating"] = math_obj["charge_rating"] + else + math_obj["charge_rating"] = -(get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.minP", Inf))./(power_scale_factor) + math_obj["discharge_rating"] = (get(ravens_obj["PowerElectronicsConnection.PowerElectronicsUnit"], "PowerElectronicsUnit.maxP", Inf))./(power_scale_factor) + end + + math_obj["thermal_rating"] = get(ravens_obj, "PowerElectronicsConnection.ratedS", Inf)/power_scale_factor + + math_obj["qmin"] = (get(ravens_obj, "PowerElectronicsConnection.minQ", -math_obj["discharge_rating"]*power_scale_factor))./(power_scale_factor) + math_obj["qmax"] = (get(ravens_obj, "PowerElectronicsConnection.maxQ", math_obj["charge_rating"]*power_scale_factor))./(power_scale_factor) + + # TODO: verify that these CIM terms are equivalent to the needed values. + math_obj["r"] = get(ravens_obj, "PowerElectronicsConnection.r", 0) + math_obj["x"] = get(ravens_obj, "PowerElectronicsConnection.x", 0) + + # TODO: control mode do not exist in the RAVENS-CIM (Need to be added) + math_obj["control_mode"] = control_mode = Int(get(ravens_obj, "control_mode", FREQUENCYDROOP)) + + # Set the ps and qs + math_obj["ps"] = (-get(ravens_obj, "PowerElectronicsConnection.p", 0.0))./(power_scale_factor) + math_obj["qs"] = (-get(ravens_obj, "PowerElectronicsConnection.q", 0.0))./(power_scale_factor) + + # Set bus type + bus_type = 4 + if(status == 1) + bus_type = 1 + if haskey(ravens_obj, "PowerElectronicsConnection.PowerElectronicsOperatingMode") + mode = ravens_obj["PowerElectronicsConnection.PowerElectronicsOperatingMode"]["PowerElectronicsOperatingMode.mode"] + if mode == "OperatingModeKind.gridForming" + bus_type = 2 + end + end + end + + data_math["bus"]["$(math_obj["storage_bus"])"]["bus_type"] = _compute_bus_type(bus_type, status, control_mode) + + if control_mode == Int(ISOCHRONOUS) && math_obj["status"] == 1 + data_math["bus"]["$(math_obj["storage_bus"])"]["va"] = [0.0, -120, 120, zeros(length(data_math["bus"]["$(math_obj["storage_bus"])"]) - 3)...][data_math["bus"]["$(math_obj["storage_bus"])"]["terminals"]] + end + + data_math["storage"]["$(math_obj["index"])"] = math_obj + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "storage.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_storage!", + )) + end + end + end +end + + +"converts ravens switches into mathematical switches and (if neeed) impedance branches to represent loss model" +function _map_ravens2math_switch!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + conducting_equipment = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"] + + for (name, ravens_obj) in get(conducting_equipment, "Switch", Dict{Any,Dict{String,Any}}()) + + math_obj = _init_math_obj_ravens("Switch", name, ravens_obj, length(data_math["switch"])+1; pass_props=pass_props) + + # Terminals and phases + terminals = ravens_obj["ConductingEquipment.Terminals"] + + # Loop through terminals + f_conns = [] + t_conns = [] + for term in terminals + if haskey(term, "Terminal.phases") + phasecode = term["Terminal.phases"] + if term["ACDCTerminal.sequenceNumber"] == 1 + f_conns = _phasecode_map[phasecode] + else + t_conns = _phasecode_map[phasecode] + end + else + f_conns = [1, 2, 3] + t_conns = [1, 2, 3] + end + end + + # Verify connections are correct. + @assert f_conns == t_conns "f_conns are not equal to t_conns!. Revise connections/phases in Switch terminals" + + math_obj["f_connections"] = f_conns + math_obj["t_connections"] = t_conns + + # Phases + nphases = length(f_conns) + + # Connectivity Nodes + f_node = _extract_name(terminals[1]["Terminal.ConnectivityNode"]) + t_node = _extract_name(terminals[2]["Terminal.ConnectivityNode"]) + math_obj["f_bus"] = data_math["bus_lookup"][f_node] + math_obj["t_bus"] = data_math["bus_lookup"][t_node] + + # Add vmin/vmax/terminals info to fbus and tbus if missing + for bus in [math_obj["f_bus"], math_obj["t_bus"]] + bus_data = data_math["bus"][string(bus)] + if !(haskey(bus_data, "terminals")) || (length(bus_data["terminals"]) < length(f_conns)) + bus_data["terminals"] = f_conns + bus_data["vmin"] = fill(0.0, nphases) + bus_data["vmax"] = fill(Inf, nphases) + bus_data["grounded"] = zeros(Bool, nphases) + end + end + + # Status + status = get(ravens_obj, "Equipment.inService", true) + math_obj["status"] = status == true ? 1 : 0 + + f_bus_data = data_math["bus"][string(math_obj["f_bus"])] + t_bus_data = data_math["bus"][string(math_obj["t_bus"])] + if(math_obj["status"] == 1) + f_bus_data["bus_type"] = 1 + t_bus_data["bus_type"] = 1 + end + + # State + sw_state = CLOSED + if (haskey(ravens_obj, "Switch.SwitchPhase")) + sw_closed = get(ravens_obj["Switch.SwitchPhase"][1], "SwitchPhase.closed", true) + sw_state = sw_closed == true ? CLOSED : OPEN + else + sw_open = get(ravens_obj, "Switch.open", false) + sw_state = sw_open == false ? CLOSED : OPEN + end + math_obj["state"] = Int(sw_state) + + # Dispatchable + sw_type = get(ravens_obj, "Ravens.cimObjectType", "Switch") + if (sw_type == "Fuse" || sw_type == "Jumper") + math_obj["dispatchable"] = Int(NO) + else + dispatch_locked = get(ravens_obj, "Switch.locked", false) + math_obj["dispatchable"] = dispatch_locked == true ? Int(NO) : Int(YES) + end + + # Current and Power Limits + if haskey(ravens_obj, "PowerSystemResource.AssetDatasheet") + swinfo_name = _extract_name(ravens_obj["PowerSystemResource.AssetDatasheet"]) + swinfo_data = data_ravens["AssetInfo"]["SwitchInfo"][swinfo_name] + math_obj["current_rating"] = fill(get(swinfo_data, "SwitchInfo.breakingCapacity", get(swinfo_data, "SwitchInfo.ratedCurrent", Inf)), nphases) + math_obj["sm_ub"] = math_obj["current_rating"] .* get(swinfo_data, "SwitchInfo.ratedVoltage", Inf) + else + math_obj["current_rating"] = fill(get(ravens_obj, "Switch.ratedCurrent", Inf)) + math_obj["sm_ub"] = math_obj["current_rating"] .* get(ravens_obj, "Switch.ratedVoltage", Inf) + end + + # TODO: not found on CIM - kron reductions + for (f_key, t_key) in [("cm_ub_b", "c_rating_b"), ("cm_ub_c", "c_rating_c"), ("sm_ub_b", "rate_b"), ("sm_ub_c", "rate_c")] + math_obj[t_key] = haskey(ravens_obj, f_key) ? fill(ravens_obj[f_key], nphases) : fill(Inf, nphases) + end + + # Map index + map_to = "switch.$(math_obj["index"])" + + # Push Mapping + data_math["switch"]["$(math_obj["index"])"] = math_obj + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => map_to, + "unmap_function" => "_map_math2eng_switch!", + )) + + end + +end + + +"converts ravens generic shunt components into mathematical shunt components" +function _map_ravens2math_shunt_compensator!(data_math::Dict{String,<:Any}, data_ravens::Dict{String,<:Any}; pass_props::Vector{String}=String[], nw::Int=nw_id_default) + energy_connections = data_ravens["PowerSystemResource"]["Equipment"]["ConductingEquipment"]["EnergyConnection"] + + if haskey(energy_connections, "RegulatingCondEq") + regulating_cond_eq = energy_connections["RegulatingCondEq"] + power_scale_factor = data_math["settings"]["power_scale_factor"] + voltage_scale_factor = data_math["settings"]["voltage_scale_factor"] + + for (name, ravens_obj) in get(regulating_cond_eq, "ShuntCompensator", Dict{Any,Dict{String,Any}}()) + + math_obj = _init_math_obj("ShuntCompensator", name, ravens_obj, length(data_math["shunt"])+1; pass_props=pass_props) + + # Get connectivity node info (bus info) + connectivity_node = _extract_name(ravens_obj["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]) + math_obj["shunt_bus"] = data_math["bus_lookup"][connectivity_node] + + # Status + status = haskey(ravens_obj, "Equipment.inService") ? ravens_obj["Equipment.inService"] : true + math_obj["status"] = status == true ? 1 : 0 + + bus_info = string(math_obj["shunt_bus"]) + bus_conn = data_math["bus"][bus_info] + + if(math_obj["status"] == 1) + bus_conn["bus_type"] = 1 + end + + # Connections/phases obtained from Terminals + connections = _phasecode_map[get(ravens_obj["ConductingEquipment.Terminals"][1], "Terminal.phases", "PhaseCode.ABC")] + + math_obj["connections"] = connections + terminals = connections + + # TODO: dispatchable + math_obj["dispatchable"] = 0 + + # bs - TODO: make sure b matrix is being calculated correctly + b = ravens_obj["LinearShuntCompensator.bPerSection"] + B = _calc_shunt_admittance_matrix(terminals, b) + math_obj["bs"] = B + + # gs + if haskey(ravens_obj, "LinearShuntCompensator.gPerSection") + g = ravens_obj["LinearShuntCompensator.gPerSection"] + G = _calc_shunt_admittance_matrix(terminals, g) + math_obj["gs"] = G + else + math_obj["gs"] = zeros(size(math_obj["bs"])) + end + + # Index + data_math["shunt"]["$(math_obj["index"])"] = math_obj + + # TODO: Add CapControl + # ..... + + push!(data_math["map"], Dict{String,Any}( + "from" => name, + "to" => "shunt.$(math_obj["index"])", + "unmap_function" => "_map_math2eng_shunt!", + )) + end + end +end diff --git a/src/data_model/utils_ravens.jl b/src/data_model/utils_ravens.jl new file mode 100644 index 000000000..d6a416174 --- /dev/null +++ b/src/data_model/utils_ravens.jl @@ -0,0 +1,372 @@ +const _phasecode_map = Dict( + "PhaseCode.ABCN" => [1, 2, 3], + "PhaseCode.ABC" => [1, 2, 3], + "PhaseCode.AB" => [1, 2], + "PhaseCode.AC" => [1, 3], + "PhaseCode.BC" => [2, 3], + "PhaseCode.A" => [1], + "PhaseCode.B" => [2], + "PhaseCode.C" => [3], + "PhaseCode.AN" => [1], + "PhaseCode.BN" => [2], + "PhaseCode.CN" => [3] +) + +_phase_map = Dict( + "SinglePhaseKind.A" => 1, + "SinglePhaseKind.B" => 2, + "SinglePhaseKind.C" => 3, + "SinglePhaseKind.N" => 4 +) + +const _multipliers_map = Dict( + "UnitMultiplier.m" => 1e-3, + "UnitMultiplier.c" => 1e-2, + "UnitMultiplier.d" => 1e-1, + "UnitMultiplier.da" => 1e1, + "UnitMultiplier.h" => 1e2, + "UnitMultiplier.k" => 1e3, + "UnitMultiplier.M" => 1e6, + "UnitMultiplier.G" => 1e9, + "UnitMultiplier.T" => 1e12, + "UnitMultiplier.P" => 1e15, + "UnitMultiplier.E" => 1e18, + "UnitMultiplier.Z" => 1e21 +) + + +"initializes the base math object of any type" +function _init_math_obj_ravens(obj_type::String, eng_id::Any, eng_obj::Dict{String,<:Any}, index::Int; pass_props::Vector{String}=String[])::Dict{String,Any} + math_obj = Dict{String,Any}( + "name" => "$eng_id", + "source_id" => "$obj_type.$eng_id" + ) + + math_obj["index"] = index + + return math_obj +end + + +"converts impendance in Ohm/m by multiplying by length" +function _impedance_conversion_ravens(eng_obj::Dict{String,<:Any}, vals::Matrix{Float64}) + return vals .* get(eng_obj, "Conductor.length", 1.0) +end + + +"converts admittance by multiplying by 2πωl" +function _admittance_conversion_ravens(eng_obj::Dict{String,<:Any}, vals::Matrix{Float64}) + 2.0 .* pi .* vals .* get(eng_obj, "Conductor.length", 1.0) ./ 1e9 +end + + +"converts impendance in Ohm/m by multiplying by length" +function _impedance_conversion_ravens(data_eng::Dict{String,Any}, eng_obj::Dict{String,Any}, key::String) + + _conductor_count = data_eng["PerLengthPhaseImpedance.conductorCount"] + _impedance_matrix = zeros(Float64, _conductor_count, _conductor_count) + + for obj in data_eng["PerLengthPhaseImpedance.PhaseImpedanceData"] + row = obj["PhaseImpedanceData.row"] + col = obj["PhaseImpedanceData.column"] + value = get(obj, key, 0.0) + _impedance_matrix[row, col] = value + _impedance_matrix[col, row] = value + end + + return _impedance_matrix .* get(eng_obj, "Conductor.length", 1.0) +end + + +"converts impendance in Ohm/m in EnergySource" +function _impedance_conversion_ravens_energy_source(data_eng::Dict{String,Any}, eng_obj::Dict{String,Any}, z1::Complex, z0::Complex) + # TODO : Single-phase + a = 1*exp(120*im*π/180) + A = [1 1 1; 1 a a^2; 1 a^2 a] + Z_012 = [z0 0im 0im; 0im z1 0im; 0im 0im z1] + Z_ABC = A^-1 * Z_012 * A + return Z_ABC +end + + +"converts admittance by multiplying by 2πωl" +function _admittance_conversion_ravens(data_eng::Dict{String,<:Any}, eng_obj::Dict{String,<:Any}, key::String) + + _conductor_count = data_eng["PerLengthPhaseImpedance.conductorCount"] + _admittance_matrix = zeros(Float64, _conductor_count, _conductor_count) + + for obj in data_eng["PerLengthPhaseImpedance.PhaseImpedanceData"] + row = obj["PhaseImpedanceData.row"] + col = obj["PhaseImpedanceData.column"] + value = get(obj, key, 0.0) + _admittance_matrix[row, col] = value + _admittance_matrix[col, row] = value + end + + return _admittance_matrix .* get(eng_obj, "Conductor.length", 1.0) ./ 2 # divide by 2 to get both sides _to and _fr +end + +"extracts the name from a ravens reference string" +function _extract_name(element) + + name = replace(split(element, "::")[2], "'" => "") + return name +end + +"extracts the type from a ravens reference string" +function _extract_type(element) + + name = replace(split(element, "::")[1], "'" => "") + return name +end + + +"calculates the shunt admittance matrix based on terminals and b or g" +function _calc_shunt_admittance_matrix(terminals, b) + + N = length(terminals) + _shunt_matrix = b* Matrix(LinearAlgebra.I, N, N) + return _shunt_matrix + +end + + +""" + apply_voltage_bounds_math!(data::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1) + +add voltage bounds to all buses based on per-unit upper (`vm_ub`) and lower (`vm_lb`), in MATHEMATICAL. +""" +function apply_voltage_bounds_math!(data::Dict{String,<:Any}; vm_lb::Union{Real,Missing}=0.9, vm_ub::Union{Real,Missing}=1.1) + if ismultinetwork(data) + for (_, nw_data) in data["nw"] + for (_, bus_data) in nw_data["bus"] + if (bus_data["bus_type"] != 3) + bus_data["vmin"] = ones(length(bus_data["vmin"])).*vm_lb + bus_data["vmax"] = ones(length(bus_data["vmax"])).*vm_ub + end + end + end + else + for (_, bus_data) in data["bus"] + if (bus_data["bus_type"] != 3) + bus_data["vmin"] = ones(length(bus_data["vmin"])).*vm_lb + bus_data["vmax"] = ones(length(bus_data["vmax"])).*vm_ub + end + end + end +end + + +function build_base_voltage_graphs(data::Dict{String,<:Any})::Tuple{Dict{Int,String},Graphs.SimpleGraph} + nodes = Dict(cn => n for (n, cn) in enumerate(keys(data["ConnectivityNode"]))) + G = Graphs.SimpleGraph(length(nodes)) + + for edge_dicts in [ + _recursive_dict_get(data, ["PowerSystemResource", "Equipment", "ConductingEquipment", "Conductor", "ACLineSegment"], Dict()), + _recursive_dict_get(data, ["PowerSystemResource", "Equipment", "ConductingEquipment", "Switch"], Dict()) + ] + for (i, edge) in edge_dicts + Graphs.add_edge!(G, nodes[match(Regex("ConnectivityNode::'(.+)'"), edge["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]).captures[1]], nodes[match(Regex("ConnectivityNode::'(.+)'"), edge["ConductingEquipment.Terminals"][2]["Terminal.ConnectivityNode"]).captures[1]]) + end + end + + return Dict{Int,String}(n => cn for (cn, n) in nodes), G +end + + +function find_voltages(data::Dict{String,<:Any})::Dict{String,Any} + voltages = Dict{String,Any}() + + for (i, es) in _recursive_dict_get(data, ["PowerSystemResource", "Equipment", "ConductingEquipment", "EnergyConnection", "EnergySource"], Dict()) + nominal_voltage = get(es, "EnergySource.nominalVoltage", missing) + if !ismissing(nominal_voltage) + voltages[match(Regex("ConnectivityNode::'(.+)'"), es["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]).captures[1]] = nominal_voltage + end + end + + for (i, tr) in _recursive_dict_get(data, ["PowerSystemResource", "Equipment", "ConductingEquipment", "PowerTransformer"], Dict()) + info_name = match(Regex("TransformerTankInfo::'(.*)'"), get(get(tr, "PowerTransformer.TransformerTank", [Dict()])[1], "PowerSystemResource.AssetDatasheet", "TransformerTankInfo::''")).captures[1] + trinfos = _recursive_dict_get(data, ["AssetInfo", "PowerTransformerInfo", info_name, "PowerTransformerInfo.TransformerTankInfos", info_name, "TransformerTankInfo.TransformerEndInfos"], []) + + # Corrects voltage ratios for TransformerTanks with Single-phase Tanks datasheets + voltage_ratios = ones(length(tr["ConductingEquipment.Terminals"])) + for wdg_id in 1:1:length(tr["ConductingEquipment.Terminals"]) + conns = length(_phasecode_map[tr["ConductingEquipment.Terminals"][wdg_id]["Terminal.phases"]]) + voltage_ratios[wdg_id] = conns >= 3 ? sqrt(3) : 1.0 + end + + rated_u = merge( + filter(x -> !ismissing(x.second), Dict(get(trinfo, "TransformerEndInfo.endNumber", n) => get(trinfo, "TransformerEndInfo.ratedU", missing) * voltage_ratios[n] for (n, trinfo) in enumerate(trinfos))), + filter(x -> !ismissing(x.second), Dict(get(pte, "endNumber", n) => get(pte, "PowerTransformerEnd.ratedU", missing) for (n, pte) in enumerate(get(tr, "PowerTransformer.PowerTransformerEnd", [])))) + ) + + for (n, term) in enumerate(get(tr, "ConductingEquipment.Terminals", [])) + voltages[match(Regex("ConnectivityNode::'(.+)'"), term["Terminal.ConnectivityNode"]).captures[1]] = get(rated_u, n, missing) + end + end + + return voltages +end + + +function find_base_voltages(data::Dict{String,<:Any})::Dict{String,Any} + node_lookup, G = build_base_voltage_graphs(data) + + voltages = find_voltages(data) + + ccs = Graphs.connected_components(G) + + voltage_per_cc = Dict() + for (n, cc) in enumerate(ccs) + for i in cc + if node_lookup[i] in keys(voltages) + voltage_per_cc[n] = voltages[node_lookup[i]] + break + end + end + end + + return Dict{String,Any}(node_lookup[i] => get(voltage_per_cc, n, missing) for (n, cc) in enumerate(ccs) for i in cc) +end + + +function _recursive_dict_get(dict::Dict, path::Vector{<:Any}, default::Any)::Any + if length(path) > 1 + return _recursive_dict_get(get(dict, path[1], Dict()), path[2:end], default) + else + return get(dict, path[1], default) + end +end + + +function _recursive_dict_set!(dict::Dict, path::Vector{<:Any}, value::Any) + if length(path) > 1 + _recursive_dict_set!(dict[path[1]], path[2:end], value) + else + dict[path[1]] = value + end +end + + +function add_base_voltages!(data::Dict{String,<:Any}; overwrite::Bool=false)::Nothing + if overwrite || "BaseVoltage" ∉ keys(data) + data["BaseVoltage"] = Dict{String,Any}() + end + + base_voltages = find_base_voltages(data) + + unique_bv = unique(values(base_voltages)) + + for bv in unique_bv + data["BaseVoltage"]["PMD_BaseV_$(bv/1000.0)_kV"] = Dict{String,Any}( + "IdentifiedObject.name" => "PMD_BaseV_$(bv) V", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "Ravens.cimObjectType" => "BaseVoltage", + "BaseVoltage.nominalVoltage" => bv + ) + end + + encon_path = ["PowerSystemResource", "Equipment", "ConductingEquipment", "EnergyConnection"] + + for path in [["EnergyConsumer"], ["EnergySource"], ["RegulatingCondEq", "PowerElectronicsConnection"], ["RegulatingCondEq", "RotatingMachine"]] + path = [encon_path..., path...] + for (i, item) in _recursive_dict_get(data, path, Dict()) + if !overwrite && "ConductingEquipment.BaseVoltage" ∈ keys(item) + continue + else + cn = match(Regex("ConnectivityNode::'(.+)'"), item["ConductingEquipment.Terminals"][1]["Terminal.ConnectivityNode"]).captures[1] + _recursive_dict_set!(data, [path..., i, "ConductingEquipment.BaseVoltage"], "BaseVoltage::'PMD_BaseV_$(base_voltages[cn]/1000.0)_kV'") + end + end + end +end + + +function add_voltage_bounds!(data::Dict{String,<:Any}, vm_lb_pu::Real=0.95, vm_ub_pu::Real=1.05; apply_to_all_connectivity_nodes::Bool=false, overwrite::Bool=false, acceptable_duration::Real=5e9) + cond_equip_path = ["PowerSystemResource", "Equipment", "ConductingEquipment"] + + if overwrite || !haskey(data, "BaseVoltage") + data["BaseVoltage"] = Dict{String,Any}() + end + + add_voltage_limit_set_types!(data; overwrite=overwrite, acceptable_duration=acceptable_duration) + + for path in [["EnergyConnection", "EnergySource"], ["EnergyConnection", "EnergyConsumer"], ["RegulatingCondEq", "PowerElectronicsConnection"], ["RegulatingCondEq", "RotatingMachine"]] + path = [cond_equip_path..., path...] + for (i, item) in _recursive_dict_get(data, path, Dict()) + base_voltage_ref = get(item, "ConductingEquipment.BaseVoltage", missing) + if ismissing(base_voltage_ref) + @warn "Cannot add limits to $(path[end]).$(i): BaseVoltage is missing. Add BaseVoltage using functing `add_base_voltages`" + continue + end + base_voltage = data["BaseVoltage"][base_voltage_ref]["BaseVoltage.nominalVoltage"] + + for (n, terminal) in enumerate(item["ConductingEquipment.Terminals"]) + if !overwrite && haskey(item, "ACDCTerminal.OperationalLimitSet") + continue + else + limit_set_name = "PMD_BaseV_$(base_voltage*vm_lb_pu)_$(base_voltage*vm_ub_pu)" + if !haskey(data["BaseVoltage"], limit_set_name) + data["BaseVoltage"][limit_set_name] = _build_voltage_limit(base_voltage, vm_lb_pu, vm_ub_pu; acceptable_duration=acceptable_duration) + end + _recursive_dict_set!(data, [path..., i, "ACDCTerminal.OperationalLimitSet"], "OperationalLimitSet::'$(limit_set_name)'") + end + end + end + end +end + + +function add_voltage_limit_set_types!(data::Dict{String,Any}; overwrite::Bool=false, acceptable_duration::Real=5e9) + high = Dict{String,Any}( + "Ravens.cimObjectType" => "OperationalLimitType", + "IdentifiedObject.name" => "PMD_highType_$(acceptable_duration)s", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "OperationalLimitType.direction" => "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration" => acceptable_duration + ) + + low = Dict{String,Any}( + "Ravens.cimObjectType" => "OperationalLimitType", + "IdentifiedObject.name" => "PMD_lowType_$(acceptable_duration)s", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "OperationalLimitType.direction" => "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration" => acceptable_duration + ) + + if overwrite || !haskey(data, "OperationalLimitType") + data["OperationalLimitType"] = Dict{String,Any}() + end + + for item in [high, low] + if !(!overwrite && haskey(data["OperationalLimitType"], item["IdentifiedObject.name"])) + data["OperationalLimitType"][item["IdentifiedObject.name"]] = item + end + end +end + + +function _build_voltage_limit(vbase::Real, vm_lb_pu::Real, vm_ub_pu::Real; acceptable_duration::Real=5e9)::Dict{String,Any} + Dict{String,Any}( + "Ravens.cimObjectType" => "OperationalLimitSet", + "IdentifiedObject.name" => "PMD_OpLimV-$(vbase*vm_lb_pu)_$(vbase*vm_ub_pu)", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "OperationalLimitSet.OperationalLimitValue" => Dict{String,Any}[ + Dict{String,Any}( + "Ravens.cimObjectType" => "VoltageLimit", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "VoltageLimit.normalValue" => vbase, + "VoltageLimit.value" => vbase * vm_ub_pu, + "OperationalLimit.OperationalLimitType" => "OperationalLimitType::'PMD_highType_$(acceptable_duration)s'" + ), + Dict{String,Any}( + "Ravens.cimObjectType" => "VoltageLimit", + "IdentifiedObject.mRID" => "$(UUIDs.uuid4())", + "VoltageLimit.normalValue" => vbase, + "VoltageLimit.value" => vbase * vm_lb_pu, + "OperationalLimit.OperationalLimitType" => "OperationalLimitType::'PMD_lowType_$(acceptable_duration)s'" + ) + ] + ) +end + diff --git a/src/form/bf.jl b/src/form/bf.jl index 7a1f11a2f..828b5d7cc 100644 --- a/src/form/bf.jl +++ b/src/form/bf.jl @@ -109,10 +109,10 @@ function constraint_mc_transformer_power_dy(pm::LPUBFDiagModel, nw::Int, trans_i tm = [tm_fixed[idx] ? tm_set[idx] : var(pm, nw, :tap, trans_id)[fc] for (idx,(fc,tc)) in enumerate(zip(f_connections,t_connections))] nph = length(tm_set) - p_fr = [var(pm, nw, :pt, f_idx)[c] for c in f_connections] - p_to = [var(pm, nw, :pt, t_idx)[c] for c in t_connections] - q_fr = [var(pm, nw, :qt, f_idx)[c] for c in f_connections] - q_to = [var(pm, nw, :qt, t_idx)[c] for c in t_connections] + p_fr = var(pm, nw, :pt, f_idx) + p_to = var(pm, nw, :pt, t_idx) + q_fr = var(pm, nw, :qt, f_idx) + q_to = var(pm, nw, :qt, t_idx) w_fr = var(pm, nw, :w)[f_bus] w_to = var(pm, nw, :w)[t_bus] diff --git a/src/io/common.jl b/src/io/common.jl index 6df3b742d..6a8a72252 100644 --- a/src/io/common.jl +++ b/src/io/common.jl @@ -105,22 +105,22 @@ function parse_file( ) end elseif filetype == "json" - if multinetwork && !ismultinetwork(pmd_data) - pmd_data = make_multinetwork(pmd_data; global_keys=global_keys) - end - if data_model == MATHEMATICAL && !ismath(pmd_data) - pmd_data = transform_data_model(pmd_data; - make_pu=make_pu, - make_pu_extensions=make_pu_extensions, - kron_reduce=kron_reduce, - phase_project=phase_project, - multinetwork=multinetwork, - global_keys=global_keys, - eng2math_extensions=eng2math_extensions, - eng2math_passthrough=eng2math_passthrough, - ) - end + ## TODO: may not be needed + # if data_model == MATHEMATICAL && !ismath(pmd_data) + # pmd_data = transform_data_model(pmd_data; + # make_pu=make_pu, + # make_pu_extensions=make_pu_extensions, + # kron_reduce=kron_reduce, + # phase_project=phase_project, + # multinetwork=multinetwork, + # global_keys=global_keys, + # eng2math_extensions=eng2math_extensions, + # eng2math_passthrough=eng2math_passthrough, + # ) + # end + + else error("only .dss and .json files are supported") end diff --git a/src/prob/common.jl b/src/prob/common.jl index d0f9ea408..d4cec9dcc 100644 --- a/src/prob/common.jl +++ b/src/prob/common.jl @@ -129,6 +129,44 @@ function instantiate_mc_model( end + +function instantiate_mc_model_ravens( + data::Dict{String,<:Any}, + model_type::Type, + build_method::Function; + ref_extensions::Vector{<:Function}=Function[], + multinetwork::Bool=false, + global_keys::Set{String}=Set{String}(), + ravens2math_extensions::Vector{<:Function}=Function[], + ravens2math_passthrough::Dict{String,<:Vector{<:String}}=Dict{String,Vector{String}}(), + make_pu_extensions::Vector{<:Function}=Function[], + kwargs... + ) + + if !ismath(data) + @info "Converting CIM-RAVENS data model to MATHEMATICAL first to build JuMP model" + data = transform_data_model_ravens( + data; + multinetwork=multinetwork, + global_keys=global_keys, + ravens2math_extensions=ravens2math_extensions, + ravens2math_passthrough=ravens2math_passthrough, + make_pu_extensions=make_pu_extensions, + ) + end + + return _IM.instantiate_model( + data, + model_type, + build_method, + ref_add_core!, + union(_pmd_math_global_keys, global_keys), + pmd_it_sym; + ref_extensions=ref_extensions, + kwargs... + ) +end + """ solve_mc_model( data::Dict{String,<:Any}, diff --git a/test/data/ravens/ravens_case3_withcap.json b/test/data/ravens/ravens_case3_withcap.json new file mode 100644 index 000000000..7ded2d307 --- /dev/null +++ b/test/data/ravens/ravens_case3_withcap.json @@ -0,0 +1,595 @@ +{ + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "EnergyConnection": { + "EnergyConsumer": { + "l2": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "4e4702cf-7f18-44c3-93f9-93821ed0c4e6", + "IdentifiedObject.name": "l2", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "ce89b6cf-4c5a-4676-bbab-25d93f5807b4", + "IdentifiedObject.name": "l2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.B", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "b40a48ed-24f4-429d-bd16-1f0d4b2cfc04", + "IdentifiedObject.name": "l2_B", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.B" + } + ] + }, + "l3": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "38b13fa4-3f89-44f9-9d73-a450e25ae2c1", + "IdentifiedObject.name": "l3", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "04a05739-b1a0-419e-8cfc-a38fcb5a8b2d", + "IdentifiedObject.name": "l3_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.C", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "a7f35df2-55b8-4541-847e-b81dc7bcb7f7", + "IdentifiedObject.name": "l3_C", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.C" + } + ] + }, + "l1": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "671deb49-478c-4e01-afb3-e5493b79e7a9", + "IdentifiedObject.name": "l1", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "969c99fd-7a05-4e7d-a11c-5adb91529509", + "IdentifiedObject.name": "l1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.A", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "af3f616f-5a03-494e-a2aa-66d41c0e8983", + "IdentifiedObject.name": "l1_A", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.A" + } + ] + } + }, + "EnergySource": { + "source": { + "Ravens.cimObjectType": "EnergySource", + "IdentifiedObject.mRID": "d2849b1b-7772-4d4a-949d-5de0554cbd4c", + "IdentifiedObject.name": "source", + "EnergySource.nominalVoltage": 400.0, + "EnergySource.voltageMagnitude": 398.36, + "EnergySource.voltageAngle": 0.0, + "EnergySource.r": 3.880570000581328e-08, + "EnergySource.x": 1.5522280002325312e-07, + "EnergySource.r0": 5.069596039676399e-08, + "EnergySource.x0": 1.5208788119029196e-07, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "8cb856e5-8b34-47d6-9bc7-15b21e52e53d", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ] + } + }, + "RegulatingCondEq": { + "ShuntCompensator": { + "c1": { + "Ravens.cimObjectType": "LinearShuntCompensator", + "IdentifiedObject.mRID": "40b072d2-1459-4810-ae25-7d1af553084b", + "IdentifiedObject.name": "c1", + "ShuntCompensator.nomU": 400.0, + "LinearShuntCompensator.bPerSection": 0.12499999999999997, + "LinearShuntCompensator.gPerSection": 0.0, + "ShuntCompensator.phaseConnection": "PhaseShuntConnectionKind.Y", + "LinearShuntCompensator.b0PerSection": 0.12499999999999997, + "LinearShuntCompensator.g0PerSection": 0.0, + "ShuntCompensator.normalSections": 1, + "ShuntCompensator.maximumSections": 1, + "Equipment.inService": true, + "ShuntCompensator.aVRDelay": 0.0, + "ShuntCompensator.sections": 1.0, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "8c18dcac-6986-452f-93c1-9f3c5f8e7e28", + "IdentifiedObject.name": "c1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_38.97114317029974_51.96152422706632'" + } + ] + } + } + } + }, + "Conductor": { + "ACLineSegment": { + "quad": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "fc5789c3-b0d4-43cb-b486-df1fa52f5a00", + "IdentifiedObject.name": "quad", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'4/0quad'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "b40a4567-9713-40ef-8d44-cd1611fba66a", + "IdentifiedObject.name": "quad_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "30427167-38f0-4fc0-a30c-505b84288e11", + "IdentifiedObject.name": "quad_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "7a34457b-4055-4c69-b100-1b98092a55d1", + "IdentifiedObject.name": "quad_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "dfa50ff9-7061-491d-abaa-06abd224c925", + "IdentifiedObject.name": "quad_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "3e42579c-92ee-4299-aee2-83637f0e8dc8", + "IdentifiedObject.name": "quad_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + }, + "ohline": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "617cbf5b-db10-4c5a-9a69-f72b5d05c6d4", + "IdentifiedObject.name": "ohline", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'556mcm'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "93792d12-16fe-48de-8654-c1e2d6b4275f", + "IdentifiedObject.name": "ohline_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "f9676c55-dd17-442a-ac75-30aab306e0ff", + "IdentifiedObject.name": "ohline_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "4ba78bf5-e98a-4a57-95a6-9a5a3b3bef04", + "IdentifiedObject.name": "ohline_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "a569f9bc-d0b6-4598-b6fc-b82d9a8265ef", + "IdentifiedObject.name": "ohline_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "4dcb9f1e-388f-4159-acc9-5a0eadf49765", + "IdentifiedObject.name": "ohline_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + } + } + } + } + } + }, + "OperationalLimitSet": { + "OpLimI_38.97114317029974_51.96152422706632": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "df42099d-914d-4f26-91ad-7e279849ab2e", + "IdentifiedObject.name": "OpLimI_38.97114317029974_51.96152422706632", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "b6c1bcf8-d44e-45bb-9f0b-2244bd61dd7f", + "IdentifiedObject.name": "OpLimI_38.97114317029974_51.96152422706632_Norm", + "CurrentLimit.value": 38.97114317029974, + "CurrentLimit.normalValue": 38.97114317029974, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "7d04bea6-1bbc-4d8f-92ff-5e793997e854", + "IdentifiedObject.name": "OpLimI_38.97114317029974_51.96152422706632_Emerg", + "CurrentLimit.value": 51.96152422706632, + "CurrentLimit.normalValue": 38.97114317029974, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + } + ] + }, + "OpLimI_400.0_600.0": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "020ca323-f577-4b8d-8c03-970bca7222fe", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "901ded36-5a2e-4a7d-8aba-25197f6d1534", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "45dd4a09-d3cd-40f6-8993-1a4d13fdcb71", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + } + ] + }, + "OpLimV_380.0-420.00000000000006": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "3643ffa0-c35e-4025-b0a5-766d3b6435a2", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "77023bed-e40e-474f-a9c3-2e79ec1f7bfb", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAhigh", + "VoltageLimit.value": 420.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "563219e7-ef3e-4955-949e-d630ec727007", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAlow", + "VoltageLimit.value": 380.0, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + } + ] + } + }, + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "556mcm": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "59f14e7d-be3b-4133-aaf5-3686495071f2", + "IdentifiedObject.name": "556mcm", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + } + ] + }, + "4/0quad": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "a106d3dc-a198-4d11-ace2-6dc07bf59169", + "IdentifiedObject.name": "4/0quad", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + } + ] + } + } + } + }, + "Location": { + "primary_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "f1e62041-40d1-407b-9a44-f58035006249", + "IdentifiedObject.name": "primary_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "loadbus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "e7b7df3c-577e-4da9-b547-45c818d80807", + "IdentifiedObject.name": "loadbus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "sourcebus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "3c24e9a5-5400-4f63-8adc-cb424586f18e", + "IdentifiedObject.name": "sourcebus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + } + }, + "EnergyConnectionProfile": { + "Load::::::defaultload": { + "Ravens.cimObjectType": "EnergyConnectionProfile", + "IdentifiedObject.mRID": "1a9d79f7-a43d-442e-b796-b9feb14a17b1", + "IdentifiedObject.name": "Load::::::defaultload", + "EnergyConnectionProfile.dssSpectrum": "defaultload" + } + }, + "Versions": { + "IEC61970CIMVersion": { + "Ravens.cimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + }, + "RavensVersion": { + "Ravens.cimObjectType": "RavensVersion", + "RavensVersion.date": "2025-03-10", + "RavensVersion.version": "RAVENSv0.3.0-dev" + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.cimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "489a74aa-4d4f-4fe2-898e-e427e779eee3", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.pConstantPower": 100.0, + "LoadResponseCharacteristic.qConstantPower": 100.0 + } + }, + "OperationalLimitType": { + "lowType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "55cbac53-876f-4b2c-a2a8-d348c17ecfb6", + "IdentifiedObject.name": "lowType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "highType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "c53c645e-6e21-4524-a372-cc24f2643931", + "IdentifiedObject.name": "highType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_86400.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "50900681-ca6f-44d2-9b14-adf028a4b3e3", + "IdentifiedObject.name": "absoluteValueType_86400.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 86400.0 + }, + "absoluteValueType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "14b8120a-0794-4910-82ce-866fe814ac85", + "IdentifiedObject.name": "absoluteValueType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 5000000000.0 + } + }, + "ConnectivityNode": { + "primary": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "43f0c7ee-a2f0-4d63-aef5-e1d7d4d573bc", + "IdentifiedObject.name": "primary" + }, + "sourcebus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "5d3c5fd4-b79c-4f4b-bc7e-4f5f93ce14b0", + "IdentifiedObject.name": "sourcebus" + }, + "loadbus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "bc35f150-6102-4f0c-8f29-6c63b8efe5ea", + "IdentifiedObject.name": "loadbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + }, + "BaseVoltage": { + "BaseV_0.4": { + "Ravens.cimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "9c927679-58be-42f9-aa8c-ec74322e2b24", + "IdentifiedObject.name": "BaseV_0.4", + "BaseVoltage.nominalVoltage": 400.0 + } + } +} \ No newline at end of file diff --git a/test/data/ravens/ravens_case3_withgens.json b/test/data/ravens/ravens_case3_withgens.json new file mode 100644 index 000000000..55ca62d87 --- /dev/null +++ b/test/data/ravens/ravens_case3_withgens.json @@ -0,0 +1,632 @@ +{ + "OperationalLimitSet": { + "OpLimV_360.00000000000006-440.00000000000006": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "0affa440-d2d8-4fa3-92f6-c74b4d320853", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "5af21a33-2166-4d75-a2f4-3f579caa911e", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAhigh", + "VoltageLimit.value": 440.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "ac7913ff-485d-44f8-9617-230ce8aab4fd", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAlow", + "VoltageLimit.value": 360.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + } + ] + }, + "OpLimV_380.0-420.00000000000006": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "9394d894-7ec0-4a26-a9b6-66bccc8f1414", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "8ab44324-b7d8-4d81-bf9a-1c5e2d1e36f2", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAhigh", + "VoltageLimit.value": 420.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "0bd94978-9d79-439c-ad54-02dbe37283d4", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAlow", + "VoltageLimit.value": 380.0, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + } + ] + }, + "OpLimI_400.0_600.0": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "2d93253b-f2bb-432f-96ff-7e4eec67d8e3", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "759a2254-d4c0-4d27-8bc6-d47c07d4d5ce", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + }, + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "f134e287-ae7c-4d85-a547-da0769d972b8", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + } + ] + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "EnergyConnection": { + "EnergyConsumer": { + "l2": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "677244d1-61ee-4d4e-bc78-2e627da48d73", + "IdentifiedObject.name": "l2", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "a1f404e6-1659-46a4-b99e-55dc23b05891", + "IdentifiedObject.name": "l2_B", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.B" + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "839eabd9-7a80-47b8-981c-7ef4cc1c33e9", + "IdentifiedObject.name": "l2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.B", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ] + }, + "l1": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "260a548c-2df4-4402-be48-c113af690711", + "IdentifiedObject.name": "l1", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "7cafb047-287c-4094-ba1d-a69241fa9547", + "IdentifiedObject.name": "l1_A", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.A" + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "3202c504-99f7-4e15-90c7-649e8c82aac7", + "IdentifiedObject.name": "l1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.A", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ] + }, + "l3": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "c7d592fa-7438-4d21-bc9a-dbd3ed4c0a88", + "IdentifiedObject.name": "l3", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "5ea39eca-a263-4d5c-a3bd-2d47cbb6dd02", + "IdentifiedObject.name": "l3_C", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.C" + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "f53bbd4e-e290-4f13-9673-86ec97228078", + "IdentifiedObject.name": "l3_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.C", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ] + } + }, + "RegulatingCondEq": { + "RotatingMachine": { + "gen2": { + "Ravens.cimObjectType": "SynchronousMachine", + "IdentifiedObject.mRID": "81390416-2b37-4121-a37e-e3515f83795c", + "IdentifiedObject.name": "gen2", + "RotatingMachine.p": 1000.0, + "RotatingMachine.q": 0.0, + "RotatingMachine.ratedS": 1200.0, + "RotatingMachine.ratedU": 461.88021535170066, + "Equipment.inService": true, + "RotatingMachine.ratedPowerFactor": 1.0, + "SynchronousMachine.maxQ": 0.0, + "SynchronousMachine.minQ": -0.0, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "fbe395fc-6f7b-4e1c-ada7-5035bf86591f", + "IdentifiedObject.name": "gen2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + } + ], + "RotatingMachine.GeneratingUnit": { + "Ravens.cimObjectType": "GeneratingUnit", + "IdentifiedObject.mRID": "aa977def-b0c9-45ef-bd9e-e5246fa72809", + "IdentifiedObject.name": "gen2_GenUnit", + "GeneratingUnit.minOperatingP": 0.0, + "GeneratingUnit.maxOperatingP": 1200.0 + } + }, + "gen1": { + "Ravens.cimObjectType": "SynchronousMachine", + "IdentifiedObject.mRID": "2a263555-a184-45b4-9433-78c719b019d5", + "IdentifiedObject.name": "gen1", + "RotatingMachine.p": 2000.0, + "RotatingMachine.q": 0.0, + "RotatingMachine.ratedS": 2400.0, + "RotatingMachine.ratedU": 461.88021535170066, + "Equipment.inService": true, + "RotatingMachine.ratedPowerFactor": 1.0, + "SynchronousMachine.maxQ": 0.0, + "SynchronousMachine.minQ": -0.0, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "ee4f4ef2-c05f-4928-8a13-aee428fb33d0", + "IdentifiedObject.name": "gen1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + } + ], + "RotatingMachine.GeneratingUnit": { + "Ravens.cimObjectType": "GeneratingUnit", + "IdentifiedObject.mRID": "2ccc4531-6602-42a4-8f34-ef0ba4a0b2b9", + "IdentifiedObject.name": "gen1_GenUnit", + "GeneratingUnit.minOperatingP": 0.0, + "GeneratingUnit.maxOperatingP": 2400.0 + } + } + } + }, + "EnergySource": { + "source": { + "Ravens.cimObjectType": "EnergySource", + "IdentifiedObject.mRID": "c3c06e8c-905c-463b-8931-92fd363392c4", + "IdentifiedObject.name": "source", + "EnergySource.nominalVoltage": 400.0, + "EnergySource.voltageMagnitude": 398.36, + "EnergySource.voltageAngle": 0.0, + "EnergySource.r": 3.880570000581328e-08, + "EnergySource.x": 1.5522280002325312e-07, + "EnergySource.r0": 5.069596039676399e-08, + "EnergySource.x0": 1.5208788119029196e-07, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "a642d1eb-87ce-42df-b5ce-35bb5f9c5806", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ] + } + } + }, + "Conductor": { + "ACLineSegment": { + "ohline": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "a1b1ffe9-726f-4db4-9f4c-361d85a20e32", + "IdentifiedObject.name": "ohline", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'556mcm'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "15f418d3-1bf9-4e64-9580-3e4225a1459c", + "IdentifiedObject.name": "ohline_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "106352b3-12ae-4793-a934-8c26c9544b3d", + "IdentifiedObject.name": "ohline_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "0df805ac-88f5-4a4a-8c4e-1e106d004f31", + "IdentifiedObject.name": "ohline_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "abde4a1e-ea6e-466c-8809-bd27c2790cff", + "IdentifiedObject.name": "ohline_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "d7ea28c1-e041-45d3-b9db-820e23d6ec2f", + "IdentifiedObject.name": "ohline_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + }, + "quad": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "cc9c65a6-6195-45d3-86ea-e4195a8ce2c5", + "IdentifiedObject.name": "quad", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'4/0quad'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "314f40f6-1d4b-4f62-9441-ece3fc4d0338", + "IdentifiedObject.name": "quad_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "c0b7bcfa-2281-41f1-bf80-c67dcdfc9c59", + "IdentifiedObject.name": "quad_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "c14509f5-2901-451a-9da2-33ec6baff5e7", + "IdentifiedObject.name": "quad_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "7d18daf8-563d-4106-aeb2-b8dbeb7e6556", + "IdentifiedObject.name": "quad_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "4fe98fa1-175e-4009-b246-631838fe5047", + "IdentifiedObject.name": "quad_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + } + } + } + } + } + }, + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "4/0quad": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "e5604025-92d3-48a7-9ac7-eb9e4f620b87", + "IdentifiedObject.name": "4/0quad", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + } + ] + }, + "556mcm": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "24b81d74-a75f-4b71-8af8-e881c2136864", + "IdentifiedObject.name": "556mcm", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + } + ] + } + } + } + }, + "EnergyConnectionProfile": { + "Load::::::defaultload": { + "Ravens.cimObjectType": "EnergyConnectionProfile", + "IdentifiedObject.mRID": "50cab77c-b334-4448-932d-a1056b2a384d", + "IdentifiedObject.name": "Load::::::defaultload", + "EnergyConnectionProfile.dssSpectrum": "defaultload" + } + }, + "Versions": { + "IEC61970CIMVersion": { + "Ravens.cimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + }, + "RavensVersion": { + "Ravens.cimObjectType": "RavensVersion", + "RavensVersion.date": "2025-03-10", + "RavensVersion.version": "RAVENSv0.3.0-dev" + } + }, + "Location": { + "loadbus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "60644937-51dc-4b31-a2a7-8b9d78ab03a1", + "IdentifiedObject.name": "loadbus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "primary_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "72627437-8d03-4fbc-80ab-2d57e34bd115", + "IdentifiedObject.name": "primary_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "sourcebus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "ab3ac2d6-30d9-454a-ac71-82f6f70e021c", + "IdentifiedObject.name": "sourcebus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + } + }, + "OperationalLimitType": { + "lowType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "5b4f431e-a0f2-4f4d-8138-684413152f97", + "IdentifiedObject.name": "lowType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "highType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "5fe17911-6295-47c8-95f0-c9ef0ce84501", + "IdentifiedObject.name": "highType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "95cfc3c6-31b8-463c-a3fb-a2f4831ed87e", + "IdentifiedObject.name": "absoluteValueType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_86400.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "1bb7cc8e-0219-4893-9c92-c1ecdb8587fb", + "IdentifiedObject.name": "absoluteValueType_86400.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 86400.0 + } + }, + "ConnectivityNode": { + "loadbus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "16aebef9-3243-427a-bd9f-57f877c59c34", + "IdentifiedObject.name": "loadbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + }, + "primary": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "f01441bc-8fb7-4e17-9d4d-70a191de5e7f", + "IdentifiedObject.name": "primary", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + }, + "sourcebus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "2dc9aa38-76ef-4ede-a123-7e3aae193a6c", + "IdentifiedObject.name": "sourcebus" + } + }, + "BaseVoltage": { + "BaseV_0.4": { + "Ravens.cimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "79419d6e-b0a8-4127-9889-95978fa40de5", + "IdentifiedObject.name": "BaseV_0.4", + "BaseVoltage.nominalVoltage": 400.0 + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.cimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "dc0534be-b25d-45be-899f-27b258112328", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.pConstantPower": 100.0, + "LoadResponseCharacteristic.qConstantPower": 100.0 + } + } +} \ No newline at end of file diff --git a/test/data/ravens/ravens_case3_withgens_mn.json b/test/data/ravens/ravens_case3_withgens_mn.json new file mode 100644 index 000000000..38094716f --- /dev/null +++ b/test/data/ravens/ravens_case3_withgens_mn.json @@ -0,0 +1,737 @@ +{ + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "4/0quad": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "88bc7e59-e9ce-4600-a949-3e2cecbc2fda", + "IdentifiedObject.name": "4/0quad", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + } + ] + }, + "556mcm": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "d6879f7a-124f-4e82-987a-46f5ba3e2f9d", + "IdentifiedObject.name": "556mcm", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + } + ] + } + } + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "EnergyConnection": { + "RegulatingCondEq": { + "RotatingMachine": { + "gen2": { + "Ravens.CimObjectType": "SynchronousMachine", + "IdentifiedObject.mRID": "c657d8a1-32c2-402f-8403-9b06c112318a", + "IdentifiedObject.name": "gen2", + "RotatingMachine.p": 1000.0, + "RotatingMachine.q": 484.3221048378525, + "RotatingMachine.ratedS": 1200.0, + "RotatingMachine.ratedU": 461.88021535170066, + "Equipment.inService": true, + "RotatingMachine.ratedPowerFactor": 0.9, + "GeneratingUnit.minOperatingP": 0.0, + "GeneratingUnit.maxOperatingP": 1080.0, + "SynchronousMachine.maxQ": 523.0678732248807, + "SynchronousMachine.minQ": -523.0678732248807, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "012eb2d2-f4d8-4cc9-825f-b634c66e5d84", + "IdentifiedObject.name": "gen2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'" + } + ] + }, + "gen1": { + "Ravens.CimObjectType": "SynchronousMachine", + "IdentifiedObject.mRID": "3f2267a8-4f0c-4ac5-9415-8568d7d414b2", + "IdentifiedObject.name": "gen1", + "RotatingMachine.p": 2000.0, + "RotatingMachine.q": 968.644209675705, + "RotatingMachine.ratedS": 2400.0, + "RotatingMachine.ratedU": 461.88021535170066, + "Equipment.inService": true, + "RotatingMachine.ratedPowerFactor": 0.9, + "GeneratingUnit.minOperatingP": 0.0, + "GeneratingUnit.maxOperatingP": 2160.0, + "SynchronousMachine.maxQ": 1046.1357464497614, + "SynchronousMachine.minQ": -1046.1357464497614, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "20cd756e-faae-47d9-a177-b605e6ae55fb", + "IdentifiedObject.name": "gen1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ] + } + } + }, + "EnergySource": { + "source": { + "Ravens.CimObjectType": "EnergySource", + "IdentifiedObject.mRID": "494c011a-7640-4ed7-a3d5-2cd1a55413c0", + "IdentifiedObject.name": "source", + "EnergySource.nominalVoltage": 400.0, + "EnergySource.voltageMagnitude": 398.36, + "EnergySource.voltageAngle": 0.0, + "EnergySource.r": 3.880570000581328e-08, + "EnergySource.x": 1.5522280002325312e-07, + "EnergySource.r0": 5.069596039676399e-08, + "EnergySource.x0": 1.5208788119029196e-07, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "327a6ba6-06c2-40ff-a0cc-550dd50d824d", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ] + } + }, + "EnergyConsumer": { + "l2": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "f227af26-b8ae-47b3-97cc-4d1e5d6bbfd3", + "IdentifiedObject.name": "l2", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.Profile": "EnergyConsumerSchedule::'load_shape'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "9f8d612e-85f8-4757-9ff8-f9ae5947ddd8", + "IdentifiedObject.name": "l2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.B", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "f3cd189c-bd31-4fd4-beed-8967142aa0ea", + "IdentifiedObject.name": "l2_B", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.B" + } + ] + }, + "l1": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "8bff0407-deee-4f99-92fa-1dee4047621e", + "IdentifiedObject.name": "l1", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.Profile": "EnergyConsumerSchedule::'load_shape'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "4c93404d-1381-4fb2-b2db-36da5d6a0583", + "IdentifiedObject.name": "l1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.A", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "d4f8dc3a-8a95-4361-968a-1d841de4d7d1", + "IdentifiedObject.name": "l1_A", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.A" + } + ] + }, + "l3": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "f8e9430c-56a5-44c3-8b53-98464182dec3", + "IdentifiedObject.name": "l3", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "EnergyConsumer.Profile": "EnergyConsumerSchedule::'load_shape'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "ec5de9d0-8f3a-409c-afaa-5dd15969842f", + "IdentifiedObject.name": "l3_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.C", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "cdb85d03-72cd-4c1a-aa27-ee985895d65c", + "IdentifiedObject.name": "l3_C", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.C" + } + ] + } + } + }, + "Conductor": { + "ACLineSegment": { + "ohline": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "357e3f68-a996-4ef9-8e29-5a9701da50f5", + "IdentifiedObject.name": "ohline", + "Conductor.length": 1.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'556mcm'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "262a28c0-79c8-46f8-be2f-48baba94b09b", + "IdentifiedObject.name": "ohline_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "20c1e2b3-faab-4f16-9d28-1438cf5adc31", + "IdentifiedObject.name": "ohline_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "43a9f788-638f-48c5-9211-437795fad9da", + "IdentifiedObject.name": "ohline_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "939db8dd-1631-44e8-aa9d-cb391f06136d", + "IdentifiedObject.name": "ohline_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "8a764636-52d0-470f-abcd-9cee75f114de", + "IdentifiedObject.name": "ohline_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + }, + "quad": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "b0c876f2-8724-4b1d-9bb8-16ad6dc08866", + "IdentifiedObject.name": "quad", + "Conductor.length": 1.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'4/0quad'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "fba92277-7b25-42e3-8782-10e01ebf3ccf", + "IdentifiedObject.name": "quad_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "7a7bd627-5599-4139-bd71-a659a313fafc", + "IdentifiedObject.name": "quad_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "06ccbe19-290d-4808-8edb-40afc7e7c41e", + "IdentifiedObject.name": "quad_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "79df9209-3379-4ce7-bd5b-2f927daccd8a", + "IdentifiedObject.name": "quad_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "27dfc4e3-829a-4c4a-abb2-dab081e599c7", + "IdentifiedObject.name": "quad_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ] + } + } + } + } + } + }, + "OperationalLimitSet": { + "OpLimV_360.00000000000006-440.00000000000006": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "1fd3801e-4bc9-4995-a833-b8a934a51856", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "e2cbc64e-5a29-4df5-b214-f9ed9aa5cb5d", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAlow", + "VoltageLimit.value": 360.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "27d3baf8-3d5e-4465-9e84-3e52708211f1", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAhigh", + "VoltageLimit.value": 440.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + } + ] + }, + "OpLimV_380.0-420.00000000000006": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "35e30ea0-641e-43b7-a1e4-0e15e42334e1", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "cce047bb-3dc5-4f08-85ae-401c93562f34", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAhigh", + "VoltageLimit.value": 420.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "88c7ce0d-859b-4dda-bb25-64d33ba36831", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAlow", + "VoltageLimit.value": 380.0, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + } + ] + }, + "OpLimI_400.0_600.0": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "47ba5a2e-b0e0-469d-b456-b74d90a89598", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "ce6d7dcd-e426-44cb-ab33-9e8a6de1b60f", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + }, + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "a301065e-a50e-4dd7-856b-c7035e9ea52f", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + } + ] + } + }, + "Location": { + "primary_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "db2f0d86-da66-46ac-adc1-6eec717cf555", + "IdentifiedObject.name": "primary_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + }, + "loadbus_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "76056310-0c84-49e6-9d92-c0a3cce574e4", + "IdentifiedObject.name": "loadbus_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + }, + "sourcebus_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "4c73c3dd-7250-4f6a-af69-d203960b0a34", + "IdentifiedObject.name": "sourcebus_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + } + }, + "Versions": { + "IEC61970CIMVersion": { + "Ravens.CimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + } + }, + "ConnectivityNode": { + "loadbus": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "4ac8da05-a223-4bf6-b372-12c9479c495a", + "IdentifiedObject.name": "loadbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + }, + "primary": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "3e877b8a-ef33-4e18-8c80-1b05050bfc40", + "IdentifiedObject.name": "primary", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + }, + "sourcebus": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "d192d550-1fc0-489f-8e47-72209fa989e7", + "IdentifiedObject.name": "sourcebus" + } + }, + "OperationalLimitType": { + "absoluteValueType_86400.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "d60da1eb-6a60-41ba-99df-7313cad312fa", + "IdentifiedObject.name": "absoluteValueType_86400.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 86400.0 + }, + "highType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "a1a82ad0-e426-4ecb-816a-5a58f034756b", + "IdentifiedObject.name": "highType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "lowType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "1eaf0044-6272-4146-bf43-5c5310023469", + "IdentifiedObject.name": "lowType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "1a39544c-2df7-46a9-a6c0-cfb28ab6eaab", + "IdentifiedObject.name": "absoluteValueType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 5000000000.0 + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "777f5c7c-dea1-4a88-8db0-e5bd71a2fd4b", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantPower": 100 + } + }, + "BaseVoltage": { + "BaseV_0.4": { + "Ravens.CimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "93c27318-44cd-41b7-a873-f9001d1b831f", + "IdentifiedObject.name": "BaseV_0.4", + "BaseVoltage.nominalVoltage": 400.0 + } + }, + "BasicIntervalSchedule": { + "load_shape": { + "EnergyConsumerSchedule.startDay": "Monday", + "BasicIntervalSchedule.value2Multiplier": "k", + "BasicIntervalSchedule.value1Multiplier": "k", + "Ravens.cimObjectType": "EnergyConsumerSchedule", + "BasicIntervalSchedule.value2Unit": "VAr", + "BasicIntervalSchedule.value1Unit": "W", + "EnergyConsumerSchedule.RegularTimePoints": [ + { + "RegularTimePoint.sequenceNumber": 1, + "RegularTimePoint.value2": 2.85, + "RegularTimePoint.value1": 6.0 + }, + { + "RegularTimePoint.sequenceNumber": 2, + "RegularTimePoint.value2": 3.19, + "RegularTimePoint.value1": 6.5 + }, + { + "RegularTimePoint.sequenceNumber": 3, + "RegularTimePoint.value2": 2.85, + "RegularTimePoint.value1": 6.0 + }, + { + "RegularTimePoint.sequenceNumber": 4, + "RegularTimePoint.value2": 2.90, + "RegularTimePoint.value1": 5.7 + }, + { + "RegularTimePoint.sequenceNumber": 5, + "RegularTimePoint.value2": 3.10, + "RegularTimePoint.value1": 6.8 + }, + { + "RegularTimePoint.sequenceNumber": 6, + "RegularTimePoint.value2": 2.95, + "RegularTimePoint.value1": 5.9 + }, + { + "RegularTimePoint.sequenceNumber": 7, + "RegularTimePoint.value2": 3.01, + "RegularTimePoint.value1": 6.1 + }, + { + "RegularTimePoint.sequenceNumber": 8, + "RegularTimePoint.value2": 2.89, + "RegularTimePoint.value1": 7.0 + }, + { + "RegularTimePoint.sequenceNumber": 9, + "RegularTimePoint.value2": 3.18, + "RegularTimePoint.value1": 5.6 + }, + { + "RegularTimePoint.sequenceNumber": 10, + "RegularTimePoint.value2": 2.94, + "RegularTimePoint.value1": 7.8 + }, + { + "RegularTimePoint.sequenceNumber": 11, + "RegularTimePoint.value2": 3.05, + "RegularTimePoint.value1": 5.4 + }, + { + "RegularTimePoint.sequenceNumber": 12, + "RegularTimePoint.value2": 2.88, + "RegularTimePoint.value1": 7.3 + }, + { + "RegularTimePoint.sequenceNumber": 13, + "RegularTimePoint.value2": 3.02, + "RegularTimePoint.value1": 6.5 + }, + { + "RegularTimePoint.sequenceNumber": 14, + "RegularTimePoint.value2": 2.92, + "RegularTimePoint.value1": 7.2 + }, + { + "RegularTimePoint.sequenceNumber": 15, + "RegularTimePoint.value2": 3.00, + "RegularTimePoint.value1": 5.8 + }, + { + "RegularTimePoint.sequenceNumber": 16, + "RegularTimePoint.value2": 2.98, + "RegularTimePoint.value1": 7.4 + }, + { + "RegularTimePoint.sequenceNumber": 17, + "RegularTimePoint.value2": 3.03, + "RegularTimePoint.value1": 5.9 + }, + { + "RegularTimePoint.sequenceNumber": 18, + "RegularTimePoint.value2": 2.91, + "RegularTimePoint.value1": 7.1 + }, + { + "RegularTimePoint.sequenceNumber": 19, + "RegularTimePoint.value2": 3.06, + "RegularTimePoint.value1": 5.7 + }, + { + "RegularTimePoint.sequenceNumber": 20, + "RegularTimePoint.value2": 2.99, + "RegularTimePoint.value1": 6.0 + }, + { + "RegularTimePoint.sequenceNumber": 21, + "RegularTimePoint.value2": 3.08, + "RegularTimePoint.value1": 5.6 + }, + { + "RegularTimePoint.sequenceNumber": 22, + "RegularTimePoint.value2": 2.97, + "RegularTimePoint.value1": 7.0 + }, + { + "RegularTimePoint.sequenceNumber": 23, + "RegularTimePoint.value2": 3.09, + "RegularTimePoint.value1": 5.8 + }, + { + "RegularTimePoint.sequenceNumber": 24, + "RegularTimePoint.value2": 2.96, + "RegularTimePoint.value1": 7.2 + } + ], + "IdentifiedObject.mRID": "95941138-5523-4e82-9ffa-d19e6f6acf70", + "EnergyConsumerSchedule.timeStep": 3600 + } + } +} diff --git a/test/data/ravens/ravens_case3_withpvandstorage.json b/test/data/ravens/ravens_case3_withpvandstorage.json new file mode 100644 index 000000000..162666cf9 --- /dev/null +++ b/test/data/ravens/ravens_case3_withpvandstorage.json @@ -0,0 +1,640 @@ +{ + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "4/0quad": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "532a5afc-e4cd-4fe7-a502-82d27b2dded8", + "IdentifiedObject.name": "4/0quad", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + } + ] + }, + "556mcm": { + "Ravens.cimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "cd4a29d9-4833-4586-8d9f-a93692830710", + "IdentifiedObject.name": "556mcm", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.cimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + } + ] + } + } + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "Conductor": { + "ACLineSegment": { + "quad": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "34ed21be-4f28-4326-9367-dfb2582eb955", + "IdentifiedObject.name": "quad", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'4/0quad'", + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "7548f9ee-bed7-46a4-80ed-952553d75570", + "IdentifiedObject.name": "quad_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "c427163d-b3da-4ce5-b278-0184314823cc", + "IdentifiedObject.name": "quad_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "556d4c10-dd22-45b5-945a-2669206d7f35", + "IdentifiedObject.name": "quad_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "9128897b-7185-4b73-83ca-4667a4a7ff56", + "IdentifiedObject.name": "quad_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "4a34b29b-9977-4175-9f14-8b73d0c3b08d", + "IdentifiedObject.name": "quad_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ] + }, + "ohline": { + "Ravens.cimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "51e8b467-ed7a-4f32-abaa-e6048604637e", + "IdentifiedObject.name": "ohline", + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "Conductor.length": 1.0, + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'556mcm'", + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "991d4946-1c78-46c3-9273-ef94db49733c", + "IdentifiedObject.name": "ohline_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "e9634f6e-cb67-4124-b1f8-c8ba8e2801bb", + "IdentifiedObject.name": "ohline_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.cimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "70e033e8-c9bb-407d-a93b-b0aaa4de2aff", + "IdentifiedObject.name": "ohline_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "24957142-0907-4330-b662-2865da114bed", + "IdentifiedObject.name": "ohline_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + }, + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "26e7863d-d2ef-41f7-bcb8-d4aa3e4887f5", + "IdentifiedObject.name": "ohline_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimI_400.0_600.0'" + } + ] + } + } + }, + "EnergyConnection": { + "EnergyConsumer": { + "l1": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "673b14d9-552c-4da8-a872-c6d9f8d04647", + "IdentifiedObject.name": "l1", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "71e3be37-d17e-4f08-b989-5af569de81d2", + "IdentifiedObject.name": "l1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.A", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "73384992-664e-498e-9325-0a561b220d71", + "IdentifiedObject.name": "l1_A", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.A" + } + ] + }, + "l2": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "5dbbd6a1-fe55-4085-9c95-fafe7b60dcb8", + "IdentifiedObject.name": "l2", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "472c3167-f983-4be6-bf38-b45e30ee9bcc", + "IdentifiedObject.name": "l2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.B", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "50c7b891-cf25-4b1b-9fb8-d345606d915b", + "IdentifiedObject.name": "l2_B", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.B" + } + ] + }, + "l3": { + "Ravens.cimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "096ed9d0-a350-44a9-95d6-fb50b867dbd7", + "IdentifiedObject.name": "l3", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "036411ab-ea0c-4e3f-af4d-ac8ea9041a4a", + "IdentifiedObject.name": "l3_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.C", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.cimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "bd2ee194-f130-4ec0-8377-d307edd995a7", + "IdentifiedObject.name": "l3_C", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.C" + } + ] + } + }, + "RegulatingCondEq": { + "PowerElectronicsConnection": { + "pv1": { + "Ravens.cimObjectType": "PowerElectronicsConnection", + "IdentifiedObject.mRID": "82240357-1de0-4930-9da2-a042c55c2080", + "IdentifiedObject.name": "pv1", + "PowerElectronicsConnection.maxIFault": 1.1111111111111112, + "PowerElectronicsConnection.p": 9999.997590992734, + "PowerElectronicsConnection.q": -0.0016831415801767946, + "PowerElectronicsConnection.ratedS": 10000.0, + "PowerElectronicsConnection.ratedU": 400.0, + "PowerElectronicsConnection.maxQ": 10000.0, + "PowerElectronicsConnection.minQ": -10000.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "d0cb3693-8e80-42fe-83b7-84266f17b3f1", + "IdentifiedObject.name": "pv1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + } + ], + "PowerElectronicsConnection.PowerElectronicsUnit": { + "Ravens.cimObjectType": "PhotoVoltaicUnit", + "IdentifiedObject.mRID": "4dd3baeb-a830-448c-bede-267a947a5f3d", + "IdentifiedObject.name": "pv1_PVPanels", + "PowerElectronicsUnit.minP": 2000.0, + "PowerElectronicsUnit.maxP": 500000.0 + } + }, + "s1": { + "Ravens.cimObjectType": "PowerElectronicsConnection", + "IdentifiedObject.mRID": "619bff40-d23e-4422-8aa6-9e06c94ca055", + "IdentifiedObject.name": "s1", + "PowerElectronicsConnection.maxIFault": 1.1111111111111112, + "PowerElectronicsConnection.p": -0.0, + "PowerElectronicsConnection.q": -0.0, + "PowerElectronicsConnection.ratedS": 60000.0, + "PowerElectronicsConnection.ratedU": 400.0, + "PowerElectronicsConnection.maxQ": 25000.0, + "PowerElectronicsConnection.minQ": -25000.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "9c7322ed-2a5c-4add-944e-d371fc080ac1", + "IdentifiedObject.name": "s1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'", + "ACDCTerminal.OperationalLimitSet": "OperationalLimitSet::'OpLimV_360.00000000000006-440.00000000000006'" + } + ], + "PowerElectronicsConnection.PowerElectronicsUnit": { + "Ravens.cimObjectType": "BatteryUnit", + "IdentifiedObject.mRID": "f9e87072-5642-4a89-8f14-8138a9a72fbd", + "IdentifiedObject.name": "s1_Cells", + "PowerElectronicsUnit.minP": -48000.0, + "PowerElectronicsUnit.maxP": 36000.0, + "BatteryUnit.storedE": 6000.0, + "BatteryUnit.ratedE": 60000.0, + "BatteryUnit.BatteryUnitEfficiency": { + "Ravens.cimObjectType": "BatteryUnitEfficiency", + "BatteryUnitEfficiency.reserveEnergy": 20.0, + "BatteryUnitEfficiency.limitEnergy": 100.0, + "BatteryUnitEfficiency.efficiencyDischarge": 98.0, + "BatteryUnitEfficiency.efficiencyCharge": 95.0 + } + } + } + } + }, + "EnergySource": { + "source": { + "Ravens.cimObjectType": "EnergySource", + "IdentifiedObject.mRID": "0dad6066-d7fa-43ef-b4a7-4c26345b242b", + "IdentifiedObject.name": "source", + "EnergySource.nominalVoltage": 400.0, + "EnergySource.voltageMagnitude": 398.36, + "EnergySource.voltageAngle": 0.0, + "EnergySource.r": 3.880570000581328e-08, + "EnergySource.x": 1.5522280002325312e-07, + "EnergySource.r0": 5.069596039676399e-08, + "EnergySource.x0": 1.5208788119029196e-07, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.cimObjectType": "Terminal", + "IdentifiedObject.mRID": "9c96ce0e-c82a-4a7b-8f27-b6fcd97ba6ce", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ] + } + } + } + } + } + }, + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "b1d5198a-0a07-41bb-a990-775416c29909", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "70c15f39-01ef-4500-9138-382ea716e1c7", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + }, + { + "Ravens.cimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "71e23bab-fd7a-4528-a4fe-9fb27ad7a90b", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + } + ] + }, + "OpLimV_380.0-420.00000000000006": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "19191123-2aea-4717-978d-8bb88ce9d7b7", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "a18292e3-76c4-4f03-99e2-b8c920848fa6", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAlow", + "VoltageLimit.value": 380.0, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "78bba5c1-3498-4cad-83f3-be982608dd1f", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAhigh", + "VoltageLimit.value": 420.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + } + ] + }, + "OpLimV_360.00000000000006-440.00000000000006": { + "Ravens.cimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "82015c7d-be9a-4177-ad4b-8d42ce221f83", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "ea6856e9-952c-4101-bba3-2d82f189bd58", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAlow", + "VoltageLimit.value": 360.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + }, + { + "Ravens.cimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "acf94306-c465-4da7-9fb6-2b74ca85502e", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAhigh", + "VoltageLimit.value": 440.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + } + ] + } + }, + "Location": { + "loadbus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "0d920a83-4bc1-4d38-9130-949bfdd94adb", + "IdentifiedObject.name": "loadbus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "primary_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "c92d1246-2401-47ff-a3eb-433f1f3497f2", + "IdentifiedObject.name": "primary_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + }, + "sourcebus_Location": { + "Ravens.cimObjectType": "Location", + "IdentifiedObject.mRID": "98ab82b1-c19c-47de-95f0-46c86dedead3", + "IdentifiedObject.name": "sourcebus_Location", + "Location.PositionPoints": [ + { + "Ravens.cimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 0, + "PositionPoint.xPosition": "0.0", + "PositionPoint.yPosition": "0.0" + } + ] + } + }, + "Versions": { + "IEC61970CIMVersion": { + "Ravens.cimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + }, + "RavensVersion": { + "Ravens.cimObjectType": "RavensVersion", + "RavensVersion.date": "2025-03-10", + "RavensVersion.version": "RAVENSv0.3.0-dev" + } + }, + "EnergyConnectionProfile": { + "Load::::::defaultload": { + "Ravens.cimObjectType": "EnergyConnectionProfile", + "IdentifiedObject.mRID": "bbfe7b24-be64-40f5-b470-7b9a91e70e10", + "IdentifiedObject.name": "Load::::::defaultload", + "EnergyConnectionProfile.dssSpectrum": "defaultload" + } + }, + "OperationalLimitType": { + "absoluteValueType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "3dc9bb35-c022-43de-a24c-846838ed7322", + "IdentifiedObject.name": "absoluteValueType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_86400.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "b0603ff4-2f2a-4886-af77-a0de3a8c6346", + "IdentifiedObject.name": "absoluteValueType_86400.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 86400.0 + }, + "lowType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "d6567221-6669-4750-b09e-e346dfec213e", + "IdentifiedObject.name": "lowType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "highType_5000000000.0s": { + "Ravens.cimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "7d6d2a7b-bce7-4696-91d8-faa660c458b6", + "IdentifiedObject.name": "highType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration": 5000000000.0 + } + }, + "ConnectivityNode": { + "loadbus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "193ba930-8505-4feb-b824-7042f4c2cc9e", + "IdentifiedObject.name": "loadbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + }, + "primary": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "144607fb-7af7-4c65-b328-9dfb1225a38c", + "IdentifiedObject.name": "primary" + }, + "sourcebus": { + "Ravens.cimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "565090d8-b906-4e80-babf-63f8597a7fcd", + "IdentifiedObject.name": "sourcebus" + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.cimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "1e4cf027-4833-47f3-9566-8c891dea8926", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.pConstantPower": 100.0, + "LoadResponseCharacteristic.qConstantPower": 100.0 + } + }, + "BaseVoltage": { + "BaseV_0.4": { + "Ravens.cimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "55b47d8e-eca0-4fd4-a309-ecc81bdb6fa1", + "IdentifiedObject.name": "BaseV_0.4", + "BaseVoltage.nominalVoltage": 400.0 + } + } +} \ No newline at end of file diff --git a/test/data/ravens/ravens_case3_withsubxf.json b/test/data/ravens/ravens_case3_withsubxf.json new file mode 100644 index 000000000..6fc5d1d2b --- /dev/null +++ b/test/data/ravens/ravens_case3_withsubxf.json @@ -0,0 +1,836 @@ +{ + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "1e3d77af-8a23-466a-bdd9-39cee9f9fe92", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "fc496404-0ea3-49ad-a418-fb8b10aa2724", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_86400.0s'" + }, + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "33f3b868-cb9b-4223-b83c-e050cd47a7d0", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400.0, + "CurrentLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'absoluteValueType_5000000000.0s'" + } + ] + }, + "OpLimV_360.00000000000006-440.00000000000006": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "514c489d-6957-4739-bb9d-ff5da50e8f4e", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "513ecee1-8a86-4ced-b436-e4def25953cc", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAhigh", + "VoltageLimit.value": 440.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "e22b44ed-3b12-4bf9-8be3-a591a3cf732b", + "IdentifiedObject.name": "OpLimV_360.00000000000006-440.00000000000006_RangeAlow", + "VoltageLimit.value": 360.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + } + ] + }, + "OpLimV_380.0-420.00000000000006": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "5c5e7910-bdea-408b-9cba-c96967e39939", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "5f98e299-22cb-48a5-acd0-ba5404111eed", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAlow", + "VoltageLimit.value": 380.0, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'lowType_5000000000.0s'" + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "43fb3ee9-3b9a-4a7b-ace5-5ddcac6d59d5", + "IdentifiedObject.name": "OpLimV_380.0-420.00000000000006_RangeAhigh", + "VoltageLimit.value": 420.00000000000006, + "VoltageLimit.normalValue": 400.0, + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'highType_5000000000.0s'" + } + ] + }, + "OpLimV_7.2000": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_665DF148-4555-4F76-BFD4-71BA3D55F876", + "IdentifiedObject.name": "OpLimV_7.2000", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_69C733F4-2D96-47C2-B6AE-D7593EDAD548", + "IdentifiedObject.name": "OpLimV_7.2000_RangeAHi", + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'case3_balanced_RangeAHiType'", + "VoltageLimit.value": 7560, + "VoltageLimit.normalValue": 7200.0 + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_8133C550-DC0B-482E-ABCA-DA0038702079", + "IdentifiedObject.name": "OpLimV_7.2000_RangeALo", + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'case3_balanced_RangeALoType'", + "VoltageLimit.value": 6840, + "VoltageLimit.normalValue": 7200.0 + } + ] + }, + "OpLimI_1323.1_1804.2": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_433D75D6-4693-4413-9564-12E93A04ECC3", + "IdentifiedObject.name": "OpLimI_1323.1_1804.2", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_4180E9E9-AB79-4F18-8076-16E6FA4BB993", + "IdentifiedObject.name": "OpLimI_1323.1_1804.2_Norm", + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'case3_balanced_NormAmpsType'", + "CurrentLimit.value": 1323.0944, + "CurrentLimit.normalValue": 1323.0944 + }, + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_9102C72B-FAE2-4BB2-925E-36A755252B0A", + "IdentifiedObject.name": "OpLimI_1323.1_1804.2_Emerg", + "OperationalLimit.OperationalLimitType": "OperationalLimitType::'case3_balanced_EmergencyAmpsType'", + "CurrentLimit.value": 1804.2196, + "CurrentLimit.normalValue": 1323.0944 + } + ] + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "Conductor": { + "ACLineSegment": { + "ohline": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "e9c718d0-d75c-41cf-b31e-5d1467780362", + "IdentifiedObject.name": "ohline", + "Conductor.length": 1.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'556mcm'", + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "350fed0a-7395-4736-aa12-ac2d7e87ac92", + "IdentifiedObject.name": "ohline_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "3b5406ff-4fb5-4a30-8e2c-4f09db60a544", + "IdentifiedObject.name": "ohline_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "8d10892c-1893-4a48-8f5b-615fcb4c0d55", + "IdentifiedObject.name": "ohline_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "37415ad4-1071-481c-b741-06e6b8ca05d4", + "IdentifiedObject.name": "ohline_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'subxfbus'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "3bd4d2fc-d02b-4238-9630-83fe0b294662", + "IdentifiedObject.name": "ohline_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'" + } + ] + }, + "quad": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "edba552d-daee-40f3-9488-336f9c9231dc", + "IdentifiedObject.name": "quad", + "Conductor.length": 1.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'4/0quad'", + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "c087897c-8221-477a-b33b-59ed2ff423c7", + "IdentifiedObject.name": "quad_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "57c71971-b70b-49a2-868b-a64aceb3b031", + "IdentifiedObject.name": "quad_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2 + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "732aea91-11c1-4dcb-a9ed-45de010dde2f", + "IdentifiedObject.name": "quad_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3 + } + ], + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "82cce1dc-5fc1-4a98-9f53-2b347ed1d3b5", + "IdentifiedObject.name": "quad_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'primary'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "f0e02033-fa13-4ac4-b6cf-0e0444d72d18", + "IdentifiedObject.name": "quad_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ] + } + } + }, + "EnergyConnection": { + "EnergyConsumer": { + "l2": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "09b604b2-00d7-4a4e-994d-2f189ee9642b", + "IdentifiedObject.name": "l2", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "9b397420-cdcf-4127-85ae-73559a000953", + "IdentifiedObject.name": "l2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.B", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "03858c77-6453-407c-8119-da6a76508b59", + "IdentifiedObject.name": "l2_B", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.B" + } + ] + }, + "l3": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "f9667c10-e77a-4409-8099-072bfdce24e0", + "IdentifiedObject.name": "l3", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "18771bf2-42eb-4758-a101-0a92cb9508e5", + "IdentifiedObject.name": "l3_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.C", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "dbfde1f4-2422-4e65-933b-7b9d43a22cc7", + "IdentifiedObject.name": "l3_C", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.C" + } + ] + }, + "l1": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "089386b2-ecab-4d6f-ab32-12c2c5527ee5", + "IdentifiedObject.name": "l1", + "EnergyConsumer.p": 6000.0, + "EnergyConsumer.q": 3000.0, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.grounded": true, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "8db69196-5be7-4038-a656-c345313d6dcc", + "IdentifiedObject.name": "l1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.A", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "445afb26-9fca-40ff-9161-1fae6c0c1619", + "IdentifiedObject.name": "l1_A", + "EnergyConsumerPhase.p": 6000.0, + "EnergyConsumerPhase.q": 3000.0, + "EnergyConsumerPhase.phase": "SinglePhaseKind.A" + } + ] + } + }, + "EnergySource": { + "source": { + "Ravens.CimObjectType": "EnergySource", + "IdentifiedObject.mRID": "5181f211-4f84-4220-905d-ce5a2136c86b", + "IdentifiedObject.name": "source", + "EnergySource.nominalVoltage": 7200, + "EnergySource.voltageMagnitude": 7170.48, + "EnergySource.voltageAngle": 0.0, + "EnergySource.r": 1.2573047e-05, + "EnergySource.x": 5.0292187e-05, + "EnergySource.r0": 1.6425491e-05, + "EnergySource.x0": 4.9276474e-05, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_7.2000'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "f67ae006-bbc4-408b-90bc-ac62d33ce9d5", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ] + } + }, + "RegulatingCondEq": { + "PowerElectronicsConnection": { + "pv1": { + "Ravens.CimObjectType": "PowerElectronicsConnection", + "IdentifiedObject.mRID": "997cec18-9472-4c89-8fb7-6e7d8ca4d377", + "IdentifiedObject.name": "pv1", + "PowerElectronicsConnection.maxIFault": 1.1111111111111112, + "PowerElectronicsConnection.p": 9999.997590992734, + "PowerElectronicsConnection.q": -0.0016831415801767946, + "PowerElectronicsConnection.ratedS": 10000.0, + "PowerElectronicsConnection.ratedU": 400.0, + "PowerElectronicsConnection.maxQ": 10000.0, + "PowerElectronicsConnection.minQ": -10000.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "a1d1a18a-5c36-4804-8fc0-13f756823d19", + "IdentifiedObject.name": "pv1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "PowerElectronicsConnection.PowerElectronicsUnit": { + "Ravens.CimObjectType": "PhotoVoltaicUnit", + "IdentifiedObject.mRID": "24872726-129e-491f-83cc-74135a8432b4", + "IdentifiedObject.name": "pv1_PVPanels", + "PowerElectronicsUnit.minP": 2000.0, + "PowerElectronicsUnit.maxP": 500000.0 + } + }, + "s1": { + "Ravens.CimObjectType": "PowerElectronicsConnection", + "IdentifiedObject.mRID": "cb0d7d2e-e799-4aaf-bb04-5daf2bfb9a00", + "IdentifiedObject.name": "s1", + "PowerElectronicsConnection.maxIFault": 1.1111111111111112, + "PowerElectronicsConnection.p": -0.0, + "PowerElectronicsConnection.q": -0.0, + "PowerElectronicsConnection.ratedS": 60000.0, + "PowerElectronicsConnection.ratedU": 400.0, + "PowerElectronicsConnection.maxQ": 25000.0, + "PowerElectronicsConnection.minQ": -25000.0, + "Equipment.inService": true, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "6f75e791-02dc-496f-8117-106bef0e0700", + "IdentifiedObject.name": "s1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'loadbus'" + } + ], + "PowerElectronicsConnection.PowerElectronicsUnit": { + "Ravens.CimObjectType": "BatteryUnit", + "IdentifiedObject.mRID": "09908453-5eb9-4927-817a-0dd0a84e0f95", + "IdentifiedObject.name": "s1_Cells", + "PowerElectronicsUnit.minP": -60000.0, + "PowerElectronicsUnit.maxP": 60000.0, + "BatteryUnit.storedE": 6000.0, + "BatteryUnit.ratedE": 60000.0, + "InefficientBatteryUnit.reserveEnery": 20.0, + "InefficientBatteryUnit.limitEnergy": 100.0, + "InefficientBatteryUnit.efficiencyDischarge": 98.0, + "InefficientBatteryUnit.efficiencyCharge": 95.0 + } + } + } + } + }, + "PowerTransformer": { + "subxf": { + "Ravens.CimObjectType": "PowerTransformer", + "IdentifiedObject.mRID": "_B626B2F6-EC37-4A57-AF79-1DFC2973CC62", + "IdentifiedObject.name": "subxf", + "PowerTransformer.vectorGroup": "Yy", + "PowerSystemResource.Location": "Location::'subxf_Loc'", + "PowerTransformer.PowerTransformerEnd": [ + { + "Ravens.CimObjectType": "PowerTransformerEnd", + "IdentifiedObject.mRID": "_11C98A2D-4F3B-499F-9C93-997F5E6B6050", + "IdentifiedObject.name": "subxf_End_1", + "PowerTransformerEnd.ratedS": 15000000, + "PowerTransformerEnd.ratedU": 7200, + "PowerTransformerEnd.r": 1.728e-05, + "PowerTransformerEnd.connectionKind": "WindingConnection.Y", + "PowerTransformerEnd.phaseAngleClock": 0, + "TransformerEnd.endNumber": 1, + "TransformerEnd.grounded": "true", + "TransformerEnd.rground": 0, + "TransformerEnd.xground": 0, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_7.2000'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_16ECD631-0E7C-4CF8-BFBE-47B70741FBB5", + "IdentifiedObject.name": "subxf_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'sourcebus'" + } + ], + "TransformerEnd.CoreAdmittance": { + "Ravens.CimObjectType": "TransformerCoreAdmittance", + "IdentifiedObject.mRID": "_82EF01DC-693A-456D-80B7-88480B854940", + "IdentifiedObject.name": "subxf_Yc", + "TransformerCoreAdmittance.g": 0, + "TransformerCoreAdmittance.g0": 0, + "TransformerCoreAdmittance.b": 0, + "TransformerCoreAdmittance.b0": 0 + }, + "TransformerEnd.MeshImpedance": { + "Ravens.CimObjectType": "TransformerMeshImpedance", + "IdentifiedObject.mRID": "_C7842810-3C4F-495F-AD46-C3B29FF7727F", + "IdentifiedObject.name": "subxf_Zsc_1", + "TransformerMeshImpedance.r": 3.456e-05, + "TransformerMeshImpedance.r0": 3.456e-05, + "TransformerMeshImpedance.x": 0.0003456, + "TransformerMeshImpedance.x0": 0.0003456 + } + }, + { + "Ravens.CimObjectType": "PowerTransformerEnd", + "IdentifiedObject.mRID": "_A96426D2-9C2C-43D9-964F-A2F37B45368C", + "IdentifiedObject.name": "subxf_End_2", + "PowerTransformerEnd.ratedS": 15000000, + "PowerTransformerEnd.ratedU": 400, + "PowerTransformerEnd.r": 5.3333333e-08, + "PowerTransformerEnd.connectionKind": "WindingConnection.Y", + "PowerTransformerEnd.phaseAngleClock": 0, + "TransformerEnd.endNumber": 2, + "TransformerEnd.grounded": "true", + "TransformerEnd.rground": 0, + "TransformerEnd.xground": 0, + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_7D0ABC1E-3EA3-4532-8122-DA10A6B933FB", + "IdentifiedObject.name": "subxf_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.phases": "PhaseCode.ABC", + "Terminal.ConnectivityNode": "ConnectivityNode::'subxfbus'" + } + ], + "TransformerEnd.MeshImpedance": { + "Ravens.CimObjectType": "TransformerMeshImpedance", + "IdentifiedObject.mRID": "_C7842810-3C4F-495F-AD46-C3B29FF7727F", + "IdentifiedObject.name": "subxf_Zsc_1", + "TransformerMeshImpedance.r": 3.456e-05, + "TransformerMeshImpedance.r0": 3.456e-05, + "TransformerMeshImpedance.x": 0.0003456, + "TransformerMeshImpedance.x0": 0.0003456 + } + } + ] + } + } + } + } + }, + "Versions": { + "IEC61970CIMVersion": { + "Ravens.CimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + } + }, + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "4/0quad": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "a2ccef36-6f66-45e7-8db4-fdd9766d8c8d", + "IdentifiedObject.name": "4/0quad", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.0467, + "PhaseImpedanceData.x": 0.0267, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1167, + "PhaseImpedanceData.x": 0.0667, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + } + ] + }, + "556mcm": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "8a93bb2a-3217-48d0-b19b-ae8354399310", + "IdentifiedObject.name": "556mcm", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.1, + "PhaseImpedanceData.x": 0.0583, + "PhaseImpedanceData.b": 1.6000000000000003e-05 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.04, + "PhaseImpedanceData.x": 0.0233, + "PhaseImpedanceData.b": -0.0 + } + ] + } + } + } + }, + "Location": { + "primary_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "cd4c22b1-390a-48b4-ba9b-c5b0a6a13e79", + "IdentifiedObject.name": "primary_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + }, + "loadbus_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "1f628e25-f631-49b3-b43c-b8618559661c", + "IdentifiedObject.name": "loadbus_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + }, + "sourcebus_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "17d93d69-c091-40d2-8292-e9800154e3f9", + "IdentifiedObject.name": "sourcebus_Location", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0.0, + "PositionPoint.yPosition": 0.0 + } + ] + } + }, + "EnergyConnectionProfile": { + "Ravens.CimObjectType": "EnergyConnectionProfile", + "IdentifiedObject.mRID": "a7098736-cc57-4a69-b250-3101ae6dd9f5", + "IdentifiedObject.name": "Load::::::defaultload", + "EnergyConnectionProfile.dssSpectrum": "defaultload" + }, + "BaseVoltage": { + "BaseV_0.4": { + "Ravens.CimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "270f81bf-ab58-46e9-863a-08744d924604", + "IdentifiedObject.name": "BaseV_0.4", + "BaseVoltage.nominalVoltage": 400.0 + }, + "BaseV_7.2000": { + "Ravens.CimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "_200EDAAE-4DBD-4A69-9033-B4032B2270FE", + "IdentifiedObject.name": "BaseV_7.2000", + "BaseVoltage.nominalVoltage": 7200 + } + }, + "OperationalLimitType": { + "highType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "48f1510a-52d8-4c04-a0e7-59a8876eafa2", + "IdentifiedObject.name": "highType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "faf34841-2190-4133-bf8d-cf31f35a80a0", + "IdentifiedObject.name": "absoluteValueType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "absoluteValueType_86400.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "14a68643-2417-4e41-b809-940b9b1856d1", + "IdentifiedObject.name": "absoluteValueType_86400.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue", + "OperationalLimitType.acceptableDuration": 86400.0 + }, + "lowType_5000000000.0s": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "33ce2fce-d1cb-4df3-924f-0399aa127edd", + "IdentifiedObject.name": "lowType_5000000000.0s", + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low", + "OperationalLimitType.acceptableDuration": 5000000000.0 + }, + "case3_balanced_NormAmpsType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_F8347896-5AFD-4AD3-BDFB-C2B164917AB7", + "IdentifiedObject.name": "case3_balanced_NormAmpsType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + }, + "case3_balanced_EmergencyAmpsType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_65F6EC19-7482-49EA-8064-6F2E06BF9E28", + "IdentifiedObject.name": "case3_balanced_EmergencyAmpsType", + "OperationalLimitType.acceptableDuration": 7200, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + }, + "case3_balanced_RangeAHiType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_5B420D61-5A29-40E4-BFB8-7E4B7E0B4215", + "IdentifiedObject.name": "case3_balanced_RangeAHiType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high" + }, + "case3_balanced_RangeALoType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_C8B99699-7B9D-40AF-AEFB-E862D9A0109B", + "IdentifiedObject.name": "case3_balanced_RangeALoType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low" + } + }, + "ConnectivityNode": { + "loadbus": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "0f25fa64-77ce-4721-ad73-ecad9127fa2e", + "IdentifiedObject.name": "loadbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + }, + "sourcebus": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "e4ff4b6e-79fe-40b2-af40-e0226cf5f4a4", + "IdentifiedObject.name": "sourcebus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_7.2000'" + }, + "primary": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "cc97ba78-4f37-4d8f-8044-55f023a74a28", + "IdentifiedObject.name": "primary", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + }, + "subxfbus": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_FE727D13-2277-4F78-A5F2-FF1DF2FB8883", + "IdentifiedObject.name": "subxfbus", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_380.0-420.00000000000006'" + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "141f856d-53fd-4d9b-b71b-464b1db94318", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantPower": 100 + } + }, + "CoordinateSystem": { + "case3_balanced_CrsUrn": { + "Ravens.CimObjectType": "CoordinateSystem", + "IdentifiedObject.mRID": "_6FD1030A-4977-4961-A980-0E5A7F46D48A", + "IdentifiedObject.name": "case3_balanced_CrsUrn", + "CoordinateSystem.crsUrn": "OpenDSSLocalBusCoordinates" + } + }, + "Group": { + "GeographicalRegion": { + "case3_balanced_Region": { + "Ravens.CimObjectType": "GeographicalRegion", + "IdentifiedObject.mRID": "_2A0B22A1-CCB4-46F8-8F42-9090CA3B29AC", + "IdentifiedObject.name": "case3_balanced_Region" + } + }, + "SubGeographicalRegion": { + "case3_balanced_SubRegion": { + "Ravens.CimObjectType": "SubGeographicalRegion", + "IdentifiedObject.mRID": "_62CD9221-3F2B-4741-AF1B-16DED6354EEA", + "IdentifiedObject.name": "case3_balanced_SubRegion", + "SubGeographicalRegion.Region": "GeographicalRegion::'case3_balanced_Region'" + } + }, + "EquipmentContainer": { + "Ravens.CimObjectType": "Substation", + "IdentifiedObject.mRID": "_745276ED-1EDC-499C-9E0D-C9C138A9C49E", + "IdentifiedObject.name": "case3_balanced_Substation", + "PowerSystemResource.Location": "Location::'case3_balanced_Location'", + "Substation.Region": "SubGeographicalRegion::'case3_balanced_SubRegion'" + }, + "TopologicalIsland": { + "case3_balanced_Island": { + "Ravens.CimObjectType": "TopologicalIsland", + "IdentifiedObject.mRID": "_6A44C429-666A-4200-B3AE-10FCFDF8A04A", + "IdentifiedObject.name": "case3_balanced_Island" + } + } + } +} diff --git a/test/data/ravens/ravens_test_switch_1w.json b/test/data/ravens/ravens_test_switch_1w.json new file mode 100644 index 000000000..c2c8874b7 --- /dev/null +++ b/test/data/ravens/ravens_test_switch_1w.json @@ -0,0 +1,554 @@ +{ + "Versions": { + "IEC61970CIMVersion": { + "Ravens.CimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + } + }, + "CoordinateSystem": { + "test_CrsUrn": { + "Ravens.CimObjectType": "CoordinateSystem", + "IdentifiedObject.mRID": "_9EF37BD9-0C2D-4AE1-AE0F-B7B851E66544", + "IdentifiedObject.name": "test_CrsUrn", + "CoordinateSystem.crsUrn": "OpenDSSLocalBusCoordinates" + } + }, + "Group": { + "GeographicalRegion": { + "test_Region": { + "Ravens.CimObjectType": "GeographicalRegion", + "IdentifiedObject.mRID": "_90228F7F-5927-47CB-8796-8489A7068FC1", + "IdentifiedObject.name": "test_Region" + } + }, + "SubGeographicalRegion": { + "test_SubRegion": { + "Ravens.CimObjectType": "SubGeographicalRegion", + "IdentifiedObject.mRID": "_424DAD1E-F5F9-4573-B62A-6FDE7CD692C9", + "IdentifiedObject.name": "test_SubRegion", + "SubGeographicalRegion.Region": "GeographicalRegion::'test_Region'" + } + }, + "EquipmentContainer": { + "Ravens.CimObjectType": "Substation", + "IdentifiedObject.mRID": "_AD96408A-13FD-44CD-8441-D474E3744E1F", + "IdentifiedObject.name": "test_Substation", + "PowerSystemResource.Location": "Location::'test_Location'", + "Substation.Region": "SubGeographicalRegion::'test_SubRegion'" + }, + "TopologicalIsland": { + "test_Island": { + "Ravens.CimObjectType": "TopologicalIsland", + "IdentifiedObject.mRID": "_62B53E99-C000-4FEE-80CE-6F29110E1873", + "IdentifiedObject.name": "test_Island" + } + } + }, + "Location": { + "test_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_2B41D90F-6E55-496B-8BEA-23C7CD041DBF", + "IdentifiedObject.name": "test_Location", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'" + }, + "source_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_44C707B5-0B86-4815-9F65-A2D2F7BB0243", + "IdentifiedObject.name": "source_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "line1_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_52FB75B7-56B0-4F20-B2E2-6BF70AFB5E41", + "IdentifiedObject.name": "line1_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + }, + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 2, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "switch_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_1E0CF052-B39C-424B-B945-BF89267A5411", + "IdentifiedObject.name": "switch_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + }, + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 2, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "load1_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_2B553B02-E33C-4527-9A2C-FAF6741A8C90", + "IdentifiedObject.name": "load1_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + } + }, + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_89FAB3C8-F3EA-42D6-9FFB-C7218A5B700C", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_CCAE60BA-5D56-4F8F-8400-9A21902C2A9D", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_3F1940AC-91FD-4679-B727-9275063CCC2E", + "IdentifiedObject.name": "test_NormAmpsType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + }, + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_1AB18FDA-00CF-4A84-AB9E-D3EFF39464A5", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Emerg", + "CurrentLimit.value": 600, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_51A01C28-E11F-4684-8137-15D0140100D1", + "IdentifiedObject.name": "test_EmergencyAmpsType", + "OperationalLimitType.acceptableDuration": 7200, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + } + ] + }, + "OpLimV_0.4000": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_DC0A7C69-F8A9-4A07-B4B6-AA56A138CFED", + "IdentifiedObject.name": "OpLimV_0.4000", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_860EBBB7-81B5-45D5-9D15-EBDADB0903F9", + "IdentifiedObject.name": "OpLimV_0.4000_RangeAHi", + "VoltageLimit.value": 420, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_1CBA95F9-4F8F-4930-8376-94867399492F", + "IdentifiedObject.name": "test_RangeAHiType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_36431E54-2475-4280-8443-827DFD546DEC", + "IdentifiedObject.name": "OpLimV_0.4000_RangeALo", + "VoltageLimit.value": 380, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_EEBC518E-8B78-4C6B-8F85-2DF8C9C53C71", + "IdentifiedObject.name": "test_RangeALoType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_97FB217B-7289-4DCF-B690-67F2451EF298", + "IdentifiedObject.name": "OpLimV_0.4000_RangeBHi", + "VoltageLimit.value": 423.33332, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_FDABBB3E-12E8-4AD3-B1C9-43B35C5C57B3", + "IdentifiedObject.name": "test_RangeBHiType", + "OperationalLimitType.acceptableDuration": 86400, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_8106713D-D130-4A5D-80C2-42A8374B5BC3", + "IdentifiedObject.name": "OpLimV_0.4000_RangeBLo", + "VoltageLimit.value": 366.66668, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_BCFA3B34-0937-4455-B154-7233DAEE4310", + "IdentifiedObject.name": "test_RangeBLoType", + "OperationalLimitType.acceptableDuration": 86400, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low" + } + } + ] + } + }, + "BaseVoltage": { + "BaseV_0.4000": { + "Ravens.CimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "_46C78529-FF4F-40A8-841D-418D7D52BEFD", + "IdentifiedObject.name": "BaseV_0.4000", + "BaseVoltage.nominalVoltage": 400 + } + }, + "TopologicalNode": { + "b1": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_1D7153A2-9354-4542-8A08-F6FCF43002D1", + "IdentifiedObject.name": "b1", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + }, + "x1": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_B764BFB0-EEB1-4CFF-9BA5-894D76A00B8E", + "IdentifiedObject.name": "x1", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + }, + "x2": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_DE499DAA-E9D0-4EEC-8BAE-FB7E9A439230", + "IdentifiedObject.name": "x2", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + } + }, + "ConnectivityNode": { + "b1": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_DB090751-3E13-456A-A662-CF7D7C528C94", + "IdentifiedObject.name": "b1", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'b1'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + }, + "x1": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_6E6F3550-3BFB-4009-B76F-6693D5604960", + "IdentifiedObject.name": "x1", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'x1'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + }, + "x2": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_B1CC7BCB-0E9C-4246-8AC9-4BB6B0453256", + "IdentifiedObject.name": "x2", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'x2'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "EnergyConnection": { + "EnergySource": { + "source": { + "Ravens.CimObjectType": "EnergySource", + "IdentifiedObject.mRID": "_5CF553FD-BC94-4E9D-8B6D-D928BCF554A3", + "IdentifiedObject.name": "source", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "EnergySource.nominalVoltage": 400, + "EnergySource.voltageMagnitude": 400, + "EnergySource.voltageAngle": 0, + "EnergySource.r": 3.88057e-10, + "EnergySource.x": 1.552228e-09, + "EnergySource.r0": 5.069596e-10, + "EnergySource.x0": 1.5208788e-09, + "PowerSystemResource.Location": "Location::'source_Loc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_BB8461F8-A1E9-4D73-94E2-EB857395A8DF", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b1'" + } + ] + } + }, + "EnergyConsumer": { + "load1": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "_D322D86C-C523-48E9-B2AE-A5F57975536B", + "IdentifiedObject.name": "load1", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "EnergyConsumer.p": 4500, + "EnergyConsumer.q": 2179.4495, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.grounded": true, + "PowerSystemResource.Location": "Location::'load1_Loc'", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_37E125ED-75BE-4C31-8CFE-AC4A3C9E19D7", + "IdentifiedObject.name": "load1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'x2'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "_C8574EA9-6EB0-40F9-B051-3807FB0196FD", + "IdentifiedObject.name": "load1_B", + "EnergyConsumerPhase.phase": "SinglePhaseKind.B", + "EnergyConsumerPhase.p": 4500, + "EnergyConsumerPhase.q": 2179.4495, + "PowerSystemResource.Location": "Location::'load1_Loc'" + } + ] + } + } + }, + "Conductor": { + "ACLineSegment": { + "line1": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "_6B5FF69A-404A-4389-9FA1-F43943464A66", + "IdentifiedObject.name": "line1", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "Conductor.length": 500, + "PowerSystemResource.Location": "Location::'line1_Loc'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'z'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_B2950608-195A-4420-97AE-425C0B09A2C1", + "IdentifiedObject.name": "line1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b1'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_F1E9D575-D53F-4386-A904-929F0D7A44CE", + "IdentifiedObject.name": "line1_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.ConnectivityNode": "ConnectivityNode::'x1'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_B59AC09D-9E51-4585-B330-3A24C685CB8A", + "IdentifiedObject.name": "line1_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1, + "PowerSystemResource.Location": "Location::'line1_Loc'" + } + ] + } + } + }, + "Switch": { + "switch": { + "Ravens.CimObjectType": "LoadBreakSwitch", + "IdentifiedObject.mRID": "_25E1438A-99DB-46BB-B727-26C74AE79D60", + "IdentifiedObject.name": "switch", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "ProtectedSwitch.breakingCapacity": 400, + "Switch.ratedCurrent": 400, + "Switch.normalOpen": "false", + "Switch.open": "false", + "Switch.retained": "true", + "PowerSystemResource.Location": "Location::'switch_Loc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_9294CBC6-783E-4840-8196-357BFF6BA45A", + "IdentifiedObject.name": "switch_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'x1'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_E1443DD5-526D-47E3-A87A-0C1F0A9B2DDC", + "IdentifiedObject.name": "switch_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.ConnectivityNode": "ConnectivityNode::'x2'" + } + ], + "Switch.SwitchPhase": [ + { + "Ravens.CimObjectType": "SwitchPhase", + "IdentifiedObject.mRID": "_B7162222-1F35-4713-9A3A-8360A2205C64", + "IdentifiedObject.name": "switch_A", + "SwitchPhase.closed": "true", + "SwitchPhase.normalOpen": "false", + "SwitchPhase.phaseSide1": "SinglePhaseKind.A", + "SwitchPhase.phaseSide2": "SinglePhaseKind.B", + "PowerSystemResource.Location": "Location::'switch_Loc'" + } + ] + } + } + } + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_289E6326-E370-4C24-A190-53BFCC2C8848", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 100, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Constant Z": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_A48E7B14-EF00-4F4D-A66E-0A92D0D5FD79", + "IdentifiedObject.name": "Constant Z", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 100, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Motor": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_F9289DA6-1EE6-4075-A5BE-BA990ABA3B40", + "IdentifiedObject.name": "Motor", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Mix Motor/Res": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_EDC6EAFB-A22C-45F1-AF5C-9DE0CCAA51EC", + "IdentifiedObject.name": "Mix Motor/Res", + "LoadResponseCharacteristic.exponentModel": "true", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 1, + "LoadResponseCharacteristic.qVoltageExponent": 2, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Constant I": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_585ED09B-E47D-4EB9-9DB5-FD74719C3125", + "IdentifiedObject.name": "Constant I", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 100, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 100, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Variable P, Fixed Q": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_72B0F5AF-3B37-4467-82B5-C425210463B1", + "IdentifiedObject.name": "Variable P, Fixed Q", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 100, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Variable P, Fixed X": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_A5CAED93-49D2-4F4F-AD82-524C76A76AC5", + "IdentifiedObject.name": "Variable P, Fixed X", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + } + }, + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "z": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "_BF7B98AF-6218-4723-B7CA-A9F210A42553", + "IdentifiedObject.name": "z", + "PerLengthPhaseImpedance.conductorCount": 1, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.00022721762, + "PhaseImpedanceData.x": 0.00087932601, + "PhaseImpedanceData.b": 0 + } + ] + } + } + } + } +} diff --git a/test/data/ravens/ravens_test_switch_3w.json b/test/data/ravens/ravens_test_switch_3w.json new file mode 100644 index 000000000..0e4a1c99c --- /dev/null +++ b/test/data/ravens/ravens_test_switch_3w.json @@ -0,0 +1,785 @@ +{ + "Versions": { + "IEC61970CIMVersion": { + "Ravens.CimObjectType": "IEC61970CIMVersion", + "IEC61970CIMVersion.version": "IEC61970CIM100", + "IEC61970CIMVersion.date": "2019-04-01" + } + }, + "CoordinateSystem": { + "test_CrsUrn": { + "Ravens.CimObjectType": "CoordinateSystem", + "IdentifiedObject.mRID": "_9EF37BD9-0C2D-4AE1-AE0F-B7B851E66544", + "IdentifiedObject.name": "test_CrsUrn", + "CoordinateSystem.crsUrn": "OpenDSSLocalBusCoordinates" + } + }, + "Group": { + "GeographicalRegion": { + "test_Region": { + "Ravens.CimObjectType": "GeographicalRegion", + "IdentifiedObject.mRID": "_90228F7F-5927-47CB-8796-8489A7068FC1", + "IdentifiedObject.name": "test_Region" + } + }, + "SubGeographicalRegion": { + "test_SubRegion": { + "Ravens.CimObjectType": "SubGeographicalRegion", + "IdentifiedObject.mRID": "_424DAD1E-F5F9-4573-B62A-6FDE7CD692C9", + "IdentifiedObject.name": "test_SubRegion", + "SubGeographicalRegion.Region": "GeographicalRegion::'test_Region'" + } + }, + "EquipmentContainer": { + "Ravens.CimObjectType": "Substation", + "IdentifiedObject.mRID": "_AD96408A-13FD-44CD-8441-D474E3744E1F", + "IdentifiedObject.name": "test_Substation", + "PowerSystemResource.Location": "Location::'test_Location'", + "Substation.Region": "SubGeographicalRegion::'test_SubRegion'" + }, + "TopologicalIsland": { + "test_Island": { + "Ravens.CimObjectType": "TopologicalIsland", + "IdentifiedObject.mRID": "_62B53E99-C000-4FEE-80CE-6F29110E1873", + "IdentifiedObject.name": "test_Island" + } + } + }, + "Location": { + "test_Location": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_2B41D90F-6E55-496B-8BEA-23C7CD041DBF", + "IdentifiedObject.name": "test_Location", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'" + }, + "source_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_44C707B5-0B86-4815-9F65-A2D2F7BB0243", + "IdentifiedObject.name": "source_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "line1_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_52FB75B7-56B0-4F20-B2E2-6BF70AFB5E41", + "IdentifiedObject.name": "line1_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + }, + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 2, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "line2_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_BAD30397-D375-41B3-9540-9EEE6348178B", + "IdentifiedObject.name": "line2_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + }, + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 2, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "switch_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_1E0CF052-B39C-424B-B945-BF89267A5411", + "IdentifiedObject.name": "switch_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + }, + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 2, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + }, + "load1_Loc": { + "Ravens.CimObjectType": "Location", + "IdentifiedObject.mRID": "_2B553B02-E33C-4527-9A2C-FAF6741A8C90", + "IdentifiedObject.name": "load1_Loc", + "Location.CoordinateSystem": "CoordinateSystem::'test_CrsUrn'", + "Location.PositionPoints": [ + { + "Ravens.CimObjectType": "PositionPoint", + "PositionPoint.sequenceNumber": 1, + "PositionPoint.xPosition": 0, + "PositionPoint.yPosition": 0 + } + ] + } + }, + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_89FAB3C8-F3EA-42D6-9FFB-C7218A5B700C", + "IdentifiedObject.name": "OpLimI_400.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_CCAE60BA-5D56-4F8F-8400-9A21902C2A9D", + "IdentifiedObject.name": "OpLimI_400.0_600.0_Norm", + "CurrentLimit.value": 400, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_3F1940AC-91FD-4679-B727-9275063CCC2E", + "IdentifiedObject.name": "test_NormAmpsType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + }, + { + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_51A01C28-E11F-4684-8137-15D0140100D1", + "IdentifiedObject.name": "test_EmergencyAmpsType", + "OperationalLimitType.acceptableDuration": 7200, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + } + ] + }, + "OpLimI_325.0_600.0": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_16C3AE1B-6C4F-4EFF-82F5-320881E41F05", + "IdentifiedObject.name": "OpLimI_325.0_600.0", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_E570FFBB-3E31-4A1A-B409-276C80B48F06", + "IdentifiedObject.name": "OpLimI_325.0_600.0_Norm", + "CurrentLimit.value": 325, + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "OperationalLimitSet.OperationalLimitValue": [ + { + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_3F1940AC-91FD-4679-B727-9275063CCC2E", + "IdentifiedObject.name": "test_NormAmpsType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + } + ] + } + } + }, + { + "Ravens.CimObjectType": "CurrentLimit", + "IdentifiedObject.mRID": "_D1958AB8-9E7F-49E2-B1C9-891DC6F438C4", + "IdentifiedObject.name": "OpLimI_325.0_600.0_Emerg", + "CurrentLimit.value": 600, + "OperationalLimitSet": { + "OpLimI_400.0_600.0": { + "OperationalLimitSet.OperationalLimitValue": [ + { + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_51A01C28-E11F-4684-8137-15D0140100D1", + "IdentifiedObject.name": "test_EmergencyAmpsType", + "OperationalLimitType.acceptableDuration": 7200, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.absoluteValue" + } + } + ] + } + } + } + ] + }, + "OpLimV_0.4000": { + "Ravens.CimObjectType": "OperationalLimitSet", + "IdentifiedObject.mRID": "_DC0A7C69-F8A9-4A07-B4B6-AA56A138CFED", + "IdentifiedObject.name": "OpLimV_0.4000", + "OperationalLimitSet.OperationalLimitValue": [ + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_860EBBB7-81B5-45D5-9D15-EBDADB0903F9", + "IdentifiedObject.name": "OpLimV_0.4000_RangeAHi", + "VoltageLimit.value": 420, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_1CBA95F9-4F8F-4930-8376-94867399492F", + "IdentifiedObject.name": "test_RangeAHiType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_36431E54-2475-4280-8443-827DFD546DEC", + "IdentifiedObject.name": "OpLimV_0.4000_RangeALo", + "VoltageLimit.value": 380, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_EEBC518E-8B78-4C6B-8F85-2DF8C9C53C71", + "IdentifiedObject.name": "test_RangeALoType", + "OperationalLimitType.acceptableDuration": 5000000000.0, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_97FB217B-7289-4DCF-B690-67F2451EF298", + "IdentifiedObject.name": "OpLimV_0.4000_RangeBHi", + "VoltageLimit.value": 423.33332, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_FDABBB3E-12E8-4AD3-B1C9-43B35C5C57B3", + "IdentifiedObject.name": "test_RangeBHiType", + "OperationalLimitType.acceptableDuration": 86400, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.high" + } + }, + { + "Ravens.CimObjectType": "VoltageLimit", + "IdentifiedObject.mRID": "_8106713D-D130-4A5D-80C2-42A8374B5BC3", + "IdentifiedObject.name": "OpLimV_0.4000_RangeBLo", + "VoltageLimit.value": 366.66668, + "OperationalLimit.OperationalLimitType": { + "Ravens.CimObjectType": "OperationalLimitType", + "IdentifiedObject.mRID": "_BCFA3B34-0937-4455-B154-7233DAEE4310", + "IdentifiedObject.name": "test_RangeBLoType", + "OperationalLimitType.acceptableDuration": 86400, + "OperationalLimitType.direction": "OperationalLimitDirectionKind.low" + } + } + ] + } + }, + "BaseVoltage": { + "BaseV_0.4000": { + "Ravens.CimObjectType": "BaseVoltage", + "IdentifiedObject.mRID": "_46C78529-FF4F-40A8-841D-418D7D52BEFD", + "IdentifiedObject.name": "BaseV_0.4000", + "BaseVoltage.nominalVoltage": 400 + } + }, + "TopologicalNode": { + "b1": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_1D7153A2-9354-4542-8A08-F6FCF43002D1", + "IdentifiedObject.name": "b1", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + }, + "x1": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_B764BFB0-EEB1-4CFF-9BA5-894D76A00B8E", + "IdentifiedObject.name": "x1", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + }, + "x2": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_DE499DAA-E9D0-4EEC-8BAE-FB7E9A439230", + "IdentifiedObject.name": "x2", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + }, + "b2": { + "Ravens.CimObjectType": "TopologicalNode", + "IdentifiedObject.mRID": "_6D31F0A7-328F-482B-B800-E86BFE69E9F1", + "IdentifiedObject.name": "b2", + "TopologicalNode.TopologicalIsland": "TopologicalIsland::'test_Island'" + } + }, + "ConnectivityNode": { + "b1": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_3C23D8DF-C749-40CE-AB59-E9BCB6A51F6B", + "IdentifiedObject.name": "b1", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'b1'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + }, + "x1": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_3626FADA-426C-484F-8B69-5371B1EFF327", + "IdentifiedObject.name": "x1", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'x1'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + }, + "x2": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_59C1D3CF-5E4E-49CD-AEB3-4799F2383036", + "IdentifiedObject.name": "x2", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'x2'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + }, + "b2": { + "Ravens.CimObjectType": "ConnectivityNode", + "IdentifiedObject.mRID": "_58F5C3B9-8A22-4B99-BF8A-CF781597CAD5", + "IdentifiedObject.name": "b2", + "ConnectivityNode.TopologicalNode": "TopologicalNode::'b2'", + "ConnectivityNode.OperationalLimitSet": "OperationalLimitSet::'OpLimV_0.4000'" + } + }, + "PowerSystemResource": { + "Equipment": { + "ConductingEquipment": { + "EnergyConnection": { + "EnergySource": { + "source": { + "Ravens.CimObjectType": "EnergySource", + "IdentifiedObject.mRID": "_358FCE15-BEE2-42A8-A2EA-AD2BE89D86E5", + "IdentifiedObject.name": "source", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "EnergySource.nominalVoltage": 400, + "EnergySource.voltageMagnitude": 400, + "EnergySource.voltageAngle": 0, + "EnergySource.r": 3.88057e-10, + "EnergySource.x": 1.552228e-09, + "EnergySource.r0": 5.069596e-10, + "EnergySource.x0": 1.5208788e-09, + "PowerSystemResource.Location": "Location::'source_Loc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_BB8461F8-A1E9-4D73-94E2-EB857395A8DF", + "IdentifiedObject.name": "source_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b1'" + } + ] + } + }, + "EnergyConsumer": { + "load1": { + "Ravens.CimObjectType": "EnergyConsumer", + "IdentifiedObject.mRID": "_E8F49CFB-ECE7-4059-A6EE-4825FE7FFEFD", + "IdentifiedObject.name": "load1", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "EnergyConsumer.p": 4500, + "EnergyConsumer.q": 2179.4495, + "EnergyConsumer.customerCount": 1, + "EnergyConsumer.phaseConnection": "PhaseShuntConnectionKind.Y", + "EnergyConsumer.grounded": true, + "PowerSystemResource.Location": "Location::'load1_Loc'", + "EnergyConsumer.LoadResponse": "LoadResponseCharacteristic::'Constant kVA'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_37E125ED-75BE-4C31-8CFE-AC4A3C9E19D7", + "IdentifiedObject.name": "load1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b2'" + } + ], + "EnergyConsumer.EnergyConsumerPhase": [ + { + "Ravens.CimObjectType": "EnergyConsumerPhase", + "IdentifiedObject.mRID": "_D358F738-0512-45C7-BFAC-10639DD0CE55", + "IdentifiedObject.name": "load1_A", + "EnergyConsumerPhase.phase": "SinglePhaseKind.A", + "EnergyConsumerPhase.p": 4500, + "EnergyConsumerPhase.q": 2179.4495, + "PowerSystemResource.Location": "Location::'load1_Loc'" + } + ] + } + } + }, + "Conductor": { + "ACLineSegment": { + "line1": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "_7172CC52-4D06-433D-A057-3CD4899F1162", + "IdentifiedObject.name": "line1", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "Conductor.length": 500, + "PowerSystemResource.Location": "Location::'line1_Loc'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'zabc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_B2950608-195A-4420-97AE-425C0B09A2C1", + "IdentifiedObject.name": "line1_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b1'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_F1E9D575-D53F-4386-A904-929F0D7A44CE", + "IdentifiedObject.name": "line1_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.ConnectivityNode": "ConnectivityNode::'x1'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_B59AC09D-9E51-4585-B330-3A24C685CB8A", + "IdentifiedObject.name": "line1_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1, + "PowerSystemResource.Location": "Location::'line1_Loc'" + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_E93F91B2-E00F-417A-855A-B203615EF628", + "IdentifiedObject.name": "line1_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2, + "PowerSystemResource.Location": "Location::'line1_Loc'" + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_29601914-BE61-417C-A333-0AD243A0A9C2", + "IdentifiedObject.name": "line1_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3, + "PowerSystemResource.Location": "Location::'line1_Loc'" + } + ] + }, + "line2": { + "Ravens.CimObjectType": "ACLineSegment", + "IdentifiedObject.mRID": "_4BFECD8D-AB5A-4D82-BB7D-6AEAE0378878", + "IdentifiedObject.name": "line2", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "Conductor.length": 500, + "PowerSystemResource.Location": "Location::'line2_Loc'", + "ACLineSegment.PerLengthImpedance": "PerLengthPhaseImpedance::'zabc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_4308397E-D8AA-4109-9F42-AFB3095DEF49", + "IdentifiedObject.name": "line2_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'x2'" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_1FE3FC50-F1F6-4359-A291-27F931567289", + "IdentifiedObject.name": "line2_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.ConnectivityNode": "ConnectivityNode::'b2'" + } + ], + "ACLineSegment.ACLineSegmentPhase": [ + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_E7299BD3-2968-4C64-B698-F3E551AA8DC5", + "IdentifiedObject.name": "line2_A", + "ACLineSegmentPhase.phase": "SinglePhaseKind.A", + "ACLineSegmentPhase.sequenceNumber": 1, + "PowerSystemResource.Location": "Location::'line2_Loc'" + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_9156496B-AEBC-4632-81FB-D604FE43C564", + "IdentifiedObject.name": "line2_B", + "ACLineSegmentPhase.phase": "SinglePhaseKind.B", + "ACLineSegmentPhase.sequenceNumber": 2, + "PowerSystemResource.Location": "Location::'line2_Loc'" + }, + { + "Ravens.CimObjectType": "ACLineSegmentPhase", + "IdentifiedObject.mRID": "_1CFA79DC-393D-4F62-BE02-23EDA5542A72", + "IdentifiedObject.name": "line2_C", + "ACLineSegmentPhase.phase": "SinglePhaseKind.C", + "ACLineSegmentPhase.sequenceNumber": 3, + "PowerSystemResource.Location": "Location::'line2_Loc'" + } + ] + } + } + }, + "Switch": { + "switch": { + "Ravens.CimObjectType": "LoadBreakSwitch", + "IdentifiedObject.mRID": "_3E3C08FF-B3E1-44E7-B5EA-DB922C485D57", + "IdentifiedObject.name": "switch", + "ConductingEquipment.BaseVoltage": "BaseVoltage::'BaseV_0.4000'", + "ProtectedSwitch.breakingCapacity": 325, + "Switch.ratedCurrent": 325, + "Switch.normalOpen": "false", + "Switch.open": "false", + "Switch.retained": "true", + "PowerSystemResource.Location": "Location::'switch_Loc'", + "ConductingEquipment.Terminals": [ + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_9294CBC6-783E-4840-8196-357BFF6BA45A", + "IdentifiedObject.name": "switch_T1", + "ACDCTerminal.sequenceNumber": 1, + "Terminal.ConnectivityNode": "ConnectivityNode::'b1'", + "Terminal.phases": "PhaseCode.ABC" + }, + { + "Ravens.CimObjectType": "Terminal", + "IdentifiedObject.mRID": "_E1443DD5-526D-47E3-A87A-0C1F0A9B2DDC", + "IdentifiedObject.name": "switch_T2", + "ACDCTerminal.sequenceNumber": 2, + "Terminal.ConnectivityNode": "ConnectivityNode::'x2'", + "Terminal.phases": "PhaseCode.ABC" + } + ] + } + } + } + } + }, + "LoadResponseCharacteristic": { + "Constant kVA": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_289E6326-E370-4C24-A190-53BFCC2C8848", + "IdentifiedObject.name": "Constant kVA", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 100, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Constant Z": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_A48E7B14-EF00-4F4D-A66E-0A92D0D5FD79", + "IdentifiedObject.name": "Constant Z", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 100, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Motor": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_F9289DA6-1EE6-4075-A5BE-BA990ABA3B40", + "IdentifiedObject.name": "Motor", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Mix Motor/Res": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_EDC6EAFB-A22C-45F1-AF5C-9DE0CCAA51EC", + "IdentifiedObject.name": "Mix Motor/Res", + "LoadResponseCharacteristic.exponentModel": "true", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 1, + "LoadResponseCharacteristic.qVoltageExponent": 2, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Constant I": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_585ED09B-E47D-4EB9-9DB5-FD74719C3125", + "IdentifiedObject.name": "Constant I", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 100, + "LoadResponseCharacteristic.pConstantPower": 0, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 100, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Variable P, Fixed Q": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_72B0F5AF-3B37-4467-82B5-C425210463B1", + "IdentifiedObject.name": "Variable P, Fixed Q", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 0, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 100, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + }, + "Variable P, Fixed X": { + "Ravens.CimObjectType": "LoadResponseCharacteristic", + "IdentifiedObject.mRID": "_A5CAED93-49D2-4F4F-AD82-524C76A76AC5", + "IdentifiedObject.name": "Variable P, Fixed X", + "LoadResponseCharacteristic.exponentModel": "false", + "LoadResponseCharacteristic.pConstantImpedance": 0, + "LoadResponseCharacteristic.pConstantCurrent": 0, + "LoadResponseCharacteristic.pConstantPower": 100, + "LoadResponseCharacteristic.qConstantImpedance": 100, + "LoadResponseCharacteristic.qConstantCurrent": 0, + "LoadResponseCharacteristic.qConstantPower": 0, + "LoadResponseCharacteristic.pVoltageExponent": 0, + "LoadResponseCharacteristic.qVoltageExponent": 0, + "LoadResponseCharacteristic.pFrequencyExponent": 0, + "LoadResponseCharacteristic.qFrequencyExponent": 0 + } + }, + "PerLengthLineParameter": { + "PerLengthImpedance": { + "PerLengthPhaseImpedance": { + "zabc": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "_6DB02495-150A-479A-A9A5-8429B6E4DA8E", + "IdentifiedObject.name": "zabc", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0.00022721762, + "PhaseImpedanceData.x": 0.00087932601, + "PhaseImpedanceData.b": 0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 5.9217624e-05, + "PhaseImpedanceData.x": 0.00054106971, + "PhaseImpedanceData.b": 0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0.00022721762, + "PhaseImpedanceData.x": 0.00087932601, + "PhaseImpedanceData.b": 0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 5.9217624e-05, + "PhaseImpedanceData.x": 0.0004755458, + "PhaseImpedanceData.b": 0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 5.9217624e-05, + "PhaseImpedanceData.x": 0.00051653344, + "PhaseImpedanceData.b": 0 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 0.00022721762, + "PhaseImpedanceData.x": 0.00087932601, + "PhaseImpedanceData.b": 0 + } + ] + }, + "goab_disswitch_3_8_3_5": { + "Ravens.CimObjectType": "PerLengthPhaseImpedance", + "IdentifiedObject.mRID": "_E4EED264-402C-4DF0-A23D-0D289762C4A3", + "IdentifiedObject.name": "goab_disswitch_3_8_3_5", + "PerLengthPhaseImpedance.conductorCount": 3, + "PerLengthPhaseImpedance.PhaseImpedanceData": [ + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 1, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 1e-06, + "PhaseImpedanceData.x": 1e-06, + "PhaseImpedanceData.b": 1.3193042e-09 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0, + "PhaseImpedanceData.x": 0, + "PhaseImpedanceData.b": -4.1228239e-11 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 2, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 1e-06, + "PhaseImpedanceData.x": 1e-06, + "PhaseImpedanceData.b": 1.3193042e-09 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 1, + "PhaseImpedanceData.r": 0, + "PhaseImpedanceData.x": 0, + "PhaseImpedanceData.b": -4.1228239e-11 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 2, + "PhaseImpedanceData.r": 0, + "PhaseImpedanceData.x": 0, + "PhaseImpedanceData.b": -4.1228239e-11 + }, + { + "Ravens.CimObjectType": "PhaseImpedanceData", + "PhaseImpedanceData.row": 3, + "PhaseImpedanceData.column": 3, + "PhaseImpedanceData.r": 1e-06, + "PhaseImpedanceData.x": 1e-06, + "PhaseImpedanceData.b": 1.3193042e-09 + } + ] + } + } + } + } +} diff --git a/test/opf_ravens.jl b/test/opf_ravens.jl new file mode 100644 index 000000000..eacd32e8a --- /dev/null +++ b/test/opf_ravens.jl @@ -0,0 +1,82 @@ +@info "running optimal power flow (opf) tests using RAVENS data" + +@testset "test opf ravens" begin + + @testset "ravens case 3 with gens" begin + pmd_model = instantiate_mc_model_ravens(ravens_case3_withgens, ACPUPowerModel, build_mc_opf) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + + @testset "ravens case 3 with PV and storage" begin + pmd_model = instantiate_mc_model_ravens(ravens_case3_withpvandstorage, ACPUPowerModel, build_mc_opf) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + + @testset "ravens case 3 with subxf" begin + pmd_model = instantiate_mc_model_ravens(ravens_case3_withsubxf, ACPUPowerModel, build_mc_opf) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + + @testset "ravens case 3 with capacitor" begin + pmd_model = instantiate_mc_model_ravens(ravens_case3_withcap, ACPUPowerModel, build_mc_opf) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + + @testset "ravens test with switches 3w" begin + pmd_model = instantiate_mc_model_ravens(ravens_test_switch_3w, ACPUPowerModel, build_mc_opf) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + + # @testset "ravens test with switches 1w" begin + # pmd_model = instantiate_mc_model_ravens(ravens_test_switch_1w, ACPUPowerModel, build_mc_opf) + # result = optimize_model!( + # pmd_model, + # relax_integrality=false, + # optimizer=ipopt_solver, + # solution_processors=Function[] + # ) + # @test result["termination_status"] == LOCALLY_SOLVED + # end + + @testset "ravens case 3 with gens multinetwork" begin + pmd_model = instantiate_mc_model_ravens(ravens_case3_withgens_mn, ACPUPowerModel, build_mn_mc_opf; multinetwork=true) + result = optimize_model!( + pmd_model, + relax_integrality=false, + optimizer=ipopt_solver, + solution_processors=Function[] + ) + @test result["termination_status"] == LOCALLY_SOLVED + end + +end diff --git a/test/runtests.jl b/test/runtests.jl index 167b4f52b..405ce41dd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -66,4 +66,6 @@ include("test_cases.jl") include("en_pf_native_validation.jl") include("line_constants.jl") + + include("opf_ravens.jl") end diff --git a/test/test_cases.jl b/test/test_cases.jl index 1d3e03cb6..3ff2c6436 100644 --- a/test/test_cases.jl +++ b/test/test_cases.jl @@ -68,3 +68,12 @@ 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!]) + +# RAVENS +ravens_case3_withgens = parse_file("../test/data/ravens/ravens_case3_withgens.json") +ravens_case3_withpvandstorage = parse_file("../test/data/ravens/ravens_case3_withpvandstorage.json") +ravens_case3_withsubxf = parse_file("../test/data/ravens/ravens_case3_withsubxf.json") +ravens_case3_withcap = parse_file("../test/data/ravens/ravens_case3_withcap.json") +ravens_test_switch_3w = parse_file("../test/data/ravens/ravens_test_switch_3w.json") +# ravens_test_switch_1w = parse_file("../test/data/ravens/ravens_test_switch_1w.json") +ravens_case3_withgens_mn = parse_file("../test/data/ravens/ravens_case3_withgens_mn.json")