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

Move natural gas piepline assumptions to config file #455

Open
trevorb1 opened this issue Oct 19, 2024 · 0 comments
Open

Move natural gas piepline assumptions to config file #455

trevorb1 opened this issue Oct 19, 2024 · 0 comments
Labels
enhancement New feature or request Sector Sector Coupling Issue

Comments

@trevorb1
Copy link
Collaborator

Feature Request

Three assumptions are hard-coded into the calculation of linepack. These should be moved to the configuration file. These assumptions are:

  • Including both interstate and intrastate pipelines in the calculation
  • The size of both interstate and intrastate pipelines
  • The operating pressures of interstate and intrastate pipelines

Suggested Solution

No response

Additional Info

def format_data(self, data: gpd.GeoDataFrame) -> pd.DataFrame:
gdf = data.copy()
states = self.states.copy()
length_in_state = gpd.sjoin(
gdf.to_crs("4269"),
states,
how="right",
predicate="within",
).reset_index()
length_in_state = (
length_in_state[["STATE_NAME", "STATE", "TYPEPIPE", "Shape_Leng", "Shape__Length"]]
.rename(columns={"Shape_Leng": "LENGTH_DEG", "Shape__Length": "LENGTH_M"})
.groupby(by=["STATE_NAME", "STATE", "TYPEPIPE"])
.sum()
.reset_index()
)
# https://publications.anl.gov/anlpubs/2008/02/61034.pdf
intrastate_radius = 12 * 0.0254 # inches in meters (24in dia)
interstate_radius = 18 * 0.0254 # inches meters (36in dia)
volumne_in_state = length_in_state.copy()
volumne_in_state["RADIUS"] = volumne_in_state.TYPEPIPE.map(
lambda x: interstate_radius if x == "Interstate" else intrastate_radius,
)
volumne_in_state["VOLUME_M3"] = volumne_in_state.LENGTH_M * pi * volumne_in_state.RADIUS**2
volumne_in_state = volumne_in_state[["STATE_NAME", "STATE", "VOLUME_M3"]]
volumne_in_state = volumne_in_state.groupby(by=["STATE_NAME", "STATE"]).sum()
# https://publications.anl.gov/anlpubs/2008/02/61034.pdf
max_pressure = 8000 # kPa
min_pressure = 4000 # kPa
energy_in_state = volumne_in_state.copy()
energy_in_state["MAX_ENERGY_kJ"] = energy_in_state.VOLUME_M3 * max_pressure
energy_in_state["MIN_ENERGY_kJ"] = energy_in_state.VOLUME_M3 * min_pressure
energy_in_state["NOMINAL_ENERGY_kJ"] = (energy_in_state.MAX_ENERGY_kJ + energy_in_state.MIN_ENERGY_kJ) / 2
final = energy_in_state.copy()
final["MAX_ENERGY_MWh"] = final.MAX_ENERGY_kJ * KJ_2_MWH
final["MIN_ENERGY_MWh"] = final.MIN_ENERGY_kJ * KJ_2_MWH
final["NOMINAL_ENERGY_MWh"] = final.NOMINAL_ENERGY_kJ * KJ_2_MWH
final = final[["MAX_ENERGY_MWh", "MIN_ENERGY_MWh", "NOMINAL_ENERGY_MWh"]].reset_index()
return self.filter_on_interconnect(final)

@trevorb1 trevorb1 added enhancement New feature or request Sector Sector Coupling Issue labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Sector Sector Coupling Issue
Projects
None yet
Development

No branches or pull requests

1 participant