|
153 | 153 | "electrolysis small": "86 AEC 10 MW", |
154 | 154 | "gas storage": "150 Underground Storage of Gas", |
155 | 155 | "biomethanation": "106 Biomethanation of biogas", |
156 | | - |
157 | 156 | } |
158 | 157 | # [DEA-sheet-names] |
159 | 158 |
|
@@ -1314,12 +1313,13 @@ def unify_diw(cost_dataframe: pd.DataFrame) -> pd.DataFrame: |
1314 | 1313 |
|
1315 | 1314 |
|
1316 | 1315 | def biomethanation_dea(df): |
1317 | | - """This function does: |
| 1316 | + """ |
| 1317 | + This function does: |
1318 | 1318 | - import DEA data for biomethanation (4H2 + CO2 -> CH4 + 2H2O) |
1319 | 1319 | - recalculates cost and inputs per MW of H2 added (bus 0 is H2) |
1320 | 1320 | """ |
1321 | 1321 |
|
1322 | | - CO2_density = 1.98 / 1000 # kg/Nm3 |
| 1322 | + CO2_density = 1.98 / 1000 # kg/Nm3 |
1323 | 1323 | CH4_vol = 0.58 # biogas vol%, from DEA source for biomethanation |
1324 | 1324 | CO2_vol = 0.42 # biogas vol%, from DEA source for biomethanation |
1325 | 1325 | CH4_lhv = 35.8 / 3600 # MWh/Nm3 |
@@ -1349,12 +1349,14 @@ def biomethanation_dea(df): |
1349 | 1349 | df.loc[idx3[0]] = df.loc[idx3[0]].astype(float) * CO2_density # tCO2 / h / MW_H2 |
1350 | 1350 |
|
1351 | 1351 | # Biogas input in MWh/MWh_H2 |
1352 | | - df.loc['Biogas Consumption, [MWh_th/MWh_H2]'] = ( |
| 1352 | + df.loc["Biogas Consumption, [MWh_th/MWh_H2]"] = ( |
1353 | 1353 | df.loc[idx3[0]].astype(float) / CO2_biogas |
1354 | 1354 | ) |
1355 | 1355 |
|
1356 | 1356 | # Add biogas back to methane output (correct total output) |
1357 | | - df.loc[idx4] = df.loc[idx4].astype(float) + df.loc['Biogas Consumption, [MWh_th/MWh_H2]'] |
| 1357 | + df.loc[idx4] = ( |
| 1358 | + df.loc[idx4].astype(float) + df.loc["Biogas Consumption, [MWh_th/MWh_H2]"] |
| 1359 | + ) |
1358 | 1360 |
|
1359 | 1361 | # change unit to H2 basis |
1360 | 1362 | df.index = df.index.str.replace(" Total Input", "_H2") |
@@ -1389,7 +1391,9 @@ def biomethanation_dea(df): |
1389 | 1391 | if not matches.empty: |
1390 | 1392 | old_index = matches[0] |
1391 | 1393 | updated_index = old_index.replace(old_label, new_label) |
1392 | | - updated_index = updated_index.replace(old_units[old_label], new_units[old_label]) |
| 1394 | + updated_index = updated_index.replace( |
| 1395 | + old_units[old_label], new_units[old_label] |
| 1396 | + ) |
1393 | 1397 | df.rename(index={old_index: updated_index}, inplace=True) |
1394 | 1398 |
|
1395 | 1399 | return df |
@@ -2013,7 +2017,7 @@ def order_data(years: list, technology_dataframe: pd.DataFrame) -> pd.DataFrame: |
2013 | 2017 | | (df.unit == "EUR/MW input") |
2014 | 2018 | | (df.unit == "EUR/MW-methanol") |
2015 | 2019 | | (df.unit == "EUR/t_N2/h") # air separation unit |
2016 | | - | (df.unit == 'EUR/MW_H2') |
| 2020 | + | (df.unit == "EUR/MW_H2") |
2017 | 2021 | | (df.unit == "EUR/MW_biochar") |
2018 | 2022 | ) |
2019 | 2023 | ].copy() |
@@ -2048,7 +2052,7 @@ def order_data(years: list, technology_dataframe: pd.DataFrame) -> pd.DataFrame: |
2048 | 2052 | | (df.unit == "EUR/MW_MeOH/year") |
2049 | 2053 | | (df.unit == "EUR/MW_CH4/year") |
2050 | 2054 | | (df.unit == "EUR/MW_biochar/year") |
2051 | | - | (df.unit == 'EUR/MW_H2/year') |
| 2055 | + | (df.unit == "EUR/MW_H2/year") |
2052 | 2056 | | (df.unit == "% of specific investment/year") |
2053 | 2057 | | (df.unit == investment.unit.str.split(" ").iloc[0][0] + "/year") |
2054 | 2058 | ) |
@@ -2097,7 +2101,7 @@ def order_data(years: list, technology_dataframe: pd.DataFrame) -> pd.DataFrame: |
2097 | 2101 | | (df.unit == "EUR/MWhoutput") |
2098 | 2102 | | (df.unit == "EUR/MWh_CH4") |
2099 | 2103 | | (df.unit == "EUR/MWh_biochar") |
2100 | | - | (df.unit == 'EUR/MWh_H2') |
| 2104 | + | (df.unit == "EUR/MWh_H2") |
2101 | 2105 | | (tech_name == "biogas upgrading") |
2102 | 2106 | ) |
2103 | 2107 | ].copy() |
@@ -2306,22 +2310,32 @@ def order_data(years: list, technology_dataframe: pd.DataFrame) -> pd.DataFrame: |
2306 | 2310 | clean_df[tech_name] = pd.concat([clean_df[tech_name], efficiency_heat]) |
2307 | 2311 |
|
2308 | 2312 | elif tech_name == "biomethanation": |
2309 | | - h2_input = efficiency[efficiency.index.str.contains("Hydrogen Input")].copy() |
| 2313 | + h2_input = efficiency[ |
| 2314 | + efficiency.index.str.contains("Hydrogen Input") |
| 2315 | + ].copy() |
2310 | 2316 | h2_input["parameter"] = "Hydrogen Input" |
2311 | 2317 | clean_df[tech_name] = pd.concat([clean_df[tech_name], h2_input]) |
2312 | 2318 | co2_input = efficiency[efficiency.index.str.contains("CO2 Input")].copy() |
2313 | 2319 | co2_input["parameter"] = "CO2 Input" |
2314 | 2320 | clean_df[tech_name] = pd.concat([clean_df[tech_name], co2_input]) |
2315 | | - efficiency_heat_out = efficiency[efficiency.index.str.contains("H-Output")].copy() |
| 2321 | + efficiency_heat_out = efficiency[ |
| 2322 | + efficiency.index.str.contains("H-Output") |
| 2323 | + ].copy() |
2316 | 2324 | efficiency_heat_out["parameter"] = "heat output" |
2317 | 2325 | clean_df[tech_name] = pd.concat([clean_df[tech_name], efficiency_heat_out]) |
2318 | | - biomass_input = efficiency[efficiency.index.str.contains("Methane Output")].copy() |
| 2326 | + biomass_input = efficiency[ |
| 2327 | + efficiency.index.str.contains("Methane Output") |
| 2328 | + ].copy() |
2319 | 2329 | biomass_input["parameter"] = "Methane Output" |
2320 | 2330 | clean_df[tech_name] = pd.concat([clean_df[tech_name], biomass_input]) |
2321 | | - electricity_input = efficiency[efficiency.index.str.contains("El-Input")].copy() |
| 2331 | + electricity_input = efficiency[ |
| 2332 | + efficiency.index.str.contains("El-Input") |
| 2333 | + ].copy() |
2322 | 2334 | electricity_input["parameter"] = "electricity input" |
2323 | 2335 | clean_df[tech_name] = pd.concat([clean_df[tech_name], electricity_input]) |
2324 | | - biogas_input = efficiency[efficiency.index.str.contains("Biogas Consumption")].copy() |
| 2336 | + biogas_input = efficiency[ |
| 2337 | + efficiency.index.str.contains("Biogas Consumption") |
| 2338 | + ].copy() |
2325 | 2339 | biogas_input["parameter"] = "Biogas Input" |
2326 | 2340 | clean_df[tech_name] = pd.concat([clean_df[tech_name], biogas_input]) |
2327 | 2341 |
|
|
0 commit comments