Skip to content

Commit

Permalink
Fix offshore wind capacity by adding it as offwind-AC (#1089)
Browse files Browse the repository at this point in the history
* Fix existing offshore wind capacity by adding it as offwind-ac
---------

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
  • Loading branch information
toniseibold and fneum authored Jun 4, 2024
1 parent 4ceb397 commit d62e959
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions scripts/add_existing_baseyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add_existing_renewables(df_agg, costs):
Append existing renewables to the df_agg pd.DataFrame with the conventional
power plants.
"""
tech_map = {"solar": "PV", "onwind": "Onshore", "offwind": "Offshore"}
tech_map = {"solar": "PV", "onwind": "Onshore", "offwind-ac": "Offshore"}

countries = snakemake.config["countries"] # noqa: F841
irena = pm.data.IRENASTAT().powerplant.convert_country_to_alpha2()
Expand Down Expand Up @@ -109,12 +109,13 @@ def add_existing_renewables(df_agg, costs):
name = f"{node}-{carrier}-{year}"
capacity = nodal_df.loc[node, year]
if capacity > 0.0:
cost_key = carrier.split("-")[0]
df_agg.at[name, "Fueltype"] = carrier
df_agg.at[name, "Capacity"] = capacity
df_agg.at[name, "DateIn"] = year
df_agg.at[name, "lifetime"] = costs.at[carrier, "lifetime"]
df_agg.at[name, "lifetime"] = costs.at[cost_key, "lifetime"]
df_agg.at[name, "DateOut"] = (
year + costs.at[carrier, "lifetime"] - 1
year + costs.at[cost_key, "lifetime"] - 1
)
df_agg.at[name, "cluster_bus"] = node

Expand Down Expand Up @@ -254,7 +255,8 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
name_suffix = f" {generator}{suffix}-{grouping_year}"
name_suffix_by = f" {generator}{suffix}-{baseyear}"
asset_i = capacity.index + name_suffix
if generator in ["solar", "onwind", "offwind"]:
if generator in ["solar", "onwind", "offwind-ac"]:
cost_key = generator.split("-")[0]
# to consider electricity grid connection costs or a split between
# solar utility and rooftop as well, rather take cost assumptions
# from existing network than from the cost database
Expand Down Expand Up @@ -299,10 +301,10 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
/ len(inv_ind), # split among regions in a country
marginal_cost=marginal_cost,
capital_cost=capital_cost,
efficiency=costs.at[generator, "efficiency"],
efficiency=costs.at[cost_key, "efficiency"],
p_max_pu=p_max_pu,
build_year=grouping_year,
lifetime=costs.at[generator, "lifetime"],
lifetime=costs.at[cost_key, "lifetime"],
)

else:
Expand All @@ -318,10 +320,10 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
p_nom=new_capacity,
marginal_cost=marginal_cost,
capital_cost=capital_cost,
efficiency=costs.at[generator, "efficiency"],
efficiency=costs.at[cost_key, "efficiency"],
p_max_pu=p_max_pu.rename(columns=n.generators.bus),
build_year=grouping_year,
lifetime=costs.at[generator, "lifetime"],
lifetime=costs.at[cost_key, "lifetime"],
)

else:
Expand Down Expand Up @@ -594,13 +596,13 @@ def add_heating_capacities_installed_before_baseyear(

snakemake = mock_snakemake(
"add_existing_baseyear",
configfiles="config/test/config.myopic.yaml",
configfiles="config/config.yaml",
simpl="",
clusters="37",
ll="v1.0",
clusters="20",
ll="v1.5",
opts="",
sector_opts="8760-T-H-B-I-A-dist1",
planning_horizons=2020,
sector_opts="none",
planning_horizons=2030,
)

configure_logging(snakemake)
Expand Down

0 comments on commit d62e959

Please sign in to comment.