Skip to content

Commit

Permalink
#2338 revert breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Nov 3, 2022
1 parent ee8bb48 commit 404031c
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 38 deletions.
8 changes: 4 additions & 4 deletions benchmarks/different_model_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ class TimeBuildModelSEI:
[
"none",
"constant",
"reaction limited (symmetric)",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited (symmetric)",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
)
Expand All @@ -144,12 +144,12 @@ class TimeSolveSEI:
[
"none",
"constant",
"reaction limited (symmetric)",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited (symmetric)",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
)
Expand Down
10 changes: 5 additions & 5 deletions examples/scripts/calendar_ageing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
pb.set_logging_level("INFO")

models = [
pb.lithium_ion.SPM({"SEI": "reaction limited (symmetric)"}),
pb.lithium_ion.SPMe({"SEI": "reaction limited (symmetric)"}),
pb.lithium_ion.SPM({"SEI": "reaction limited"}),
pb.lithium_ion.SPMe({"SEI": "reaction limited"}),
pb.lithium_ion.SPM(
{"SEI": "reaction limited (symmetric)", "surface form": "algebraic"},
{"SEI": "reaction limited", "surface form": "algebraic"},
name="Algebraic SPM",
),
pb.lithium_ion.SPMe(
{"SEI": "reaction limited (symmetric)", "surface form": "algebraic"},
{"SEI": "reaction limited", "surface form": "algebraic"},
name="Algebraic SPMe",
),
pb.lithium_ion.DFN({"SEI": "reaction limited (symmetric)"}),
pb.lithium_ion.DFN({"SEI": "reaction limited"}),
]

