add release note, simplify build_industry_sector_ratios_intermediate script
This commit is contained in:
parent
4d4badc519
commit
93bb4e5f54
@ -17,6 +17,8 @@ HVC_primary_fraction,--,float,The fraction of high value chemicals (HVC) produce
|
|||||||
HVC_mechanical_recycling _fraction,--,float,The fraction of high value chemicals (HVC) produced using mechanical recycling
|
HVC_mechanical_recycling _fraction,--,float,The fraction of high value chemicals (HVC) produced using mechanical recycling
|
||||||
HVC_chemical_recycling _fraction,--,float,The fraction of high value chemicals (HVC) produced using chemical recycling
|
HVC_chemical_recycling _fraction,--,float,The fraction of high value chemicals (HVC) produced using chemical recycling
|
||||||
,,,
|
,,,
|
||||||
|
sector_ratios_fraction_future,--,Dictionary with planning horizons as keys.,The fraction of total progress in fuel and process switching achieved in the industry sector.
|
||||||
|
basic_chemicals_without_NH3_production_today,Mt/a,float,"The amount of basic chemicals produced without ammonia (= 86 Mtethylene-equiv - 17 MtNH3)."
|
||||||
HVC_production_today,MtHVC/a,float,"The amount of high value chemicals (HVC) produced. This includes ethylene, propylene and BTX. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, Figure 16, page 107"
|
HVC_production_today,MtHVC/a,float,"The amount of high value chemicals (HVC) produced. This includes ethylene, propylene and BTX. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, Figure 16, page 107"
|
||||||
Mwh_elec_per_tHVC _mechanical_recycling,MWh/tHVC,float,"The energy amount of electricity needed to produce a ton of high value chemical (HVC) using mechanical recycling. From SI of `Meys et al (2020) <https://doi.org/10.1016/j.resconrec.2020.105010>`_, Table S5, for HDPE, PP, PS, PET. LDPE would be 0.756."
|
Mwh_elec_per_tHVC _mechanical_recycling,MWh/tHVC,float,"The energy amount of electricity needed to produce a ton of high value chemical (HVC) using mechanical recycling. From SI of `Meys et al (2020) <https://doi.org/10.1016/j.resconrec.2020.105010>`_, Table S5, for HDPE, PP, PS, PET. LDPE would be 0.756."
|
||||||
Mwh_elec_per_tHVC _chemical_recycling,MWh/tHVC,float,"The energy amount of electricity needed to produce a ton of high value chemical (HVC) using chemical recycling. The default value is based on pyrolysis and electric steam cracking. From `Material Economics (2019) <https://materialeconomics.com/latest-updates/industrial-transformation-2050>`_, page 125"
|
Mwh_elec_per_tHVC _chemical_recycling,MWh/tHVC,float,"The energy amount of electricity needed to produce a ton of high value chemical (HVC) using chemical recycling. The default value is based on pyrolysis and electric steam cracking. From `Material Economics (2019) <https://materialeconomics.com/latest-updates/industrial-transformation-2050>`_, page 125"
|
||||||
|
|
@ -10,6 +10,15 @@ Release Notes
|
|||||||
Upcoming Release
|
Upcoming Release
|
||||||
================
|
================
|
||||||
|
|
||||||
|
* Improved representation of industry transition pathways. A new script was
|
||||||
|
added to interpolate industry sector ratios from today's status quo to future
|
||||||
|
systems (i.e. specific emissions and demands for energy and feedstocks). For
|
||||||
|
each country we gradually switch industry processes from today's specific
|
||||||
|
energy carrier usage per ton material output to the best-in-class energy
|
||||||
|
consumption of tomorrow. This is done on a per-country basis. The ratio of
|
||||||
|
today to tomorrow's energy consumption is set with the ``industry:
|
||||||
|
sector_ratios_fraction_future:`` parameter.
|
||||||
|
|
||||||
* Bugfix: Correct units of subtracted chlorine and methanol demand in
|
* Bugfix: Correct units of subtracted chlorine and methanol demand in
|
||||||
:mod:`build_industry_sector_ratios`.
|
:mod:`build_industry_sector_ratios`.
|
||||||
|
|
||||||
|
@ -25,62 +25,52 @@ def build_industry_sector_ratios_intermediate():
|
|||||||
production = (
|
production = (
|
||||||
pd.read_csv(snakemake.input.industrial_production_per_country, index_col=0)
|
pd.read_csv(snakemake.input.industrial_production_per_country, index_col=0)
|
||||||
/ 1e3
|
/ 1e3
|
||||||
)
|
).stack()
|
||||||
production = production.unstack().swaplevel()
|
production.index.names = [None, None]
|
||||||
|
|
||||||
# in MWh/t
|
# in MWh/t
|
||||||
future_sector_ratios = pd.read_csv(
|
future_sector_ratios = pd.read_csv(
|
||||||
snakemake.input.industry_sector_ratios, index_col=0
|
snakemake.input.industry_sector_ratios, index_col=0
|
||||||
)
|
)
|
||||||
|
|
||||||
production.index.names = [None, None]
|
|
||||||
|
|
||||||
today_sector_ratios = demand.div(production, axis=1)
|
today_sector_ratios = demand.div(production, axis=1)
|
||||||
|
|
||||||
today_sector_ratios.drop(
|
today_sector_ratios.dropna(how="all", axis=1, inplace=True)
|
||||||
columns=today_sector_ratios.columns[today_sector_ratios.isna().all()],
|
|
||||||
inplace=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
rename = pd.Series(today_sector_ratios.index, today_sector_ratios.index)
|
rename = {
|
||||||
rename["waste"] = "biomass"
|
"waste": "biomass",
|
||||||
rename["electricity"] = "elec"
|
"electricity": "elec",
|
||||||
rename["solid"] = "coke"
|
"solid": "coke",
|
||||||
rename["gas"] = "methane"
|
"gas": "methane",
|
||||||
rename["other"] = "biomass"
|
"other": "biomass",
|
||||||
rename["liquid"] = "naphtha"
|
"liquid": "naphtha",
|
||||||
|
}
|
||||||
today_sector_ratios.rename(rename, inplace=True)
|
today_sector_ratios = today_sector_ratios.rename(rename).groupby(level=0).sum()
|
||||||
|
|
||||||
fraction_future = get(params["sector_ratios_fraction_future"], year)
|
fraction_future = get(params["sector_ratios_fraction_future"], year)
|
||||||
|
|
||||||
intermediate_sector_ratios = {}
|
intermediate_sector_ratios = {}
|
||||||
|
for ct, group in today_sector_ratios.T.groupby(level=0):
|
||||||
for ct in today_sector_ratios.columns.unique(level=0):
|
today_sector_ratios_ct = (
|
||||||
|
group.droplevel(0)
|
||||||
intermediate_sector_ratio = future_sector_ratios.copy()
|
.T.reindex_like(future_sector_ratios)
|
||||||
|
.fillna(future_sector_ratios)
|
||||||
intermediate_sector_ratio.loc[
|
)
|
||||||
today_sector_ratios[ct].index, today_sector_ratios[ct].columns
|
intermediate_sector_ratios[ct] = (
|
||||||
] = (
|
today_sector_ratios_ct * (1 - fraction_future)
|
||||||
fraction_future
|
+ future_sector_ratios * fraction_future
|
||||||
* intermediate_sector_ratio.loc[
|
|
||||||
today_sector_ratios[ct].index, today_sector_ratios[ct].columns
|
|
||||||
]
|
|
||||||
+ (1 - fraction_future) * today_sector_ratios[ct]
|
|
||||||
)
|
)
|
||||||
intermediate_sector_ratios[ct] = intermediate_sector_ratio
|
|
||||||
|
|
||||||
intermediate_sector_ratios = pd.concat(intermediate_sector_ratios, axis=1)
|
intermediate_sector_ratios = pd.concat(intermediate_sector_ratios, axis=1)
|
||||||
|
|
||||||
intermediate_sector_ratios.to_csv(snakemake.output.industry_sector_ratios)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if "snakemake" not in globals():
|
if "snakemake" not in globals():
|
||||||
from _helpers import mock_snakemake
|
from _helpers import mock_snakemake
|
||||||
|
|
||||||
snakemake = mock_snakemake("build_industry_sector_ratios_intermediate")
|
snakemake = mock_snakemake(
|
||||||
|
"build_industry_sector_ratios_intermediate",
|
||||||
|
planning_horizons="2030",
|
||||||
|
)
|
||||||
|
|
||||||
year = int(snakemake.wildcards.planning_horizons[-4:])
|
year = int(snakemake.wildcards.planning_horizons[-4:])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user