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

update hvdc loss model #105

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
72a7b0e
update hvdc loss model
rodrigomha Aug 7, 2024
cdb1b9b
fix kwarg
rodrigomha Aug 7, 2024
9e18f3b
Add WECC 9 Bus system from Sauer and Pai
fmajeau Aug 23, 2024
d7fa9c1
Merge pull request #106 from fmajeau/fm/wecc9bus
jd-lara Aug 29, 2024
b4eeca9
Update Project.toml
jd-lara Aug 29, 2024
9c7eabb
add reserves to 5bus ED
rodrigomha Sep 4, 2024
ad8bad1
fix day errors
rodrigomha Sep 4, 2024
b771de2
Merge pull request #107 from NREL-Sienna/rh/add_reserves_5bus_ed
jd-lara Sep 9, 2024
9b99365
add missing descriptors
jd-lara Sep 9, 2024
72a5210
change name to requirement
rodrigomha Sep 9, 2024
3b975bd
Merge pull request #108 from NREL-Sienna/jd/fix5bustest1
jd-lara Sep 9, 2024
d387fa0
Update Project.toml
jd-lara Sep 9, 2024
2a34cea
add fuel cost sys
rodrigomha Oct 17, 2024
0a0ba30
change artifacts
jd-lara Nov 21, 2024
135e7d7
Merge pull request #113 from NREL-Sienna/jd/bump_hydro_testdata
jd-lara Nov 21, 2024
3deef6a
Update Project.toml
jd-lara Nov 21, 2024
c37d6e6
add fuel cost sys
rodrigomha Oct 17, 2024
1638792
Merge branch 'rh/add_fuelcost_case' of https://github.com/NREL-SIIP/P…
jd-lara Nov 29, 2024
b0b9f1b
Merge pull request #110 from NREL-Sienna/rh/add_fuelcost_case
jd-lara Nov 29, 2024
5eb42e1
Update Project.toml
jd-lara Nov 29, 2024
d347c72
Adding system
pesap Dec 6, 2024
e1fe226
Formatting
pesap Dec 9, 2024
babe43d
Merge pull request #114 from NREL-Sienna/ps/phes
jd-lara Dec 13, 2024
b29308c
Update Project.toml
jd-lara Dec 13, 2024
ef92310
Skip serialization when sys kwargs are present
daniel-thom Jan 13, 2025
b650eca
Merge pull request #115 from NREL-Sienna/psy-issue-1217
jd-lara Jan 16, 2025
2608f31
Update Project.toml
jd-lara Jan 19, 2025
7a65247
update hvdc loss model
rodrigomha Aug 7, 2024
b9aafbe
fix kwarg
rodrigomha Aug 7, 2024
8d2fcc3
Merge branch 'rh/update_hvdc_loss_model' of https://github.com/NREL-S…
jd-lara Jan 19, 2025
e0c1ed1
update test data refs
jd-lara Jan 19, 2025
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
6 changes: 3 additions & 3 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[CaseData]
git-tree-sha1 = "afb608473cf4d5eb22147856de1a1a651f36d40b"
git-tree-sha1 = "790e4a66bbce8b8bafd4fb2fbf9e494545211264"
lazy = true

[[CaseData.download]]
url = "https://github.com/NREL-Sienna/PowerSystemsTestData/archive/refs/tags/3.1.tar.gz"
sha256 = "4ac6ccd9dc9690b52ad6d0f46eeb759608e04ef8bc871732ff54bdbb0493dcea"
url = "https://github.com/NREL-Sienna/PowerSystemsTestData/archive/refs/tags/3.3.tar.gz"
sha256 = "93f103ea62de8026760368de3f959cd8cd52d8ccd27178c3df873bff6b204af0"

[rts]
git-tree-sha1 = "5098f357bad765bfefcff58f080818863ca776bd"
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerSystemCaseBuilder"
uuid = "f00506e0-b84f-492a-93c2-c0a9afc4364e"
authors = ["Sourabh Dalvi", "Jose Daniel Lara"]
version = "1.3.5"
version = "1.3.11"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down Expand Up @@ -29,7 +29,7 @@ HDF5 = "0.17"
InfrastructureSystems = "2"
JSON3 = "1"
LazyArtifacts = "1"
PowerSystems = "^4.1.1"
PowerSystems = "^4.5"
PrettyTables = "2"
Random = "1"
SHA = "0.7"
Expand Down
7 changes: 5 additions & 2 deletions src/build_system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ function _build_system(
assign_new_uuids::Bool = false,
skip_serialization::Bool = false,
)
if !is_serialized(name, case_args) || force_build
# We skip serialization/de-serialization if sys_args are passed because we currently
# cannot encode information about some of them into file paths
# (such as lambda functions).
if !isempty(sys_args) || !is_serialized(name, case_args) || force_build
check_serialized_storage()
download_function = get_download_function(sys_descriptor)
if !isnothing(download_function)
Expand All @@ -76,7 +79,7 @@ function _build_system(
#construct_time = time() - start
serialized_filepath = get_serialized_filepath(name, case_args)
start = time()
if !skip_serialization
if !skip_serialization && isempty(sys_args)
PSY.to_json(sys, serialized_filepath; force = true)
#serialize_time = time() - start
serialize_case_parameters(case_args)
Expand Down
2 changes: 1 addition & 1 deletion src/definitions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const PACKAGE_DIR = joinpath(dirname(dirname(pathof(PowerSystemCaseBuilder))))
const DATA_DIR =
joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-3.1")
joinpath(LazyArtifacts.artifact"CaseData", "PowerSystemsTestData-3.3")

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

Expand Down
4 changes: 2 additions & 2 deletions src/library/psi_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ function build_two_zone_5_bus(; kwargs...)
(min = -2.0, max = 2.0),
(min = -2.0, max = 2.0),
(min = -2.0, max = 2.0),
(l0 = 0.0, l1 = 0.0),
LinearCurve(0.0),
),
]

