add_existing_baseyear.py: Add carrier to conventional generators

This commit is contained in:
Tom Brown 2020-07-30 08:22:27 +02:00
parent 7abe928337
commit ece21bfdfa

View File

@ -139,11 +139,13 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs):
("nuclear","uranium")]: ("nuclear","uranium")]:
try: try:
if node in df.index and not np.isnan(df.loc[node, generator]): if node in df.index and not np.isnan(df.loc[node, generator]):
n.add("Link", #use madd so that we can insert the carrier attribute
bus_selected + " " + generator +"-" + grouping_year, n.madd("Link",
[bus_selected + " " + generator +"-" + grouping_year],
bus0="EU " + carrier, bus0="EU " + carrier,
bus1=bus_selected, bus1=bus_selected,
bus2="co2 atmosphere", bus2="co2 atmosphere",
carrier=generator,
marginal_cost=costs.at[generator,'efficiency']*costs.at[generator,'VOM'], #NB: VOM is per MWel marginal_cost=costs.at[generator,'efficiency']*costs.at[generator,'VOM'], #NB: VOM is per MWel
capital_cost=costs.at[generator,'efficiency']*costs.at[generator,'fixed'], #NB: fixed cost is per MWel capital_cost=costs.at[generator,'efficiency']*costs.at[generator,'fixed'], #NB: fixed cost is per MWel
p_nom=df.loc[node, generator], p_nom=df.loc[node, generator],
@ -387,10 +389,3 @@ if __name__ == "__main__":
add_heating_capacities_installed_before_baseyear(n, baseyear, grouping_years, ashp_cop, gshp_cop, time_dep_hp_cop, costs, default_lifetime) add_heating_capacities_installed_before_baseyear(n, baseyear, grouping_years, ashp_cop, gshp_cop, time_dep_hp_cop, costs, default_lifetime)
n.export_to_netcdf(snakemake.output[0]) n.export_to_netcdf(snakemake.output[0])