Skip to content

Commit

Permalink
pybamm-team#573 update test files to check parameters work
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Feb 26, 2020
1 parent 9aadbb2 commit 617f186
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
26 changes: 4 additions & 22 deletions results/LGM50/test_LGM50.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
pybamm.set_logging_level("INFO")
experiment = pybamm.Experiment(
[
"Discharge at C/2 until 3.2 V",
"Discharge at 1.5C until 2.5 V",
"Rest for 2 hours",
],
period="10 seconds",
Expand All @@ -31,7 +31,7 @@
)

cspmax = 50483 * 1.25 #1.25
csnmax = 29583 * 1.12 #1.13
csnmax = 29583 * 1.13 #1.13

param["Initial concentration in negative electrode [mol.m-3]"] = 0.90 * csnmax
param["Initial concentration in positive electrode [mol.m-3]"] = 0.26 * cspmax
Expand All @@ -42,6 +42,8 @@
param["Negative electrode Bruggeman coefficient (electrolyte)"] = 1.5
param["Positive electrode Bruggeman coefficient (electrolyte)"] = 1.5
param["Separator Bruggeman coefficient (electrolyte)"] = 1.5
param["Positive electrode diffusivity [m2.s-1]"] = 4E-15
param["Negative electrode diffusivity [m2.s-1]"] = 3.3E-14

# param["Positive electrode conductivity [S.m-1]"] = 10 # Inf detected
# param["Maximum concentration in positive electrode [mol.m-3]"] = 51217.9257309275 # Inf detected
Expand All @@ -54,26 +56,6 @@

# param["Negative electrode OCP [V]"] = "[function]graphite_mcmb2528_ocp_Dualfoil1998"

plt.figure(num=1, figsize=(6, 4))
plt.plot(
param["Positive electrode OCP [V]"][1][:, 0],
param["Positive electrode OCP [V]"][1][:, 1]
)
plt.xlabel("Stoichiometry")
plt.ylabel("OCV cathode [V]")
plt.tight_layout()

plt.figure(num=2, figsize=(6, 4))
plt.plot(
param["Negative electrode OCP [V]"][1][:, 0],
param["Negative electrode OCP [V]"][1][:, 1]
)
plt.xlabel("Stoichiometry")
plt.ylabel("OCV anode [V]")
plt.tight_layout()

plt.show()

sim = pybamm.Simulation(
model,
parameter_values=param,
Expand Down
18 changes: 18 additions & 0 deletions results/LGM50/test_OCVs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pybamm
import matplotlib.pyplot as plt
import numpy as np

param = pybamm.standard_parameters_lithium_ion
parameter_values = pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Chen2020)
sto = pybamm.Vector(np.linspace(0, 1, 200))
T = 300
sto_eval = sto.evaluate()
fig, ax = plt.subplots()
ocp_n = parameter_values.process_symbol(param.U_n_dimensional(sto, T)).evaluate()
ocp_p = parameter_values.process_symbol(param.U_p_dimensional(sto, T)).evaluate()
ax.plot(sto_eval, ocp_n, label="negative")
ax.plot(sto_eval, ocp_p, label="positive")
ax.set_xlabel("Stoichiometry")
ax.set_ylabel("U")
ax.legend()
plt.show()

0 comments on commit 617f186

Please sign in to comment.