diff --git a/dev/Untitled1.ipynb b/dev/Untitled1.ipynb index a454cea1..2b7abb93 100644 --- a/dev/Untitled1.ipynb +++ b/dev/Untitled1.ipynb @@ -144,7 +144,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 7 worksheets in 0.04 seconds\n", + "Extracted 7 worksheets in 0.03 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -165,7 +165,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.02 seconds\n", + "Extracted 1 worksheets in 0.03 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -190,7 +190,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.05 seconds\n", + "Extracted 1 worksheets in 0.04 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -219,7 +219,9 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.48 seconds\n", + "Extracted 1 worksheets in 0.01 seconds\n", + "Remove uncertainty data.\n", + "Extracted 1 worksheets in 0.47 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -361,7 +363,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.02 seconds\n", + "Extracted 1 worksheets in 0.01 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -436,7 +438,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 5 worksheets in 0.18 seconds\n", + "Extracted 5 worksheets in 0.17 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -490,7 +492,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.56 seconds\n", + "Extracted 1 worksheets in 0.01 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -499,7 +501,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.04 seconds\n", + "Extracted 1 worksheets in 0.03 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -515,7 +517,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.09 seconds\n", + "Extracted 1 worksheets in 0.60 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -536,7 +538,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 1 worksheets in 0.03 seconds\n", + "Extracted 1 worksheets in 0.02 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -606,7 +608,7 @@ "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", "Remove uncertainty data.\n", - "Extracted 39 worksheets in 0.47 seconds\n", + "Extracted 39 worksheets in 0.50 seconds\n", "Migrating to 3.8 first\n", "Applying strategy: migrate_datasets\n", "Applying strategy: migrate_exchanges\n", @@ -680,7 +682,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "Processing scenarios: 100%|█████████████| 1/1 [00:10<00:00, 10.50s/it]" + "Processing scenarios: 100%|█████████████| 1/1 [00:09<00:00, 9.96s/it]" ] }, { @@ -703,6 +705,25 @@ "ndb.update(\"battery\")" ] }, + { + "cell_type": "code", + "execution_count": 6, + "id": "8a38e57d-83cd-4dd4-a4ce-306f5e58b78d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generate change report.\n", + "Report saved under /Users/romain/GitHub/premise/dev.\n" + ] + } + ], + "source": [ + "ndb.generate_change_report()" + ] + }, { "cell_type": "code", "execution_count": 6, @@ -724,7 +745,7 @@ "text": [ "Writing activities to SQLite3 database:\n", "0% [##############################] 100% | ETA: 00:00:00\n", - "Total time elapsed: 00:00:26\n" + "Total time elapsed: 00:00:25\n" ] }, { @@ -732,12 +753,12 @@ "output_type": "stream", "text": [ "Title: Writing activities to SQLite3 database:\n", - " Started: 07/14/2024 15:03:31\n", - " Finished: 07/14/2024 15:03:57\n", - " Total time elapsed: 00:00:26\n", - " CPU %: 92.10\n", - " Memory %: 15.60\n", - "Created database: battery 2\n", + " Started: 07/14/2024 20:32:00\n", + " Finished: 07/14/2024 20:32:25\n", + " Total time elapsed: 00:00:25\n", + " CPU %: 92.00\n", + " Memory %: 13.95\n", + "Created database: battery 3\n", "Generate scenario report.\n", "Report saved under /Users/romain/GitHub/premise/dev/export/scenario_report.\n", "Generate change report.\n", @@ -746,7 +767,7 @@ } ], "source": [ - "ndb.write_db_to_brightway(\"battery 2\")" + "ndb.write_db_to_brightway(\"battery 3\")" ] }, { diff --git a/docs/extract.rst b/docs/extract.rst index 3e76d37c..34546922 100644 --- a/docs/extract.rst +++ b/docs/extract.rst @@ -916,6 +916,7 @@ They introduce the following datasets: market for battery, Li-sulfur, Li-S GLO Wickerts et al. (2023) market for battery, Li-oxygen, Li-O2 GLO Wang et al. (2020) market for battery, Sodium-ion, SiB GLO Zhang et al. (2024) + market for battery, NaCl, rechargeable, prismatic GLO Galloway & Dustmann (2003) ============================================================= =========== ====================================== These battery inventories are mostly used by battery electric vehicles, @@ -927,8 +928,8 @@ Li-S inventories can be found here: LCI_batteries3_. Li-O2 inventories can be found here: LCI_batteries4_. And SIB inventories can be found here: LCI_batteries5_. -When using ecoinvent 3.9 and above, the NMC-111, NMC-811, LFP and NCA battery inventories are not imported -(as are already present the ecoinvent database). +When using ecoinvent 3.9 and above, the NMC-111, NMC-811, LFP and NCA battery inventories +are not imported (as are already present the ecoinvent database). Graphite -------- diff --git a/docs/transform.rst b/docs/transform.rst index e473a521..0ac7346e 100644 --- a/docs/transform.rst +++ b/docs/transform.rst @@ -42,14 +42,15 @@ Type Specific energy density (current) BoP mass share [%] [kWh/kg cell] density [kWh/kg battery] ====================== ==================================== ==================== ================== ================= =================== -Li-ion, NMC111 0.15 73% 0.11 9.2 177 -Li-ion, NMC811 0.22 71% 0.16 6.4 108 -Li-ion, NCA 0.25 71% 0.18 5.6 100 +Li-ion, NMC111 0.15 73% 0.11 7.0 177 +Li-ion, NMC622 0.20 73% 0.15 6.9 108 +Li-ion, NMC811 0.22 71% 0.16 6.7 108 +Li-ion, NCA 0.23 71% 0.16 6.3 100 Li-ion, LFP 0.14 73% 0.10 9.8 118 Li-ion, LiMn2O4 0.13 80% 0.10 9.6 92 -Li-ion, LTO 0.09 64% 0.06 18.8 450 +Li-ion, LTO 0.09 64% 0.05 18.4 450 Li-sulfur, Li-S 0.15 75% 0.11 8.9 352 -Li-oxygen, Li-O2 0.31 64% 0.20 5.1 125 +Li-oxygen, Li-O2 0.36 55% 0.20 5.1 125 Sodium-ion, SiB 0.16 75% 0.12 8.5 72 ====================== ==================================== ==================== ================== ================= =================== diff --git a/premise/battery.py b/premise/battery.py index 29978bbe..a31094c6 100644 --- a/premise/battery.py +++ b/premise/battery.py @@ -139,6 +139,34 @@ def adjust_battery_mass(self) -> None: self.write_log(ds, status="modified") + for ds in ws.get_many( + self.database, + ws.contains("name", "market for battery capacity"), + ): + + for exc in ws.technosphere(ds, ws.either(*filters)): + name = [x for x in energy_density if x in exc["name"]][0] + + scaling_factor = energy_density[name][2020] / np.clip( + np.interp( + self.year, + list(energy_density[name].keys()), + list(energy_density[name].values()), + ), + 0.1, + 0.5, + ) + + if "log parameters" not in ds: + ds["log parameters"] = {} + + ds["log parameters"]["battery input"] = exc["name"] + ds["log parameters"]["old battery mass"] = exc["amount"] + exc["amount"] *= scaling_factor + ds["log parameters"]["new battery mass"] = exc["amount"] + + self.write_log(ds, status="modified") + def write_log(self, dataset, status="created"): """ Write log file. diff --git a/premise/data/additional_inventories/lci-batteries-LiO2.xlsx b/premise/data/additional_inventories/lci-batteries-LiO2.xlsx index c22e4ac6..90ae1bf9 100644 Binary files a/premise/data/additional_inventories/lci-batteries-LiO2.xlsx and b/premise/data/additional_inventories/lci-batteries-LiO2.xlsx differ diff --git a/premise/data/additional_inventories/lci-batteries-LiS.xlsx b/premise/data/additional_inventories/lci-batteries-LiS.xlsx index f46a3fb7..46497764 100644 Binary files a/premise/data/additional_inventories/lci-batteries-LiS.xlsx and b/premise/data/additional_inventories/lci-batteries-LiS.xlsx differ diff --git a/premise/data/additional_inventories/lci-batteries-NMC622-LTO.xlsx b/premise/data/additional_inventories/lci-batteries-NMC622-LTO.xlsx index 276e3d9f..777ae11d 100644 Binary files a/premise/data/additional_inventories/lci-batteries-NMC622-LTO.xlsx and b/premise/data/additional_inventories/lci-batteries-NMC622-LTO.xlsx differ diff --git a/premise/data/additional_inventories/lci-batteries-SIB.xlsx b/premise/data/additional_inventories/lci-batteries-SIB.xlsx index e7c144b0..4f468f02 100644 Binary files a/premise/data/additional_inventories/lci-batteries-SIB.xlsx and b/premise/data/additional_inventories/lci-batteries-SIB.xlsx differ diff --git a/premise/data/additional_inventories/lci-battery-capacity.xlsx b/premise/data/additional_inventories/lci-battery-capacity.xlsx new file mode 100644 index 00000000..19d7c6cb Binary files /dev/null and b/premise/data/additional_inventories/lci-battery-capacity.xlsx differ diff --git a/premise/data/battery/energy_density.yaml b/premise/data/battery/energy_density.yaml index de50fd09..47a4dffa 100644 --- a/premise/data/battery/energy_density.yaml +++ b/premise/data/battery/energy_density.yaml @@ -69,7 +69,7 @@ Li-O2: ecoinvent_aliases: name: market for battery, Li-oxygen, Li-O2 target: - 2020: 0.240 + 2020: 0.360 2050: 0.500 Li-S: diff --git a/premise/new_database.py b/premise/new_database.py index 4d5c4cc8..0b092226 100644 --- a/premise/new_database.py +++ b/premise/new_database.py @@ -156,6 +156,7 @@ FILEPATH_BATTERIES_NMC622_LTO = INVENTORY_DIR / "lci-batteries-NMC622-LTO.xlsx" FILEPATH_LIO2_BATTERY = INVENTORY_DIR / "lci-batteries-LiO2.xlsx" FILEPATH_LIS_BATTERY = INVENTORY_DIR / "lci-batteries-LiS.xlsx" +FILEPATH_BATTERY_CAPACITY = INVENTORY_DIR / "lci-battery-capacity.xlsx" FILEPATH_PHOTOVOLTAICS = INVENTORY_DIR / "lci-PV.xlsx" FILEPATH_BIGCC = INVENTORY_DIR / "lci-BIGCC.xlsx" FILEPATH_NUCLEAR_EPR = INVENTORY_DIR / "lci-nuclear_EPR.xlsx" @@ -719,6 +720,7 @@ def __import_inventories(self) -> List[dict]: (FILEPATH_VANADIUM, "3.9"), (FILEPATH_SIB_BATTERY, "3.9"), (FILEPATH_HOME_STORAGE_BATTERIES, "3.9"), + (FILEPATH_BATTERY_CAPACITY, "3.10"), (FILEPATH_PHOTOVOLTAICS, "3.7"), (FILEPATH_HYDROGEN_INVENTORIES, "3.9"), (FILEPATH_HYDROGEN_SOLAR_INVENTORIES, "3.9"),