-
Notifications
You must be signed in to change notification settings - Fork 2
/
calculate_masses_inactive.py
212 lines (159 loc) · 8.65 KB
/
calculate_masses_inactive.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
'''
This file contains the calculation of masses of inactive materials of the cell
Separator
Anode-collector
Cathode-collector
Casing
and contains the function for calculating the total mass
'''
from util import DENSITY_STEEL, DENSITY_ALUMINIUM, DENSITY_COPPER, general_materials_density
import math
def __calculate_prismatic_terminals(cell):
# Terminal height: 6-8 mm. avg. 7# DIN91252
h_avg = 7
# Terminal width: 9-18 mm.
w_avg = 13.5
# Terminal length: 24-28 mm
l_avg = 26
if "terminal_type" in cell:
if cell["terminal_type"] == "round":
d_terminal = cell["d_terminal"]
h_terminal = cell["h_terminal"]
vol_terminal = math.pi * (d_terminal/2)**2 * h_terminal # mm³
if cell["terminal_type"] == "square":
w_terminal = cell["w_terminal"]
l_terminal = cell["l_terminal"]
h_terminal = cell["h_terminal"]
vol_terminal = w_terminal * l_terminal * h_terminal # mm³
else:
# Use averages from above
vol_terminal = h_avg*w_avg*l_avg # mm³
mass_terminal = (vol_terminal/1000) * DENSITY_STEEL
mass_terminals = 2 * mass_terminal
return mass_terminals
def __calculate_masses_inactive_cylindric(cell, geometry_calculations):
L_tape = geometry_calculations["L_tape"]
# Mass of copper and aluminium in the collectors
# Round Cell
mAl_collector = ((L_tape * cell["al"] * cell["l_jellyroll"]) * 1000000) * DENSITY_ALUMINIUM # g
mCu_collector = ((L_tape * cell["cu"] * cell["l_jellyroll"]) * 1000000) * DENSITY_COPPER # g
print("* Mass calculation for aluminium and copper through the geometric estimation:")
print("Aluminium in collector: {mAl_collector:.2f} g, Copper in collector: {mCu_collector:.2f} g".format(
mAl_collector=mAl_collector, mCu_collector=mCu_collector))
# Mass calculation of separator
vSeparator = L_tape * (cell["sep"] + cell["sep2"]) * cell["l_jellyroll"] * 1000000 # cm³
mSep = cell["density_PP_PE"] * cell["porosity_Separator"] * vSeparator # g
print("Mass of separator: {mSep:.2f} g".format(mSep=mSep))
# Mass of the casing of the cell
# Round Cell
vCasing = ((((cell["D1"] / 2) ** 2) * math.pi * cell["housing_thickness"]) * 2 + 2 * math.pi * (cell["D1"] / 2) *
cell["l"] * cell["housing_thickness"]) * 1000000
mSteelCasing = DENSITY_STEEL * vCasing
print("* Mass calculation of the casing. Material of case: steel. geometric.")
print("Steel in casing: {mSteelCasing:.2f} g.".format(mSteelCasing=mSteelCasing))
return {"mAl_collector": mAl_collector,
"mCu_collector": mCu_collector,
"mSep": mSep,
"mCasing": mSteelCasing,
"mass_terminals": 0}
def __calculate_masses_inactive_prismatic(cell, geometry_calculations):
surface_cathode = geometry_calculations["surface_cathode"] / 2 # current collector is not double coated, hence by 2
surface_anode = geometry_calculations["surface_anode"] / 2 # current collector is not double coated, hence by 2
volume_separator = geometry_calculations["volume_separator"]
# Mass of copper and aluminium in the collectors
mAl_collector = ((surface_cathode * cell["al"]) * 1000000) * DENSITY_ALUMINIUM # g
mCu_collector = ((surface_anode * cell["cu"]) * 1000000) * DENSITY_COPPER # g
print("* Mass calculation for aluminium and copper through the geometric estimation:")
print("Aluminium in collector: {mAl_collector:.2f} g, Copper in collector: {mCu_collector:.2f} g".format(
mAl_collector=mAl_collector, mCu_collector=mCu_collector))
# Mass calculation of separator
vSeparator = volume_separator * 1000000 # cm³
mSep = cell["density_PP_PE"] * cell["porosity_Separator"] * vSeparator # g
print("Mass of separator: {mSep:.2f} g".format(mSep=mSep))
# Mass of the casing of the cell
V_casing_outside = cell["l"] * cell["b"] * cell["h"]
V_casing_inside = (cell["l"]-2*cell["housing_thickness"]) * (cell["b"]-2*cell["housing_thickness"]) * (cell["h"]-2*cell["housing_thickness"])
V_casing = V_casing_outside-V_casing_inside
if "casing_material" in cell:
casing_density = general_materials_density[cell["casing_material"]]
case_material = cell["casing_material"]
else:
casing_density = DENSITY_STEEL
case_material = "steel"
mSteelCasing = casing_density*1000000 * V_casing
print("* Mass calculation of the casing. Material of case: {}. geometric.".format(case_material))
print("Steel in casing: {mSteelCasing:.2f} g.".format(mSteelCasing=mSteelCasing))
# Mass Terminals
mass_terminals = __calculate_prismatic_terminals(cell)
print("* Mass calculation of the terminals")
print(f"Mass of terminals: {round(mass_terminals, 2)} g")
return {"mAl_collector": mAl_collector,
"mCu_collector": mCu_collector,
"mSep": mSep,
"mCasing": mSteelCasing,
"mass_terminals": mass_terminals}
def __calculate_masses_inactive_pouch(cell, geometry_calculations):
surface_cathode = geometry_calculations["surface_cathode"] / 2 # its not double coated, hence by 2
surface_anode = geometry_calculations["surface_anode"] / 2 # its not double coated, hence by 2
volume_separator = geometry_calculations["volume_separator"]
# Mass of copper and aluminium in the collectors
mAl_collector = ((surface_cathode * cell["al"]) * 1000000) * DENSITY_ALUMINIUM # g
mCu_collector = ((surface_anode * cell["cu"]) * 1000000) * DENSITY_COPPER # g
print("* Mass calculation for aluminium and copper through the geometric estimation:")
print("Aluminium in collector: {mAl_collector:.2f} g, Copper in collector: {mCu_collector:.2f} g".format(
mAl_collector=mAl_collector, mCu_collector=mCu_collector))
# Mass calculation of separator
vSeparator = volume_separator * 1000000 # cm³
mSep = cell["density_PP_PE"] * cell["porosity_Separator"] * vSeparator # g
print("Mass of separator: {mSep:.2f} g".format(mSep=mSep))
# Mass of the casing of the cell
V_casing_outside = cell["l"] * cell["b"] * cell["h"]
V_casing_inside = (cell["l"]-2*cell["housing_thickness"]) * (cell["b"]-2*cell["housing_thickness"]) * (cell["h"]-2*cell["housing_thickness"])
V_casing = V_casing_outside-V_casing_inside
mAluCasing = DENSITY_ALUMINIUM*1000000 * V_casing
print("* Mass calculation of the casing. Material of case: Alu compound. geometric.")
print("Alu in casing: {mAluCasing:.2f} g.".format(mAluCasing=mAluCasing))
return {"mAl_collector": mAl_collector,
"mCu_collector": mCu_collector,
"mSep": mSep,
"mCasing": mAluCasing,
"mass_terminals": 0}
def calculate_masses_inactive(cell, geometry_calculations):
inactive_masses=None
if cell["type"] == "18650" or cell["type"] == "21700":
inactive_masses = __calculate_masses_inactive_cylindric(cell, geometry_calculations)
if cell["type"] == "prismatic":
inactive_masses = __calculate_masses_inactive_prismatic(cell, geometry_calculations)
if cell["type"] == "pouch":
inactive_masses= __calculate_masses_inactive_pouch(cell, geometry_calculations)
return inactive_masses
def calculate_total_mass(inactive, active, cell, geometry_calculations):
# INPUT: mSteelCasing, mSep, mAl_collector, mCu_collector, mass_cat_material, mass_an_material)
mSteelCasing = inactive["mCasing"]
mSep = inactive["mSep"]
mAl_collector = inactive["mAl_collector"]
mCu_collector = inactive["mCu_collector"]
mass_cat_material = active["mass_cat_material"]
mass_an_material = active["mass_an_material"]
if "mass_terminals" in inactive:
mass_terminals = inactive["mass_terminals"]
else:
mass_terminals=0
# Total mass
total_mass_wo_electrolyte = mass_terminals + mSteelCasing + mSep + mAl_collector + mCu_collector + mass_cat_material + mass_an_material
# Mass of electrolyte:
cp = cell["cat_porosity"]
ap = cell["an_porosity"]
ps = cell["porosity_Separator"]
cv = geometry_calculations["volume_cathode"]
av = geometry_calculations["volume_anode"]
sv = geometry_calculations["volume_separator"]
vol_electrolyte = cp*cv*1000000 + ap*av*1000000 + ps*sv*1000000
mass_electrolyte = vol_electrolyte * 0.95 #g/cm³ #Wu2016
total_mass = total_mass_wo_electrolyte+mass_electrolyte
print("* Total mass of cell without electrolyte: {massCell:.2f} g. Mass electrolyte: {mass_ele:.2f} g".format(massCell=total_mass_wo_electrolyte, mass_ele=mass_electrolyte))
print("* Total mass of cell: {massCell:.2f} g".format(massCell=total_mass))
return {
"total_mass": total_mass,
"mass_electrolyte": mass_electrolyte
}