From 617f186979555911c5c354196ab20baff65b8665 Mon Sep 17 00:00:00 2001 From: Ferran Brosa Planella Date: Tue, 11 Feb 2020 22:35:54 +0000 Subject: [PATCH] #573 update test files to check parameters work --- results/LGM50/test_LGM50.py | 26 ++++---------------------- results/LGM50/test_OCVs.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 results/LGM50/test_OCVs.py diff --git a/results/LGM50/test_LGM50.py b/results/LGM50/test_LGM50.py index 2af83c34db..38ea7f5e2c 100644 --- a/results/LGM50/test_LGM50.py +++ b/results/LGM50/test_LGM50.py @@ -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", @@ -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 @@ -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 @@ -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, diff --git a/results/LGM50/test_OCVs.py b/results/LGM50/test_OCVs.py new file mode 100644 index 0000000000..e59c33cdbe --- /dev/null +++ b/results/LGM50/test_OCVs.py @@ -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() \ No newline at end of file