Skip to content

Commit

Permalink
Update docs on batteries.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Jul 14, 2024
1 parent 7207901 commit ee8d5b1
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 28 deletions.
61 changes: 41 additions & 20 deletions dev/Untitled1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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]"
]
},
{
Expand All @@ -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,
Expand All @@ -724,20 +745,20 @@
"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"
]
},
{
"name": "stdout",
"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",
Expand All @@ -746,7 +767,7 @@
}
],
"source": [
"ndb.write_db_to_brightway(\"battery 2\")"
"ndb.write_db_to_brightway(\"battery 3\")"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions docs/extract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
--------
Expand Down
11 changes: 6 additions & 5 deletions docs/transform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
====================== ==================================== ==================== ================== ================= ===================
Expand Down
28 changes: 28 additions & 0 deletions premise/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file modified premise/data/additional_inventories/lci-batteries-LiO2.xlsx
Binary file not shown.
Binary file modified premise/data/additional_inventories/lci-batteries-LiS.xlsx
Binary file not shown.
Binary file not shown.
Binary file modified premise/data/additional_inventories/lci-batteries-SIB.xlsx
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion premise/data/battery/energy_density.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions premise/new_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit ee8d5b1

Please sign in to comment.