diff --git a/src/pybamm/models/submodels/active_material/loss_active_material.py b/src/pybamm/models/submodels/active_material/loss_active_material.py index ffba064d03..23a907b9cb 100644 --- a/src/pybamm/models/submodels/active_material/loss_active_material.py +++ b/src/pybamm/models/submodels/active_material/loss_active_material.py @@ -1,5 +1,5 @@ # -# Class for varying active material volume fraction, driven by stress +# Class for varying active material volume fraction # import pybamm diff --git a/src/pybamm/models/submodels/particle_mechanics/crack_propagation.py b/src/pybamm/models/submodels/particle_mechanics/crack_propagation.py index 11dd8baf27..e0d21deecf 100644 --- a/src/pybamm/models/submodels/particle_mechanics/crack_propagation.py +++ b/src/pybamm/models/submodels/particle_mechanics/crack_propagation.py @@ -37,7 +37,7 @@ def __init__(self, param, domain, x_average, options, phase="primary"): def get_fundamental_variables(self): domain, Domain = self.domain_Domain phase_name = self.phase_param.phase_name - if self.x_average is True: + if self.x_average: if self.size_distribution: l_cr_av_dist = pybamm.Variable( f"X-averaged {domain} {phase_name}particle crack length distribution [m]", @@ -47,8 +47,10 @@ def get_fundamental_variables(self): }, scale=self.phase_param.l_cr_0, ) + l_cr_dist = pybamm.SecondaryBroadcast( + l_cr_av_dist, f"{domain} electrode" + ) l_cr_av = pybamm.size_average(l_cr_av_dist) - l_cr_dist = pybamm.PrimaryBroadcast(l_cr_av_dist, f"{domain} electrode") else: l_cr_av = pybamm.Variable( f"X-averaged {domain} {phase_name}particle crack length [m]", diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py index f728c12219..96af25766b 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py @@ -529,6 +529,7 @@ def test_well_posed_psd_mechanics(self): options = { "particle size": "distribution", "particle mechanics": "swelling and cracking", + "surface form": "algebraic", } self.check_well_posedness(options) 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 f69e96f7b5..c548aba490 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 @@ -78,21 +78,6 @@ def test_nonspherical_particle_not_implemented(self): with pytest.raises(NotImplementedError): pybamm.lithium_ion.MPM(options) - def test_loss_active_material_stress_negative_not_implemented(self): - options = {"loss of active material": ("stress-driven", "none")} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_loss_active_material_stress_positive_not_implemented(self): - options = {"loss of active material": ("none", "stress-driven")} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_loss_active_material_stress_both_not_implemented(self): - options = {"loss of active material": "stress-driven"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - def test_reversible_plating_with_porosity_not_implemented(self): options = { "lithium plating": "reversible", @@ -101,11 +86,6 @@ def test_reversible_plating_with_porosity_not_implemented(self): with pytest.raises(pybamm.OptionError, match="distributions"): pybamm.lithium_ion.MPM(options) - def test_stress_induced_diffusion_not_implemented(self): - options = {"stress-induced diffusion": "true"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - def test_msmr(self): options = { "open-circuit potential": "MSMR", @@ -186,25 +166,3 @@ def test_ec_reaction_limited_not_implemented(self): } with pytest.raises(NotImplementedError): pybamm.lithium_ion.MPM(options) - - -class TestMPMWithMechanics: - def test_well_posed_negative_cracking_not_implemented(self): - options = {"particle mechanics": ("swelling and cracking", "none")} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_well_posed_positive_cracking_not_implemented(self): - options = {"particle mechanics": ("none", "swelling and cracking")} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_well_posed_both_cracking_not_implemented(self): - options = {"particle mechanics": "swelling and cracking"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options) - - def test_well_posed_both_swelling_only_not_implemented(self): - options = {"particle mechanics": "swelling only"} - with pytest.raises(NotImplementedError): - pybamm.lithium_ion.MPM(options)