Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PSY4] Line rate and storage naming updates #95

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/definitions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder))))
const DATA_DIR =
joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-3.0-alpha2")
const DATA_DIR = "/Users/rhenriqu/PSY_Renaming/PowerSystemsTestData"
jd-lara marked this conversation as resolved.
Show resolved Hide resolved

const RTS_DIR = joinpath(LazyArtifacts.artifact"rts", "RTS-GMLC-0.2.2")

Expand Down
21 changes: 13 additions & 8 deletions src/library/psi_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,13 @@ function build_RTS_GMLC_DA_sys(; raw_data, kwargs...)
sys_kwargs = filter_kwargs(; kwargs...)
RTS_SRC_DIR = joinpath(raw_data, "RTS_Data", "SourceData")
RTS_SIIP_DIR = joinpath(raw_data, "RTS_Data", "FormattedData", "SIIP")
MAP_DIR = joinpath(DATA_DIR, "RTS_GMLC")
rawsys = PSY.PowerSystemTableData(
RTS_SRC_DIR,
100.0,
joinpath(RTS_SIIP_DIR, "user_descriptors.yaml");
timeseries_metadata_file = joinpath(RTS_SIIP_DIR, "timeseries_pointers.json"),
generator_mapping_file = joinpath(RTS_SIIP_DIR, "generator_mapping.yaml"),
generator_mapping_file = joinpath(MAP_DIR, "generator_mapping.yaml"),
)
resolution = get(sys_kwargs, :time_series_resolution, Dates.Hour(1))
sys = PSY.System(rawsys; time_series_resolution = resolution, sys_kwargs...)
Expand All @@ -418,12 +419,13 @@ function build_RTS_GMLC_RT_sys(; raw_data, kwargs...)
sys_kwargs = filter_kwargs(; kwargs...)
RTS_SRC_DIR = joinpath(raw_data, "RTS_Data", "SourceData")
RTS_SIIP_DIR = joinpath(raw_data, "RTS_Data", "FormattedData", "SIIP")
MAP_DIR = joinpath(DATA_DIR, "RTS_GMLC")
rawsys = PSY.PowerSystemTableData(
RTS_SRC_DIR,
100.0,
joinpath(RTS_SIIP_DIR, "user_descriptors.yaml");
timeseries_metadata_file = joinpath(RTS_SIIP_DIR, "timeseries_pointers.json"),
generator_mapping_file = joinpath(RTS_SIIP_DIR, "generator_mapping.yaml"),
generator_mapping_file = joinpath(MAP_DIR, "generator_mapping.yaml"),
)
resolution = get(sys_kwargs, :time_series_resolution, Dates.Minute(5))
sys = PSY.System(rawsys; time_series_resolution = resolution, sys_kwargs...)
Expand All @@ -437,12 +439,13 @@ function build_RTS_GMLC_DA_sys_noForecast(; raw_data, kwargs...)
sys_kwargs = filter_kwargs(; kwargs...)
RTS_SRC_DIR = joinpath(raw_data, "RTS_Data", "SourceData")
RTS_SIIP_DIR = joinpath(raw_data, "RTS_Data", "FormattedData", "SIIP")
MAP_DIR = joinpath(DATA_DIR, "RTS_GMLC")
rawsys = PSY.PowerSystemTableData(
RTS_SRC_DIR,
100.0,
joinpath(RTS_SIIP_DIR, "user_descriptors.yaml");
timeseries_metadata_file = joinpath(RTS_SIIP_DIR, "timeseries_pointers.json"),
generator_mapping_file = joinpath(RTS_SIIP_DIR, "generator_mapping.yaml"),
generator_mapping_file = joinpath(MAP_DIR, "generator_mapping.yaml"),
)
resolution = get(sys_kwargs, :time_series_resolution, Dates.Hour(1))
sys = PSY.System(rawsys; time_series_resolution = resolution, sys_kwargs...)
Expand All @@ -453,12 +456,13 @@ function build_RTS_GMLC_RT_sys_noForecast(; raw_data, kwargs...)
sys_kwargs = filter_kwargs(; kwargs...)
RTS_SRC_DIR = joinpath(raw_data, "RTS_Data", "SourceData")
RTS_SIIP_DIR = joinpath(raw_data, "RTS_Data", "FormattedData", "SIIP")
MAP_DIR = joinpath(DATA_DIR, "RTS_GMLC")
rawsys = PSY.PowerSystemTableData(
RTS_SRC_DIR,
100.0,
joinpath(RTS_SIIP_DIR, "user_descriptors.yaml");
timeseries_metadata_file = joinpath(RTS_SIIP_DIR, "timeseries_pointers.json"),
generator_mapping_file = joinpath(RTS_SIIP_DIR, "generator_mapping.yaml"),
generator_mapping_file = joinpath(MAP_DIR, "generator_mapping.yaml"),
)
resolution = get(sys_kwargs, :time_series_resolution, Dates.Minute(5))
sys = PSY.System(rawsys; time_series_resolution = resolution, sys_kwargs...)
Expand All @@ -472,6 +476,7 @@ function make_modified_RTS_GMLC_sys(
)
RTS_SRC_DIR = joinpath(raw_data, "RTS_Data", "SourceData")
RTS_SIIP_DIR = joinpath(raw_data, "RTS_Data", "FormattedData", "SIIP")
MAP_DIR = joinpath(DATA_DIR, "RTS_GMLC")
DISPATCH_INCREASE = 2.0
FIX_DECREASE = 0.3

