Breakthrough-Energy / PreREISE

Generate input data for scenario framework
https://breakthrough-energy.github.io/docs/
MIT License
21 stars 28 forks source link

refactor: update values and logic for representative transformer designs #286

Closed danielolsen closed 2 years ago

danielolsen commented 2 years ago

Pull Request doc

Purpose

Update the logic used to generate transformers and assign parameter values for the HIFLD grid. These parameters are generated by examining real data sets to identify representative values for different voltage combinations (thank you @danlivengood and @YifanLi86 for helping to identify these values).

What the code is doing

Testing

Unit testing.

Usage Example/Visuals

Usage of build_transmission is unchanged, only internal logic is refactored.

Time estimate

30-60 minutes. ~This is a draft PR for now, since it relies on #276, but all logic should be complete and ready for review.~ EDIT: #276 is merged, so this is ready to go.

danielolsen commented 2 years ago

276 is merged, so this is now ready for a full review.

rouille commented 2 years ago

Do we need to create entries in the Attribution file for the two CSV files?

danielolsen commented 2 years ago

Do we need to create entries in the Attribution file for the two CSV files?

They are self-created values, made by examining a few different data sources, so I don't think so. @BainanXia had the same question about transmission lines: https://github.com/Breakthrough-Energy/PreREISE/pull/276#discussion_r843294526.

danielolsen commented 2 years ago

Thinking a bit more about the logic for determining how many transformers to add, I wonder if our current logic is adding too many. If we have a situation where there are a couple of higher-voltage lines and one lower-voltage line connected to a substation, adding enough transformer capacity to support the highest capacity line perhaps doesn't make sense, if this transformer capacity ends up being much higher than the lower-voltage line. This could also effectively reduce the impedance between the high-voltage side and the low-voltage side, which could lead to unrealistic low-voltage line congestion/violations.

If we trust the transmission line capacities that are being added, perhaps we only need enough transformer capacity to support the smaller of either: the highest-capacity high-voltage line, or the sum of line capacities on the lower-voltage side. Just speculating here, but I think it would be rare to end up with a situation where the total line capacity on the low-voltage side is so large that it requires transformers capable of handling more power than any one high-voltage line.

E.g. one of the current worst congested lines in the HIFLD Western grid is a 66 kV line connected to a substation with 4x 230 kV lines and one other 66 kV line. The 2x 66 kV lines could be fully served by 1x 69/230 kV transformer (each 66 kV line has a capacity of about 82 MW, and each representative transformer is rated for 190 MW), but based on the current logic we add enough transformers to handle the full capacity of one of the 230 kV lines (552 MW), which equals 3x transformers and 1/3 of the effective impedance between the 230 and 66 kV parts of the network, which is liable to create more local congestion issues.

EDIT: this approach seems to only sort of work. There won't be any transformers which are congested due to hitting their power limits before the connected lines, but this doesn't solve the problem of meeting demand which exists at the low-voltage bus itself. We don't know the demand at this stage, because the demand doesn't get added until after the entire transmission network is built, and the plant data is built, such that we don't add demand at plant substations.

This could be a use case for the code in #279: we can go through our current grid-building process (i.e. within create_grid: build_transmission(); build_plant(); assign_demand_to_buses();), and then run the code in #279 to identify any bottlenecks, and if they're transformer-caused, then we add the requisite number of additional transformers in parallel to be able to serve the demand. The reduction in the number of transformers added with this approach is pretty dramatic though: 10,237 fewer transformers (from a starting number of 28,977, or a reduction of 35%). We don't yet have the real bus-level demands to be able to identify real bottlenecks (see #293), but the Pd values assigned by assign_demand_to_buses will hopefully be close enough to make this approach generally work. If the existing const.demand_per_person value is an under-estimation, we can increase it (since the absolute values of Pd aren't ever used anywhere, just the ratios within a zone).

danielolsen commented 2 years ago

The last four commits implement the main idea discussed in https://github.com/Breakthrough-Energy/PreREISE/pull/286#issuecomment-1113472044. Briefly: instead of just looking at the capacity to support the highest-capacity-line (probably on the high-voltage side), we also look at the required capacity by all of the lines on the low-voltage side, and we add enough transformer capacity to meet the smaller of those two. There are a few select locations where this results in inadequate capacity where there's demand at the low-voltage bus, but that's difficult or impossible to solve a priori at grid-build time (since not all of these bottlenecks are on the radial part of the grid that #279 analyzes), so we add one more data file of assumptions for which substations need additional transformer capacity. These assumptions are identified pretty quickly in ERCOT with only an iteration or two of power flow solves, compared to the line upgrades which currently require many iterations and are therefore the main effort required to getting to a feasible grid (although maybe having more reasonable impedances between the higher- and lower-voltage parts of the grid will help mitigate this).

The numbers:

BainanXia commented 2 years ago

Probably I need to refresh my brain on the current logic of adding transformers: taking the example above, one substation is connected by 6 lines, 2x 66kV (82MW each) and 4x 230kV (552MW each). In this case, how many buses are there in this substation? Should it be 2 given there are 2 different voltage levels among the lines connected to it? If so, there should be only one transformer added, i.e. 66kV/230kV (forgot about the capacity calculation, did we choose the max(82, 552) before?)

Another question not related to transformers, how do we figure out that new transmission line needs to be added during feasibility tweaking? In the adjustments required to regain ERCOT feasibility, I understand the last 3 bullets but a little surprise on the first one.

danielolsen commented 2 years ago

Probably I need to refresh my brain on the current logic of adding transformers: taking the example above, one substation is connected by 6 lines, 2x 66kV (82MW each) and 4x 230kV (552MW each). In this case, how many buses are there in this substation? Should it be 2 given there are 2 different voltage levels among the lines connected to it? If so, there should be only one transformer added, i.e. 66kV/230kV (forgot about the capacity calculation, did we choose the max(82, 552) before?)

You are correct that there are 2 buses since there are 2 voltage levels.

Another question not related to transformers, how do we figure out that new transmission line needs to be added during feasibility tweaking? In the adjustments required to regain ERCOT feasibility, I understand the last 3 bullets but a little surprise on the first one.

This line wasn't strictly necessary, but when looking at real maps I noticed that there should definitely be a line here, but wasn't. So it was manually noticing a data gap, rather than inferring a data gap or data mistake based on power flow results.

BainanXia commented 2 years ago

@danielolsen Very clear. Thanks for the detailed explanation. Now I remember everything:)

danielolsen commented 2 years ago

@danielolsen Very clear. Thanks for the detailed explanation. Now I remember everything:)

I had to go back and look at the before/after code to remind myself. I also realized that we hadn't deleted the old parameters which are now unused, so I just did that too.