Skip to content

Commit

Permalink
Merge pull request #648 from openego/powerD-adaptations
Browse files Browse the repository at this point in the history
Power d adaptations
  • Loading branch information
ClaraBuettner authored Aug 22, 2023
2 parents 7132b01 + bfc4d0a commit 7983e51
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion etrago/appl.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"threads": 4,
},
"model_formulation": "kirchhoff", # angles or kirchhoff
"scn_name": "eGon2035", # scenario: eGon2035 or eGon100RE
"scn_name": "eGon2035", # scenario: eGon2035, eGon100RE or status2019
# Scenario variations:
"scn_extension": None, # None or array of extension scenarios
"scn_decommissioning": None, # None or decommissioning scenario
Expand Down
5 changes: 3 additions & 2 deletions etrago/cluster/gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ def gas_postprocessing(etrago, busmap, medoid_idx=None):
+ str(settings["n_clusters_gas"])
+ "_result.csv"
)

busmap = get_h2_clusters(etrago, busmap)

if 'H2' in etrago.network.buses.carrier.unique():
busmap = get_h2_clusters(etrago, busmap)

# Add all other buses to busmap
missing_idx = list(
Expand Down
7 changes: 4 additions & 3 deletions etrago/tools/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,6 @@ def read_max_gas_generation(self):
"biogas": 14450103
}, # [MWh] Value from reference p-e-s run used in eGon-data
}

engine = db.connection(section=self.args["db"])
try:
sql = f"""
Expand Down Expand Up @@ -2738,10 +2737,12 @@ def functionality(self, network, snapshots):
if "CH4" in network.buses.carrier.values:
if self.args["method"]["pyomo"]:
add_chp_constraints(network, snapshots)
add_ch4_constraints(self, network, snapshots)
if self.args["scn_name"] != "status2019":
add_ch4_constraints(self, network, snapshots)
else:
add_chp_constraints_nmp(network)
add_ch4_constraints_nmp(self, network, snapshots)
if self.args["scn_name"] != "status2019":
add_ch4_constraints_nmp(self, network, snapshots)

for constraint in self.args["extra_functionality"].keys():
try:
Expand Down
3 changes: 2 additions & 1 deletion etrago/tools/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ def build_network_from_db(self):

self.decommissioning()

self.add_ch4_h2_correspondence()
if "H2" in self.network.buses.carrier:
self.add_ch4_h2_correspondence()

logger.info("Imported network from db")

Expand Down
9 changes: 8 additions & 1 deletion etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,14 @@ def check_args(etrago):
"""

names = ["eGon2035", "eGon100RE", "eGon2035_lowflex", "eGon100RE_lowflex"]
names = [
"eGon2035",
"eGon100RE",
"eGon2035_lowflex",
"eGon100RE_lowflex",
"status2019",
]

assert (
etrago.args["scn_name"] in names
), f"'scn_name' has to be in {names} but is {etrago.args['scn_name']}."
Expand Down

0 comments on commit 7983e51

Please sign in to comment.