Expand All @@ -480,7 +485,7 @@ function make_modified_RTS_GMLC_sys(
100.0,
joinpath(RTS_SIIP_DIR, "user_descriptors.yaml");
timeseries_metadata_file = joinpath(RTS_SIIP_DIR, "timeseries_pointers.json"),
generator_mapping_file = joinpath(RTS_SIIP_DIR, "generator_mapping.yaml"),
generator_mapping_file = joinpath(MAP_DIR, "generator_mapping.yaml"),
)

sys = PSY.System(rawsys; time_series_resolution = resolution, sys_kwargs...)
Expand Down Expand Up @@ -579,7 +584,7 @@ function make_modified_RTS_GMLC_sys(

for g in PSY.get_components(
x -> PSY.get_prime_mover_type(x) == PSY.PrimeMovers.PVe,
PSY.RenewableFix,
PSY.RenewableNonDispatch,
sys,
)
rat_ = PSY.get_rating(g)
Expand Down Expand Up @@ -1371,7 +1376,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line
r = 0.042,
x = 0.161,
b = (from = 0.022, to = 0.022),
rate = 1.75,
rating = 1.75,
# For now, not binding
flow_limits = (from_to = 2.0, to_from = 2.0),
angle_limits = (min = -1.57079, max = 1.57079),
Expand All @@ -1394,7 +1399,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line
remove_component!(main_sys, r)
end

for dev in get_components(RenewableFix, main_sys)
for dev in get_components(RenewableNonDispatch, main_sys)
clear_services!(dev)
end

Expand Down
4 changes: 2 additions & 2 deletions src/library/psid_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function build_psid_load_tutorial_omib(; raw_data, kwargs...)
bus = PSY.get_bus(l),
active_power = PSY.get_constant_active_power(l),
reactive_power = PSY.get_constant_reactive_power(l),
active_power_coefficient = 0.0, # Constant Power
reactive_power_coefficient = 0.0, # Constant Power
α = 0.0, # Constant Power
β = 0.0, # Constant Power
base_power = PSY.get_base_power(l),
max_active_power = PSY.get_max_constant_active_power(l),
max_reactive_power = PSY.get_max_constant_reactive_power(l),
Expand Down
46 changes: 27 additions & 19 deletions src/library/psitest_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2702,8 +2702,9 @@ function build_c_sys5_hybrid(; add_forecasts, raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = nodes[bus],
initial_energy = 5.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 5.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -2887,8 +2888,9 @@ function build_c_sys5_hybrid_uc(; add_forecasts, raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = nodes[bus],
initial_energy = 5.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 5.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3017,8 +3019,9 @@ function build_c_sys5_hybrid_ed(; add_forecasts, raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = nodes[bus],
initial_energy = 5.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 5.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3466,8 +3469,9 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = node,
initial_energy = 5.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 5.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3543,8 +3547,9 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = node,
initial_energy = 2.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 2.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3620,8 +3625,9 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = node,
initial_energy = 2.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 2.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3697,8 +3703,9 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = node,
initial_energy = 2.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 2.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3774,8 +3781,9 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = node,
initial_energy = 1.0,
state_of_charge_limits = (min = 0.10, max = 7.0),
storage_capacity = 7.0,
storage_level_limits = (min = 0.10 / 7.0, max = 7.0 / 7.0),
initial_storage_capacity_level = 2.0 / 7.0,
rating = 7.0,
active_power = 2.0,
input_active_power_limits = (min = 0.0, max = 2.0),
Expand Down Expand Up @@ -3989,7 +3997,7 @@ function build_c_sys5_radial(; raw_data, kwargs...)
r = 0.0,
x = 0.0281,
b = (from = 0.00356, to = 0.00356),
rate = 2.0,
rating = 2.0,
angle_limits = (min = -0.7, max = 0.7),
)

Expand All @@ -4003,7 +4011,7 @@ function build_c_sys5_radial(; raw_data, kwargs...)
r = 0.0,
x = 0.0281,
b = (from = 0.00356, to = 0.00356),
rate = 2.0,
rating = 2.0,
angle_limits = (min = -0.7, max = 0.7),
)

Expand Down Expand Up @@ -4125,7 +4133,7 @@ function build_two_area_pjm_DA(; add_forecasts, raw_data, sys_kwargs...)
available = true,
active_power_flow = 0.0,
reactive_power_flow = 0.0,
rate = 10.0,
rating = 10.0,
angle_limits = (-1.571, 1.571),
r = 0.003,
x = 0.03,
Expand Down
7 changes: 4 additions & 3 deletions src/library/psytest_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ function build_dynamic_inverter_sys(; kwargs...)
storage_technology_type = StorageTech.OTHER_CHEM,
available = true,
bus = nodes_OMIB[2],
initial_energy = 5.0,
state_of_charge_limits = (min = 5.0, max = 100.0),
storage_capacity = 100.0,
storage_level_limits = (min = 5.0 / 100.0, max = 100.0 / 100.0),
initial_storage_capacity_level = 5.0 / 100.0,
rating = 0.0275, #Value in per_unit of the system
active_power = 0.01375,
input_active_power_limits = (min = 0.0, max = 50.0),
Expand All @@ -207,7 +208,7 @@ function build_dynamic_inverter_sys(; kwargs...)
0.01, #resistance in pu
0.05, #reactance in pu
(from = 0.0, to = 0.0), #susceptance in pu
18.046, #rate in MW
18.046, #rating in MW
1.04,
),
] #angle limits (-min and max)
Expand Down
Loading