Skip to content

Commit

Permalink
Merge pull request #378 from openego/features/#352-add-methanolisation
Browse files Browse the repository at this point in the history
Features/#352 add methanolisation
  • Loading branch information
ClaraBuettner authored Jan 24, 2025
2 parents a5dcfb3 + 674165a commit d79ab67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/egon/data/datasets/industrial_gas_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class IndustrialGasDemandeGon100RE(Dataset):
#:
name: str = "IndustrialGasDemandeGon100RE"
#:
version: str = "0.0.3"
version: str = "0.0.4"

def __init__(self, dependencies):
super().__init__(
Expand Down Expand Up @@ -503,6 +503,13 @@ def insert_industrial_gas_demand_egon100RE():
"DE0 0 Fischer-Tropsch")].index].mul(
solved_network.snapshot_weightings.generators,
axis= 0).sum().sum()
# Add h2 demand of methanolisation process from pypsa-eur
+ solved_network.links_t.p0[
solved_network.links.loc[
solved_network.links.index.str.contains(
"DE0 0 methanolisation")].index].mul(
solved_network.snapshot_weightings.generators,
axis= 0).sum().sum()
)
except KeyError:
H2_total_PES = 42090000
Expand Down
10 changes: 8 additions & 2 deletions src/egon/data/datasets/pypsaeur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,23 @@ def neighbor_reduction():
network_solved.buses.loc[foreign_buses.index].index
)

# Add H2 demand of Fischer-Tropsch process to industrial H2 demands
# Add H2 demand of Fischer-Tropsch process and methanolisation
# to industrial H2 demands
industrial_hydrogen = network_prepared.loads.loc[
network_prepared.loads.carrier== "H2 for industry"]
fischer_tropsch = network_solved.links_t.p0[
network_solved.links.loc[
network_solved.links.carrier=="Fischer-Tropsch"].index
].mul(network_solved.snapshot_weightings.generators, axis=0).sum()
methanolisation = network_solved.links_t.p0[
network_solved.links.loc[
network_solved.links.carrier=="methanolisation"].index
].mul(network_solved.snapshot_weightings.generators, axis=0).sum()
for i, row in industrial_hydrogen.iterrows():
network_prepared.loads.loc[i, "p_set"] += fischer_tropsch[
fischer_tropsch.index.str.startswith(row.bus[:5])].sum()/8760

network_prepared.loads.loc[i, "p_set"] += methanolisation[
methanolisation.index.str.startswith(row.bus[:5])].sum()/8760
# drop foreign lines and links from the 2nd row

network_solved.lines = network_solved.lines.drop(
Expand Down

0 comments on commit d79ab67

Please sign in to comment.