Skip to content

Commit 4fd336d

Browse files
committed
Debugging
1 parent 18eda9d commit 4fd336d

3 files changed

Lines changed: 28 additions & 17 deletions

File tree

src/multinode/multinode.jl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,7 @@ function ApplyLoadProfileToPMDModel(Multinode_Inputs, data_eng, PMD_number_of_ti
402402
"qd_nom"=> "normalized_load_profile"
403403
)
404404
end
405-
elseif Multinode_Inputs.number_of_phases in [2,3]
406-
print("Creating the PMD timeseries load framework for the outage model")
405+
elseif Multinode_Inputs.number_of_phases in [2,3]
407406
for p in combined_REopt_inputs
408407
node = p.s.site.node
409408
if node in REopt_nodes
@@ -447,7 +446,7 @@ function CreatePMDGenerators(Multinode_Inputs, data_eng, REopt_nodes; combined_R
447446
data_eng["generator"]["REopt_gen_node$(e)_phase$(phase)"] = Dict{String,Any}(
448447
"status" => PMD.ENABLED,
449448
"bus" => data_eng["load"]["load$(e)_phase$(phase)"]["bus"],
450-
"connections" => [data_eng["load"]["load$(e)_phase$(phase)"]["connections"][1], 4], # TODO: SHOULD THIS [1] BE "PHASE" HERE FOR MULTIPHASE? It looks like not. # Note: From PMD tutorial: "create a generator with the same connection setting."
449+
"connections" => [data_eng["load"]["load$(e)_phase$(phase)"]["connections"][1], 4], # data_eng["load"]["load$(e)_phase$(phase)"]["connections"][1] will show the phase connection for that load. Does this only work with single phase loads? Note: From PMD tutorial: "create a generator with the same connection setting."
451450
"configuration" => WYE,
452451
)
453452
end
@@ -470,6 +469,8 @@ function Create_PMD_Model_For_REopt_Integration(Multinode_Inputs, PMD_number_of_
470469
throw(@error("The PMD_network_input input format is not valid"))
471470
end
472471

472+
@info "Completed parsing the .dss file"
473+
473474
REopt_nodes = REopt.GenerateREoptNodesList(Multinode_Inputs) # Generate a list of the REopt nodes
474475

475476
ApplyDataEngSettings(data_eng, Multinode_Inputs)
@@ -480,11 +481,12 @@ function Create_PMD_Model_For_REopt_Integration(Multinode_Inputs, PMD_number_of_
480481

481482
data_math_mn = transform_data_model(data_eng, multinetwork=true) # Transforming the engineering model to a mathematical model in PMD
482483

483-
# Initialize voltage variable values.
484+
# Initialize voltage variable values:
485+
@info "running add_start_vrvi"
484486
Start_vrvi = now()
485487
add_start_vrvi!(data_math_mn)
486488
End_vrvi = now()
487-
489+
488490
# Measure and report the time for initializing the voltage variable values
489491
PMD_vrvi_time = End_vrvi - Start_vrvi
490492
PMD_vrvi_time_minutes = round(PMD_vrvi_time/Millisecond(60000), digits=2)
@@ -1163,21 +1165,26 @@ function RunDataChecks(Multinode_Inputs, REopt_dictionary)
11631165
if p.s.settings.time_steps_per_hour != Multinode_Inputs.time_steps_per_hour
11641166
throw(@error("The time steps per hour for each REopt node must match the time steps per hour defined in the multinode settings dictionary"))
11651167
end
1166-
1167-
if Multinode_Inputs.critical_load_method == "Fraction"
1168-
if string(p.s.site.node) keys(Multinode_Inputs.critical_load_fraction)
1169-
if sum(p.s.electric_load.loads_kw) > 0
1170-
throw(@error("The REopt node $(node_temp) does not have an assigned critical load fraction in the critical_load_fraction input dictionary"))
1168+
1169+
# Checking that critical loads are defined, if running a resilience model
1170+
if Multinode_Inputs.model_outages_with_outages_vector || ((Multinode_Inputs.single_outage_end_time_step - Multinode_Inputs.single_outage_start_time_step) > 0 )
1171+
1172+
if Multinode_Inputs.critical_load_method == "Fraction"
1173+
if string(p.s.site.node) keys(Multinode_Inputs.critical_load_fraction)
1174+
if sum(p.s.electric_load.loads_kw) > 0
1175+
throw(@error("The REopt node $(node_temp) does not have an assigned critical load fraction in the critical_load_fraction input dictionary"))
1176+
end
11711177
end
11721178
end
1173-
end
11741179

1175-
if Multinode_Inputs.critical_load_method == "TimeSeries"
1176-
if string(p.s.site.node) keys(Multinode_Inputs.critical_load_timeseries)
1177-
if sum(p.s.electric_load.loads_kw) > 0
1178-
throw(@error("The REopt node $(node_temp) does not have an assigned critical load timeseries profile in the critical_load_timeseries input dictionary"))
1180+
if Multinode_Inputs.critical_load_method == "TimeSeries"
1181+
if string(p.s.site.node) keys(Multinode_Inputs.critical_load_timeseries)
1182+
if sum(p.s.electric_load.loads_kw) > 0
1183+
throw(@error("The REopt node $(node_temp) does not have an assigned critical load timeseries profile in the critical_load_timeseries input dictionary"))
1184+
end
11791185
end
11801186
end
1187+
11811188
end
11821189
# TODO: add data check to ensure that if a critical load method is defined, then there must be either a critical load fraction or a critical load timeseries dictionary
11831190

src/multinode/multinode_results_processing.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ function Results_Processing_REopt_PMD_Model(m, results, data_math_mn, REoptInput
3939
line_upgrades = "N/A"
4040
end
4141

42-
DataDictionaryForEachNodeForOutageSimulator = REopt.GenerateInputsForOutageSimulator(Multinode_Inputs, REopt_results)
42+
if Multinode_Inputs.run_outage_simulator
43+
DataDictionaryForEachNodeForOutageSimulator = REopt.GenerateInputsForOutageSimulator(Multinode_Inputs, REopt_results)
44+
else
45+
DataDictionaryForEachNodeForOutageSimulator = "N/A"
46+
end
4347

4448
if Multinode_Inputs.model_subtype == "LPUBFDiagPowerModel"
4549
pf_name = "pf"

test/scenarios/multinode_powerflow.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)