sims = []
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/cycling_ageing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pb.set_logging_level("NOTICE")
model = pb.lithium_ion.DFN(
{
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI film resistance": "distributed",
"SEI porosity change": "true",
"lithium plating": "irreversible",
Expand Down
9 changes: 4 additions & 5 deletions pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ class BatteryModelOptions(pybamm.FuzzyDict):
- "none": :class:`pybamm.sei.NoSEI` (no SEI growth)
- "constant": :class:`pybamm.sei.Constant` (constant SEI thickness)
- "reaction limited (symmetric)", "reaction limited (asymmetric)", \
- "reaction limited", "reaction limited (asymmetric)", \
"solvent-diffusion limited", "electron-migration limited", \
"interstitial-diffusion limited", \
"ec reaction limited (symmetric)" \
"interstitial-diffusion limited", "ec reaction limited" \
or "ec reaction limited (asymmetric)": :class:`pybamm.sei.SEIGrowth`
* "SEI film resistance" : str
Set the submodel for additional term in the overpotential due to SEI.
Expand Down Expand Up @@ -256,12 +255,12 @@ def __init__(self, extra_options):
"SEI": [
"none",
"constant",
"reaction limited (symmetric)",
"reaction limited",
"reaction limited (asymmetric)",
"solvent-diffusion limited",
"electron-migration limited",
"interstitial-diffusion limited",
"ec reaction limited (symmetric)",
"ec reaction limited",
"ec reaction limited (asymmetric)",
],
"SEI film resistance": ["none", "distributed", "average"],
Expand Down
2 changes: 1 addition & 1 deletion pybamm/models/full_battery_models/lithium_ion/Yang2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Yang2017(DFN):
def __init__(self, options=None, name="Yang2017", build=True):
options = {
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI film resistance": "distributed",
"SEI porosity change": "true",
"lithium plating": "irreversible",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_sei_constant(self):
self.run_basic_processing_test(options)

def test_sei_reaction_limited(self):
options = {"SEI": "reaction limited (symmetric)"}
options = {"SEI": "reaction limited"}
self.run_basic_processing_test(options)

def test_sei_asymmetric_reaction_limited(self):
Expand All @@ -75,7 +75,7 @@ def test_sei_interstitial_diffusion_limited(self):
self.run_basic_processing_test(options)

def test_sei_ec_reaction_limited(self):
options = {"SEI": "ec reaction limited (symmetric)"}
options = {"SEI": "ec reaction limited"}
self.run_basic_processing_test(options)

def test_sei_asymmetric_ec_reaction_limited(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_irreversible_plating_with_porosity(self):
self.run_basic_processing_test(options, parameter_values=param)

def test_sei_reaction_limited(self):
options = {"SEI": "reaction limited (symmetric)"}
options = {"SEI": "reaction limited"}
self.run_basic_processing_test(options)

def test_sei_asymmetric_reaction_limited(self):
Expand All @@ -192,7 +192,7 @@ def test_sei_interstitial_diffusion_limited(self):

def test_sei_ec_reaction_limited(self):
options = {
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI porosity change": "true",
}
self.run_basic_processing_test(options)
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_composite_graphite_silicon_sei(self):
options = {
"particle phases": ("2", "1"),
"open circuit potential": (("single", "current sigmoid"), "single"),
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
}
parameter_values = pybamm.ParameterValues("Chen2020_composite")
name = "Negative electrode active material volume fraction"
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def test_brosaplanella_2022(self):
self.assertNotIn("BrosaPlanella2022", citations._papers_to_cite)

pybamm.lithium_ion.SPM(
build=False, options={"SEI": "ec reaction limited (symmetric)"}
build=False, options={"SEI": "ec reaction limited"}
)
self.assertIn("BrosaPlanella2022", citations._papers_to_cite)
citations._reset()

pybamm.lithium_ion.SPMe(
build=False, options={"SEI": "ec reaction limited (symmetric)"}
build=False, options={"SEI": "ec reaction limited"}
)
self.assertIn("BrosaPlanella2022", citations._papers_to_cite)
citations._reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_run_experiment_termination_capacity(self):
* 10,
termination="99% capacity",
)
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited (symmetric)"})
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited"})
param = pybamm.ParameterValues("Chen2020")
param["SEI kinetic rate constant [m.s-1]"] = 1e-14
sim = pybamm.Simulation(model, experiment=experiment, parameter_values=param)
Expand All @@ -281,7 +281,7 @@ def test_run_experiment_termination_capacity(self):
* 10,
termination="5.04Ah capacity",
)
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited (symmetric)"})
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited"})
param = pybamm.ParameterValues("Chen2020")
param["SEI kinetic rate constant [m.s-1]"] = 1e-14
sim = pybamm.Simulation(model, experiment=experiment, parameter_values=param)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'particle phases': '1' (possible: ['1', '2'])
'particle shape': 'spherical' (possible: ['spherical', 'no particles'])
'particle size': 'single' (possible: ['single', 'distribution'])
'SEI': 'none' (possible: ['none', 'constant', 'reaction limited (symmetric)', 'reaction limited (asymmetric)', 'solvent-diffusion limited', 'electron-migration limited', 'interstitial-diffusion limited', 'ec reaction limited (symmetric)', 'ec reaction limited (asymmetric)'])
'SEI': 'none' (possible: ['none', 'constant', 'reaction limited', 'reaction limited (asymmetric)', 'solvent-diffusion limited', 'electron-migration limited', 'interstitial-diffusion limited', 'ec reaction limited', 'ec reaction limited (asymmetric)'])
'SEI film resistance': 'none' (possible: ['none', 'distributed', 'average'])
'SEI on cracks': 'false' (possible: ['false', 'true'])
'SEI porosity change': 'false' (possible: ['false', 'true'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_well_posed_constant_sei(self):
self.check_well_posedness(options)

def test_well_posed_reaction_limited_sei(self):
options = {"SEI": "reaction limited (symmetric)"}
options = {"SEI": "reaction limited"}
self.check_well_posedness(options)

def test_well_posed_asymmetric_reaction_limited_sei(self):
Expand All @@ -72,7 +72,7 @@ def test_well_posed_interstitial_diffusion_limited_sei(self):
self.check_well_posedness(options)

def test_well_posed_ec_reaction_limited_sei(self):
options = {"SEI": "ec reaction limited (symmetric)"}
options = {"SEI": "ec reaction limited"}
self.check_well_posedness(options)

def test_well_posed_asymmetric_ec_reaction_limited_sei(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_well_posed_sei_constant(self):
self.check_well_posedness(options)

def test_well_posed_sei_reaction_limited(self):
options = {"SEI": "reaction limited (symmetric)"}
options = {"SEI": "reaction limited"}
self.check_well_posedness(options)

def test_well_posed_asymmetric_sei_reaction_limited(self):
Expand All @@ -153,7 +153,7 @@ def test_well_posed_asymmetric_sei_reaction_limited(self):

def test_well_posed_sei_reaction_limited_average_film_resistance(self):
options = {
"SEI": "reaction limited (symmetric)",
"SEI": "reaction limited",
"SEI film resistance": "average",
}
self.check_well_posedness(options)
Expand All @@ -179,7 +179,7 @@ def test_well_posed_sei_interstitial_diffusion_limited(self):

def test_well_posed_sei_ec_reaction_limited(self):
options = {
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI porosity change": "true",
}
self.check_well_posedness(options)
Expand Down Expand Up @@ -223,7 +223,7 @@ def test_well_posed_mechanics_stress_induced_diffusion_mixed(self):

def test_well_posed_sei_reaction_limited_on_cracks(self):
options = {
"SEI": "reaction limited (symmetric)",
"SEI": "reaction limited",
"SEI on cracks": "true",
"particle mechanics": "swelling and cracking",
}
Expand Down Expand Up @@ -255,7 +255,7 @@ def test_well_posed_sei_interstitial_diffusion_limited_on_cracks(self):

def test_well_posed_sei_ec_reaction_limited_on_cracks(self):
options = {
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI porosity change": "true",
"SEI on cracks": "true",
"particle mechanics": "swelling and cracking",
Expand Down Expand Up @@ -349,7 +349,7 @@ def test_well_posed_particle_phases(self):
self.check_well_posedness(options)

def test_well_posed_particle_phases_sei(self):
options = {"particle phases": "2", "SEI": "ec reaction limited (symmetric)"}
options = {"particle phases": "2", "SEI": "ec reaction limited"}
self.check_well_posedness(options)

def test_well_posed_current_sigmoid_ocp(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def external_circuit_function(variables):

class TestMPMWithSEI(unittest.TestCase):
def test_reaction_limited_not_implemented(self):
options = {"SEI": "reaction limited (symmetric)"}
options = {"SEI": "reaction limited"}
with self.assertRaises(NotImplementedError):
pybamm.lithium_ion.MPM(options)

Expand All @@ -142,7 +142,7 @@ def test_interstitial_diffusion_limited_not_implemented(self):

def test_ec_reaction_limited_not_implemented(self):
options = {
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI porosity change": "true",
}
with self.assertRaises(NotImplementedError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_x_average_options(self):
options = {
"lithium plating": "irreversible",
"lithium plating porosity change": "true",
"SEI": "ec reaction limited (symmetric)",
"SEI": "ec reaction limited",
"SEI porosity change": "true",
"x-average side reactions": "true",
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_plotting/test_plot_summary_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TestPlotSummaryVariables(unittest.TestCase):
def test_plot(self):
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited (symmetric)"})
model = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited"})
parameter_values = pybamm.ParameterValues("Mohtat2020")
experiment = pybamm.Experiment(
[
Expand Down

0 comments on commit 404031c

Please sign in to comment.