Expand Down Expand Up @@ -1361,7 +1361,7 @@ function _duplicate_system(main_sys::PSY.System, twin_sys::PSY.System, HVDC_line
active_power_limits_to = (min = -1000.0, max = 1000.0),
reactive_power_limits_from = (min = -1000.0, max = 1000.0),
reactive_power_limits_to = (min = -1000.0, max = 1000.0),
loss = (l0 = 0.0, l1 = 0.1),
loss = PSY.LinearCurve(0.1),
services = Vector{Service}[],
ext = Dict{String, Any}(),
)
Expand Down
86 changes: 86 additions & 0 deletions src/library/psid_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,92 @@ function build_3bus_inverter(; raw_data, kwargs...)
return sys
end

function build_psid_wecc_9_dynamic(; raw_data, kwargs...)
sys_kwargs = filter_kwargs(; kwargs...)
sys = System(raw_data; runchecks = false, sys_kwargs...)

# Manually change reactance of three branches to match Sauer & Pai (2007) Figure 7.4
set_x!(get_component(Branch, sys, "Bus 5-Bus 4-i_1"), 0.085)
set_x!(get_component(Branch, sys, "Bus 9-Bus 6-i_1"), 0.17)
set_x!(get_component(Branch, sys, "Bus 7-Bus 8-i_1"), 0.072)

# Loads from raw file are constant power, consistent with Sauer & Pai (p169)

############### Data Dynamic devices ########################

# --- Machine models ---
# All parameters are from Sauer & Pai (2007) Table 7.3 M/C columns 1,2,3
function machine_sauerpai(i)
R = [0.0, 0.0, 0.0] # <-- not specified in Table 7.3
Xd = [0.146, 0.8958, 1.3125]
Xq = [0.0969, 0.8645, 1.2578]
Xd_p = [0.0608, 0.1198, 0.1813]
Xq_p = [0.0969, 0.1969, 0.25]
Td0_p = [8.96, 6.0, 5.89]
Tq0_p = [0.31, 0.535, 0.6]
return PSY.OneDOneQMachine(;
R = R[i],
Xd = Xd[i],
Xq = Xq[i],
Xd_p = Xd_p[i],
Xq_p = Xq_p[i],
Td0_p = Td0_p[i],
Tq0_p = Tq0_p[i],
)
end

# --- Shaft models ---
# All parameters are from Sauer & Pai (2007)
function shaft_sauerpai(i)
D_M = [0.1, 0.2, 0.3] # D/M from bottom of p165
H = [23.64, 6.4, 3.01] # H from Table 7.3
D = (2 * D_M .* H) / get_frequency(sys)
return PSY.SingleMass(;
H = H[i],
D = D[i],
)
end

# --- AVR models ---
# All parameters are from Sauer & Pai (2007) Table 7.3 exciter columns 1,2,3
# All S&P exciters are IEEE-Type I (p165)
# NOTE: In S&P, terminal voltage seen by AVR is same as the bus voltage.
# In AVRTypeI, it is a measurement if the bus voltage with a sampling rate.
# Thus, Tr is set to be very small to account for this difference.
avr_typei() = PSY.AVRTypeI(;
Ka = 20,
Ke = 1.0,
Kf = 0.063,
Ta = 0.2,
Te = 0.314,
Tf = 0.35,
Tr = 0.0001, # <-- not specified in Table 7.3
Va_lim = (-0.5, 0.5), # <-- not specified in Table 7.3
Ae = 0.0039,
Be = 1.555,
)

function dyn_gen_sauerpai(generator)
i = get_number(get_bus(generator))
return PSY.DynamicGenerator(;
name = PSY.get_name(generator),
ω_ref = 1.0,
machine = machine_sauerpai(i),
shaft = shaft_sauerpai(i),
avr = avr_typei(),
prime_mover = tg_none(),
pss = pss_none(),
)
end

for g in get_components(Generator, sys)
case_gen = dyn_gen_sauerpai(g)
add_component!(sys, case_gen, g)
end

return sys
end

##################################
# Add Load tutorial systems here #
##################################
Expand Down
Loading
Loading