forked from TomTranter/JellyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpybamm_ecm_1d.py
55 lines (45 loc) · 1.33 KB
/
pybamm_ecm_1d.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
#
# Example running a 1D parallel string
#
import openpnm as op
import matplotlib.pyplot as plt
import ecm
import liionpack as lp
import pybamm
plt.close("all")
#pybamm.set_logging_level("INFO")
wrk = op.Workspace()
wrk.clear()
if __name__ == "__main__":
# Geometry of 1D mesh
Nunit = 10
spacing = 0.1
pos_tabs = [-1]
neg_tabs = [0]
length_3d = 1.0
# Experiment
I_app = 1.0
dt = 30
Nsteps = 12
hours = dt * Nsteps / 3600
experiment = pybamm.Experiment(
[
f"Discharge at {I_app} A for {hours} hours",
],
period=f"{dt} seconds",
)
# OpenPNM project
project, arc_edges = ecm.make_1D_net(Nunit, spacing, pos_tabs, neg_tabs)
# Parameter set
param = pybamm.ParameterValues("Chen2020")
# JellyBaMM discretises the spiral using the electrode height for spiral length
# This parameter set has the longer length set to the Electrode width
# We want to swap this round
param['Electrode width [m]'] = length_3d
initial_soc = None
# Run simulation
project, output = ecm.run_simulation_lp(parameter_values=param,
experiment=experiment,
initial_soc=initial_soc,
project=project)
lp.plot_output(output)