diff --git a/src/pybamm/models/full_battery_models/base_battery_model.py b/src/pybamm/models/full_battery_models/base_battery_model.py index e47a6c05c8..83d62df278 100644 --- a/src/pybamm/models/full_battery_models/base_battery_model.py +++ b/src/pybamm/models/full_battery_models/base_battery_model.py @@ -525,14 +525,14 @@ def __init__(self, extra_options): # Options not yet compatible with particle-size distributions if options["particle size"] == "distribution": - if options["heat of mixing"] != "false": + if options["lithium plating porosity change"] != "false": raise NotImplementedError( - "Heat of mixing submodels do not yet support particle-size " - "distributions." + "Lithium plating porosity change not yet supported for particle-size" + " distributions." ) - if options["lithium plating"] != "none": + if options["heat of mixing"] != "false": raise NotImplementedError( - "Lithium plating submodels do not yet support particle-size " + "Heat of mixing submodels do not yet support particle-size " "distributions." ) if options["particle"] in ["quadratic profile", "quartic profile"]: diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_mpm.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_mpm.py index ad02212840..5f693264d3 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_mpm.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_mpm.py @@ -123,6 +123,18 @@ def test_wycisk_ocp(self): model = pybamm.lithium_ion.MPM(options) model.check_well_posedness() + def test_mpm_with_lithium_plating(self): + options = { + "lithium plating": "irreversible", + } + model = pybamm.lithium_ion.MPM(options) + model.check_well_posedness() + options = { + "lithium plating": "reversible", + } + model = pybamm.lithium_ion.MPM(options) + model.check_well_posedness() + class TestMPMExternalCircuits: def test_well_posed_voltage(self): @@ -196,15 +208,3 @@ def test_well_posed_both_swelling_only_not_implemented(self): options = {"particle mechanics": "swelling only"} with pytest.raises(NotImplementedError): pybamm.lithium_ion.MPM(options) - - -class TestMPMWithPlating: - def test_well_posed_reversible_plating_not_implemented(self): - options = {"lithium plating": "reversible"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_well_posed_irreversible_plating_not_implemented(self): - options = {"lithium plating": "irreversible"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options)