Skip to content

Commit

Permalink
Merge pull request #982 from openego/fixes/#863-OCGT-eGon2035
Browse files Browse the repository at this point in the history
Adjust p_nom and marginal cost for OCGT eGon2035
  • Loading branch information
AmeliaNadal committed Nov 23, 2022
2 parents 422c712 + 1376ddc commit 385ea26
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ Bug Fixes
`#958 <https://github.com/openego/eGon-data/issues/958>`_
* Overwrite capacities for conventional power plants with data from nep list
`#403 <https://github.com/openego/eGon-data/issues/403>`_
* Adjust p_nom and marginal cost for OCGT in eGon2035
`#863 <https://github.com/openego/eGon-data/issues/863>`_
* Mismatch of building bus_ids from cts_heat_demand_building_share
and mapping table
`#989 <https://github.com/openego/eGon-data/issues/989>`_
Expand Down
2 changes: 1 addition & 1 deletion src/egon/data/datasets/power_etrago/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OpenCycleGasTurbineEtrago(Dataset):
def __init__(self, dependencies):
super().__init__(
name="OpenCycleGasTurbineEtrago",
version="0.0.0",
version="0.0.1",
dependencies=dependencies,
tasks=(insert_open_cycle_gas_turbines,),
)
24 changes: 19 additions & 5 deletions src/egon/data/datasets/power_etrago/match_ocgt.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ def insert_open_cycle_gas_turbines(scn_name="eGon2035"):
carrier = "OCGT"
gdf["carrier"] = carrier

buses = tuple(db.select_dataframe(
f"""SELECT bus_id FROM grid.egon_etrago_bus
buses = tuple(
db.select_dataframe(
f"""SELECT bus_id FROM grid.egon_etrago_bus
WHERE scn_name = '{scn_name}' AND country = 'DE';
"""
)['bus_id'])
)["bus_id"]
)

# Delete old entries
db.execute_sql(
Expand All @@ -54,7 +56,13 @@ def insert_open_cycle_gas_turbines(scn_name="eGon2035"):
# read carrier information from scnario parameter data
scn_params = get_sector_parameters("gas", scn_name)
gdf["efficiency"] = scn_params["efficiency"][carrier]
gdf["marginal_cost"] = scn_params["marginal_cost"][carrier]
gdf["marginal_cost"] = (
scn_params["marginal_cost"][carrier]
/ scn_params["efficiency"][carrier]
)

# Adjust p_nom
gdf["p_nom"] = gdf["p_nom"] / scn_params["efficiency"][carrier]

# Select next id value
new_id = db.next_etrago_id("link")
Expand Down Expand Up @@ -110,7 +118,13 @@ def map_buses(scn_name):
.rename(columns={"bus_id": "bus0", "geom": "geom_gas"})
.reset_index(drop=True)
)
gdf = pd.concat([gdf_AC.reset_index(drop=True), gd_gas_nearest,], axis=1,)
gdf = pd.concat(
[
gdf_AC.reset_index(drop=True),
gd_gas_nearest,
],
axis=1,
)

return gdf.rename(columns={"bus_id": "bus1"}).drop(
columns=["geom", "geom_gas"]
Expand Down

0 comments on commit 385ea26

Please sign in to comment.