Skip to content

Commit

Permalink
Merge pull request #237 from Breakthrough-Energy/daniel/hifld_dclines
Browse files Browse the repository at this point in the history
feat: filter DC lines out of AC transmission network processing within HIFLD construction
  • Loading branch information
danielolsen committed Apr 5, 2022
2 parents ee762d6 + d34dfbd commit 300a0bf
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
17 changes: 17 additions & 0 deletions prereise/gather/griddata/hifld/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,20 @@
"Solar Thermal with Energy Storage": 0,
"Solar Thermal without Energy Storage": 0,
}

# These lines were manually identified based on a combination of: their 'TYPE'
# classification, their substation names, and their geographical paths. The capacities
# for each line were compiled from a variety of public sources.
dc_line_ratings = { # MW
108354: 500, # Square Butte
113313: 660, # Neptune Cable
131914: 2000, # Quebec – New England Transmission (Ayer to Monroe)
150123: 1000, # CU
157627: 330, # Cross-Sound Cable
157629: 660, # Hudson Project
158515: 2000, # Quebec – New England Transmission (Quebec to Monroe)
200823: 3100, # Pacific DC Intertie (Path 65)
308464: 2400, # Intermountain Power Project (Path 27)
310053: 400, # Trans-Bay Cable
311958: 5, # Alamogordo Solar Energy Center
}
45 changes: 42 additions & 3 deletions prereise/gather/griddata/hifld/data_process/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,23 @@ def estimate_branch_rating(branch, bus_voltages):
raise ValueError(f"{branch.loc['type']} not a valid branch type")


def build_transmission(method="sub2line", **kwargs):
def split_lines_to_ac_and_dc(lines, dc_override_indices=None):
"""Given a data frame of mixed AC & DC lines, where some DC lines are not
appropriately labeled, split into an AC data frame and a DC data frame.
:param pandas.DataFrame lines: combined data frame of AC & DC lines.
:param iterable dc_override_indices: indices to coerce to DC classification.
:return: (*tuple*) -- two data frames, of AC & DC lines, respectively.
"""
if dc_override_indices is None:
dc_override_indices = {}
dc_types = {"DC; OVERHEAD", "DC; UNDERGROUND"} # noqa: F841
dc_lines = lines.query("TYPE in @dc_types or index in @dc_override_indices")
ac_lines = lines.query("index not in @dc_lines.index")
return ac_lines.copy(), dc_lines.copy()


def build_transmission(method="line2sub", **kwargs):
"""Build transmission network
:param str method: method used to build network. Default method is *sub2line*
Expand All @@ -616,6 +632,8 @@ def build_transmission(method="sub2line", **kwargs):
:py:func:`get_mst_edges`.
:raises TypeError: if ``method`` is not a str.
:raises ValueError: if ``method`` is unknown.
:return: (*tuple*) -- four data frames:
AC branches, buses, substations, and DC lines, respectively.
"""
if not isinstance(method, str):
raise TypeError("method must be a str")
Expand Down Expand Up @@ -668,12 +686,33 @@ def build_transmission(method="sub2line", **kwargs):
lines, substations, **island_kwargs
)

# Separate DC lines from AC line processing, add ratings
ac_lines, dc_lines = split_lines_to_ac_and_dc(lines, const.dc_line_ratings.keys())
dc_lines["Pmax"] = dc_lines.index.to_series().map(const.dc_line_ratings)
dc_lines["Pmin"] = -1 * dc_lines["Pmax"]

# Add voltages to lines with missing data
augment_line_voltages(lines, substations)
augment_line_voltages(ac_lines, substations)

# Create buses from lines
bus = create_buses(ac_lines)

# Add transformers, and calculate rating and impedance for all branches
transformers = create_transformers(bus)
transformers["type"] = "Transformer"
ac_lines["type"] = "Line"
ac_lines["length"] = ac_lines.apply(calculate_branch_mileage, axis=1)
branch = pd.concat([ac_lines, transformers])
branch["x"] = branch.apply(
lambda x: estimate_branch_impedance(x, bus["baseKV"]), axis=1
)
branch["rateA"] = branch.apply(
lambda x: estimate_branch_rating(x, bus["baseKV"]), axis=1
)

# Add additional information to substations
substations["interconnect"] = substations.apply(
lambda x: map_state_and_county_to_interconnect(x.STATE, x.COUNTY), axis=1
)

return lines, substations
return branch, bus, substations, dc_lines

0 comments on commit 300a0bf

Please sign in to comment.