From e1d61ada01e13bb77ea24d2eacfabd5ccd490acc Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 15 May 2024 13:00:03 -0600 Subject: [PATCH 1/7] update storage --- src/library/psi_library.jl | 2 +- src/library/psitest_library.jl | 8 ++++---- src/library/psytest_library.jl | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/library/psi_library.jl b/src/library/psi_library.jl index 54dbdda6..790535dd 100644 --- a/src/library/psi_library.jl +++ b/src/library/psi_library.jl @@ -1381,7 +1381,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line PSY.add_component!(main_sys, new_ACLine) end - for bat in get_components(GenericBattery, main_sys) + for bat in get_components(EnergyReservoirStorage, main_sys) set_base_power!(bat, get_base_power(bat) * 10) end diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 6530a470..6a19265c 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -747,18 +747,18 @@ function build_c_sys5_bat(; PSY.add_service!( c_sys5_bat, reserve_bat[1], - PSY.get_components(PSY.GenericBattery, c_sys5_bat), + PSY.get_components(PSY.EnergyReservoirStorage, c_sys5_bat), ) PSY.add_service!( c_sys5_bat, reserve_bat[2], - PSY.get_components(PSY.GenericBattery, c_sys5_bat), + PSY.get_components(PSY.EnergyReservoirStorage, c_sys5_bat), ) # ORDC PSY.add_service!( c_sys5_bat, reserve_bat[3], - PSY.get_components(PSY.GenericBattery, c_sys5_bat), + PSY.get_components(PSY.EnergyReservoirStorage, c_sys5_bat), ) for (ix, serv) in enumerate(PSY.get_components(PSY.VariableReserve, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeSeries.TimeArray}() @@ -2496,7 +2496,7 @@ function build_test_RTS_GMLC_sys_with_hybrid(; raw_data, add_forecasts, kwargs.. thermal_unit = first(get_components(ThermalStandard, sys)) bus = get_bus(thermal_unit) electric_load = first(get_components(PowerLoad, sys)) - storage = first(get_components(GenericBattery, sys)) + storage = first(get_components(EnergyReservoirStorage, sys)) renewable_unit = first(get_components(RenewableDispatch, sys)) name = "Test H" diff --git a/src/library/psytest_library.jl b/src/library/psytest_library.jl index e441cfe2..ff8b1c8f 100644 --- a/src/library/psytest_library.jl +++ b/src/library/psytest_library.jl @@ -175,9 +175,10 @@ function build_dynamic_inverter_sys(; kwargs...) ), ] - battery = PSY.GenericBattery(; + battery = PSY.EnergyReservoirStorage(; name = "Battery", prime_mover_type = PSY.PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = nodes_OMIB[2], initial_energy = 5.0, From 995d5ed83593e85c94bf83b5d13b8228b3c8f953 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 15 May 2024 13:11:38 -0600 Subject: [PATCH 2/7] rename storage --- src/library/psitest_library.jl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 6a19265c..03070d21 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -2563,7 +2563,7 @@ function build_c_sys5_bat_ems(; Deterministic("max_active_power", forecast_data), ) end - for (ix, r) in enumerate(get_components(PSY.BatteryEMS, c_sys5_bat)) + for (ix, r) in enumerate(get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeArray}() for t in 1:2 ini_time = timestamp(storage_target_DA[t][1])[1] @@ -2593,7 +2593,7 @@ function build_c_sys5_bat_ems(; ), ) end - for (ix, b) in enumerate(PSY.get_components(PSY.BatteryEMS, c_sys5_bat)) + for (ix, b) in enumerate(PSY.get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) PSY.add_time_series!( c_sys5_bat, b, @@ -2606,10 +2606,10 @@ function build_c_sys5_bat_ems(; end if add_reserves reserve_bat = reserve5_re(get_components(RenewableDispatch, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[1], get_components(PSY.BatteryEMS, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[2], get_components(PSY.BatteryEMS, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[1], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[2], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) # ORDC - add_service!(c_sys5_bat, reserve_bat[3], get_components(PSY.BatteryEMS, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[3], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) for (ix, serv) in enumerate(get_components(VariableReserve, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeArray}() for t in 1:2 @@ -2684,7 +2684,7 @@ function build_c_sys5_hybrid(; add_forecasts, raw_data, kwargs...) thermals = thermal_generators5(nodes) loads = loads5(nodes) renewables = renewable_generators5(nodes) - _battery(nodes, bus, name) = PSY.BatteryEMS(; + _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; name = name, prime_mover_type = PrimeMovers.BA, available = true, @@ -2868,7 +2868,7 @@ function build_c_sys5_hybrid_uc(; add_forecasts, raw_data, kwargs...) loads = loads5(nodes) renewables = renewable_generators5(nodes) branches = branches5(nodes) - _battery(nodes, bus, name) = PSY.BatteryEMS(; + _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; name = name, prime_mover_type = PrimeMovers.BA, available = true, @@ -2997,7 +2997,7 @@ function build_c_sys5_hybrid_ed(; add_forecasts, raw_data, kwargs...) loads = loads5(nodes) branches = branches5(nodes) renewables = renewable_generators5(nodes) - _battery(nodes, bus, name) = PSY.BatteryEMS(; + _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; name = name, prime_mover_type = PrimeMovers.BA, available = true, @@ -3445,7 +3445,7 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.BatteryEMS(; + batt = PSY.EnergyStorageReservoir(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3521,7 +3521,7 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.BatteryEMS(; + batt = PSY.EnergyStorageReservoir(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3597,7 +3597,7 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.BatteryEMS(; + batt = PSY.EnergyStorageReservoir(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3673,7 +3673,7 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.BatteryEMS(; + batt = PSY.EnergyStorageReservoir(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3749,7 +3749,7 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.BatteryEMS(; + batt = PSY.EnergyStorageReservoir(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, From 9cae4a594f5dbd98fc481fcf7dfe55158cc2b0ad Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 15 May 2024 13:32:57 -0600 Subject: [PATCH 3/7] fix replace of storage name --- src/library/psitest_library.jl | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 03070d21..fc5d5a90 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -2563,7 +2563,7 @@ function build_c_sys5_bat_ems(; Deterministic("max_active_power", forecast_data), ) end - for (ix, r) in enumerate(get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) + for (ix, r) in enumerate(get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeArray}() for t in 1:2 ini_time = timestamp(storage_target_DA[t][1])[1] @@ -2593,7 +2593,7 @@ function build_c_sys5_bat_ems(; ), ) end - for (ix, b) in enumerate(PSY.get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) + for (ix, b) in enumerate(PSY.get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) PSY.add_time_series!( c_sys5_bat, b, @@ -2606,10 +2606,10 @@ function build_c_sys5_bat_ems(; end if add_reserves reserve_bat = reserve5_re(get_components(RenewableDispatch, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[1], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[2], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[1], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[2], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) # ORDC - add_service!(c_sys5_bat, reserve_bat[3], get_components(PSY.EnergyStorageReservoir, c_sys5_bat)) + add_service!(c_sys5_bat, reserve_bat[3], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) for (ix, serv) in enumerate(get_components(VariableReserve, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeArray}() for t in 1:2 @@ -2684,9 +2684,10 @@ function build_c_sys5_hybrid(; add_forecasts, raw_data, kwargs...) thermals = thermal_generators5(nodes) loads = loads5(nodes) renewables = renewable_generators5(nodes) - _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; + _battery(nodes, bus, name) = PSY.EnergyReservoirStorage(; name = name, prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -2868,7 +2869,7 @@ function build_c_sys5_hybrid_uc(; add_forecasts, raw_data, kwargs...) loads = loads5(nodes) renewables = renewable_generators5(nodes) branches = branches5(nodes) - _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; + _battery(nodes, bus, name) = PSY.EnergyReservoirStorage(; name = name, prime_mover_type = PrimeMovers.BA, available = true, @@ -2997,7 +2998,7 @@ function build_c_sys5_hybrid_ed(; add_forecasts, raw_data, kwargs...) loads = loads5(nodes) branches = branches5(nodes) renewables = renewable_generators5(nodes) - _battery(nodes, bus, name) = PSY.EnergyStorageReservoir(; + _battery(nodes, bus, name) = PSY.EnergyReservoirStorage(; name = name, prime_mover_type = PrimeMovers.BA, available = true, @@ -3445,7 +3446,7 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.EnergyStorageReservoir(; + batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3521,7 +3522,7 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.EnergyStorageReservoir(; + batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3597,7 +3598,7 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.EnergyStorageReservoir(; + batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3673,7 +3674,7 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.EnergyStorageReservoir(; + batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, @@ -3749,7 +3750,7 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...) 100.0, ) - batt = PSY.EnergyStorageReservoir(; + batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, available = true, From 74bb925c38a8a42b782289ecb3b8308a9e426d84 Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Wed, 15 May 2024 16:56:17 -0600 Subject: [PATCH 4/7] Fix parsing of keyword arguments --- src/build_system.jl | 47 ++++++++--------------------------- src/definitions.jl | 1 - src/system_descriptor.jl | 28 ++++++++++++++++++--- src/system_descriptor_data.jl | 4 --- src/utils/utils.jl | 5 ---- test/test_psidtestsystems.jl | 2 +- 6 files changed, 35 insertions(+), 52 deletions(-) diff --git a/src/build_system.jl b/src/build_system.jl index a29452a5..cd3cd01c 100644 --- a/src/build_system.jl +++ b/src/build_system.jl @@ -25,47 +25,22 @@ function build_system( ) sys_descriptor = get_system_descriptor(category, system_catalog, name) sys_kwargs = filter_kwargs(; kwargs...) - sys_keys = keys(sys_kwargs) - - psid_kwargs = check_kwargs_psid(; kwargs...) - psid_keys = keys(psid_kwargs) - - case_keys = get_supported_argument_names(sys_descriptor) - - if !(isempty(intersect(sys_keys, psid_keys))) - error( - "sys_keys and psid_keys have the overlapping key(s): $(intersect(sys_keys, psid_keys))", - ) + case_kwargs = filter_descriptor_kwargs(sys_descriptor; kwargs...) + if length(kwargs) > length(sys_kwargs) + length(case_kwargs) + unexpected = setdiff(keys(kwargs), union(keys(sys_kwargs), keys(case_kwargs))) + error("These keyword arguments are not supported: $unexpected") end - if !(isempty(intersect(sys_keys, case_keys))) - error( - "sys_keys and case_keys have the overlapping key(s): $(intersect(sys_keys, psid_keys))", - ) + duplicates = intersect(keys(sys_kwargs), keys(case_kwargs)) + if !isempty(duplicates) + error("System kwargs and case kwargs have overlapping keys: $duplicates") end - if !isempty(psid_kwargs) - kwarg_type = first(values(psid_kwargs)) - name = "$(name)_$kwarg_type" - end - - non_sys_psid_kwargs = setdiff(kwargs, merge(psid_kwargs, sys_kwargs)) - non_sys_psid_args = Dict{Symbol, Any}(k => v for (k, v) in non_sys_psid_kwargs) - key_diff = setdiff(keys(non_sys_psid_args), case_keys) - if !isempty(key_diff) - throw(ArgumentError("unsupported kwargs are specified: $key_diff")) - end - - case_args = Dict{Symbol, Any}( - merge(get_supported_arguments_dict(sys_descriptor), non_sys_psid_args), - ) - return _build_system( name, sys_descriptor, - case_args, + case_kwargs, sys_kwargs, - psid_kwargs, print_stat; force_build, assign_new_uuids, @@ -78,7 +53,6 @@ function _build_system( sys_descriptor::SystemDescriptor, case_args::Dict{Symbol, <:Any}, sys_args::Dict{Symbol, <:Any}, - psid_args::Dict{Symbol, <:Any}, print_stat::Bool = false; force_build::Bool = false, assign_new_uuids::Bool = false, @@ -98,14 +72,13 @@ function _build_system( raw_data = sys_descriptor.raw_data, case_args..., sys_args..., - psid_args..., ) - construct_time = time() - start + #construct_time = time() - start serialized_filepath = get_serialized_filepath(name, case_args) start = time() if !skip_serialization PSY.to_json(sys, serialized_filepath; force = true) - serialize_time = time() - start + #serialize_time = time() - start serialize_case_parameters(case_args) end # set_stats!(sys_descriptor, SystemBuildStats(construct_time, serialize_time)) diff --git a/src/definitions.jl b/src/definitions.jl index 31988e49..e2238ade 100644 --- a/src/definitions.jl +++ b/src/definitions.jl @@ -11,7 +11,6 @@ const SERIALIZED_DIR = joinpath(PACKAGE_DIR, "data", "serialized_system") const SERIALIZE_FILE_EXTENSIONS = [".json", "_metadata.json", "_validation_descriptors.json", "_time_series_storage.h5"] -const ACCEPTED_PSID_TEST_SYSTEMS_KWARGS = [:avr_type, :tg_type, :pss_type, :gen_type] const AVAILABLE_PSID_PSSE_AVRS_TEST = ["AC1A", "AC1A_SAT", "EXAC1", "EXST1", "SEXS", "SEXS_noTE"] diff --git a/src/system_descriptor.jl b/src/system_descriptor.jl index 87361dda..816513af 100644 --- a/src/system_descriptor.jl +++ b/src/system_descriptor.jl @@ -11,7 +11,7 @@ end function SystemArgument(; name, - default, + default = nothing, allowed_values, ) return SystemArgument( @@ -69,9 +69,14 @@ get_build_function(v::SystemDescriptor) = v.build_function get_download_function(v::SystemDescriptor) = v.download_function get_stats(v::SystemDescriptor) = v.stats get_supported_arguments(v::SystemDescriptor) = v.supported_arguments -get_supported_arguments_dict(v::SystemDescriptor) = - Dict(arg.name => arg.default for arg in v.supported_arguments) -get_supported_argument_names(v::SystemDescriptor) = [x.name for x in v.supported_arguments] +get_supported_argument_names(v::SystemDescriptor) = + Set([x.name for x in v.supported_arguments]) + +function get_default_arguments(v::SystemDescriptor) + Dict{Symbol, Any}( + x.name => x.default for x in v.supported_arguments if !isnothing(x.default) + ) +end function get_supported_args_permutations(v::SystemDescriptor) keys_arr = get_supported_argument_names(v) @@ -110,3 +115,18 @@ set_stats!(v::SystemDescriptor, value::SystemBuildStats) = v.stats = value update_stats!(v::SystemDescriptor, deserialize_time::Float64) = update_stats!(v.stats, deserialize_time) + +""" +Return the keyword arguments passed by the user that apply to the descriptor. +Add any default values for fields not passed by the user. +""" +function filter_descriptor_kwargs(descriptor::SystemDescriptor; kwargs...) + case_arg_names = get_supported_argument_names(descriptor) + case_kwargs = get_default_arguments(descriptor) + for (key, val) in kwargs + if key in case_arg_names + case_kwargs[key] = val + end + end + return case_kwargs +end diff --git a/src/system_descriptor_data.jl b/src/system_descriptor_data.jl index 5ccbaf2f..1b1a5246 100644 --- a/src/system_descriptor_data.jl +++ b/src/system_descriptor_data.jl @@ -1411,7 +1411,6 @@ const SYSTEM_CATALOG = [ supported_arguments = [ SystemArgument(; name = :avr_type, - default = "AC1A", allowed_values = Set(AVAILABLE_PSID_PSSE_AVRS_TEST), ), ], @@ -1425,7 +1424,6 @@ const SYSTEM_CATALOG = [ supported_arguments = [ SystemArgument(; name = :tg_type, - default = "GAST", allowed_values = Set(AVAILABLE_PSID_PSSE_TGS_TEST), ), ], @@ -1439,7 +1437,6 @@ const SYSTEM_CATALOG = [ supported_arguments = [ SystemArgument(; name = :gen_type, - default = "GENCLS", allowed_values = Set(AVAILABLE_PSID_PSSE_GENS_TEST), ), ], @@ -1453,7 +1450,6 @@ const SYSTEM_CATALOG = [ supported_arguments = [ SystemArgument(; name = :pss_type, - default = "STAB1", allowed_values = Set(AVAILABLE_PSID_PSSE_PSS_TEST), ), ], diff --git a/src/utils/utils.jl b/src/utils/utils.jl index 0ac3fcb6..a62cd14f 100644 --- a/src/utils/utils.jl +++ b/src/utils/utils.jl @@ -77,11 +77,6 @@ function filter_kwargs(; kwargs...) return system_kwargs end -function check_kwargs_psid(; kwargs...) - psid_kwargs = filter(x -> in(first(x), ACCEPTED_PSID_TEST_SYSTEMS_KWARGS), kwargs) - return psid_kwargs -end - """ Creates a JSON file informing the user about the meaning of the hash value in the file path if it doesn't exist already diff --git a/test/test_psidtestsystems.jl b/test/test_psidtestsystems.jl index fcbac356..665bed2f 100644 --- a/test/test_psidtestsystems.jl +++ b/test/test_psidtestsystems.jl @@ -17,7 +17,7 @@ const PSID_BUILD_TESTS = ) @test isa(sys, System) # build a new system from json - @test PSB.is_serialized("$(name)_$(first(supported_arg)[2])") + @test PSB.is_serialized(name, supported_arg) sys2 = build_system( case_type, name; From 9abef9e8ecd901c0360e556ec734119b1e857f3f Mon Sep 17 00:00:00 2001 From: Daniel Thom Date: Wed, 15 May 2024 18:10:08 -0600 Subject: [PATCH 5/7] Ensure that test permutations are not empty --- test/test_psidtestsystems.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_psidtestsystems.jl b/test/test_psidtestsystems.jl index 665bed2f..066289ba 100644 --- a/test/test_psidtestsystems.jl +++ b/test/test_psidtestsystems.jl @@ -5,9 +5,10 @@ const PSID_BUILD_TESTS = system_catalog = SystemCatalog(SYSTEM_CATALOG) for case_type in [PSIDTestSystems, PSIDSystems] for (name, descriptor) in system_catalog.data[case_type] - supported_args_permutations = PSB.get_supported_args_permutations(descriptor) - # build a new system from scratch if name in PSID_BUILD_TESTS + supported_args_permutations = + PSB.get_supported_args_permutations(descriptor) + @test !isempty(supported_args_permutations) for supported_arg in supported_args_permutations sys = build_system( case_type, From 5cafa174adef7686001e0853bf9172fa978f7d53 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 15 May 2024 18:53:51 -0600 Subject: [PATCH 6/7] add tech to storages --- src/library/psitest_library.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index fc5d5a90..7e9ab46f 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -2872,6 +2872,7 @@ function build_c_sys5_hybrid_uc(; add_forecasts, raw_data, kwargs...) _battery(nodes, bus, name) = PSY.EnergyReservoirStorage(; name = name, prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -3001,6 +3002,7 @@ function build_c_sys5_hybrid_ed(; add_forecasts, raw_data, kwargs...) _battery(nodes, bus, name) = PSY.EnergyReservoirStorage(; name = name, prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = nodes[bus], initial_energy = 5.0, @@ -3449,6 +3451,7 @@ function build_batt_test_case_b_sys(; raw_data, kwargs...) batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = node, initial_energy = 5.0, @@ -3525,6 +3528,7 @@ function build_batt_test_case_c_sys(; raw_data, kwargs...) batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = node, initial_energy = 2.0, @@ -3601,6 +3605,7 @@ function build_batt_test_case_d_sys(; raw_data, kwargs...) batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = node, initial_energy = 2.0, @@ -3677,6 +3682,7 @@ function build_batt_test_case_e_sys(; raw_data, kwargs...) batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = node, initial_energy = 2.0, @@ -3753,6 +3759,7 @@ function build_batt_test_case_f_sys(; raw_data, kwargs...) batt = PSY.EnergyReservoirStorage(; name = "Bat2", prime_mover_type = PrimeMovers.BA, + storage_technology_type = StorageTech.OTHER_CHEM, available = true, bus = node, initial_energy = 1.0, From 44f3e869c53874da79259c1eeb22d5a26bc9089b Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 15 May 2024 18:56:03 -0600 Subject: [PATCH 7/7] formatter --- src/library/psitest_library.jl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/library/psitest_library.jl b/src/library/psitest_library.jl index 7e9ab46f..c65d4827 100644 --- a/src/library/psitest_library.jl +++ b/src/library/psitest_library.jl @@ -2606,10 +2606,22 @@ function build_c_sys5_bat_ems(; end if add_reserves reserve_bat = reserve5_re(get_components(RenewableDispatch, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[1], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) - add_service!(c_sys5_bat, reserve_bat[2], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) + add_service!( + c_sys5_bat, + reserve_bat[1], + get_components(PSY.EnergyReservoirStorage, c_sys5_bat), + ) + add_service!( + c_sys5_bat, + reserve_bat[2], + get_components(PSY.EnergyReservoirStorage, c_sys5_bat), + ) # ORDC - add_service!(c_sys5_bat, reserve_bat[3], get_components(PSY.EnergyReservoirStorage, c_sys5_bat)) + add_service!( + c_sys5_bat, + reserve_bat[3], + get_components(PSY.EnergyReservoirStorage, c_sys5_bat), + ) for (ix, serv) in enumerate(get_components(VariableReserve, c_sys5_bat)) forecast_data = SortedDict{Dates.DateTime, TimeArray}() for t in 1:2