Skip to content

Commit 4a875e9

Browse files
authored
Total surface area to volume (#5165)
* calculate total surface are to volume * composite surface form test * changelog * skip newman tobias
1 parent 08008d1 commit 4a875e9

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Features
44

5+
- Added support for algebraic and differential surface form in composite models. ([#5165](https://github.com/pybamm-team/PyBaMM/pull/5165))
56
- Adds a composite electrode electrode soh model ([#5160](https://github.com/pybamm-team/PyBaMM/pull/5129))
67
- Generalises `set_initial_soc` to `set_initial_state` and adds Thevenin initial state setting. ([#5129](https://github.com/pybamm-team/PyBaMM/pull/5129))
78

src/pybamm/models/submodels/active_material/total_active_material.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,25 @@ def get_coupled_variables(self, variables):
4949
)
5050
variables.update({f"{Domain} electrode capacity [A.h]": C})
5151

52+
if self.options["particle shape"] == "spherical":
53+
# Ignore factor of 4pi that will cancel
54+
total_surface_area = sum(
55+
variables[f"{Domain} electrode {phase} active material volume fraction"]
56+
* variables[f"{Domain} {phase} particle radius [m]"] ** 2
57+
for phase in phases
58+
)
59+
total_volume = 3 * sum(
60+
variables[f"{Domain} {phase} particle radius [m]"] ** 3
61+
for phase in phases
62+
)
63+
total_surface_area_to_volume_ratio = total_surface_area / total_volume
64+
variables.update(
65+
{
66+
f"{Domain} electrode surface area to volume ratio [m-1]": total_surface_area_to_volume_ratio,
67+
f"X-averaged {domain} electrode surface area to volume ratio [m-1]": pybamm.x_average(
68+
total_surface_area_to_volume_ratio
69+
),
70+
}
71+
)
72+
5273
return variables

tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,3 +655,17 @@ def test_well_posed_composite_LAM(self):
655655
"loss of active material": "stress-driven",
656656
}
657657
self.check_well_posedness(options)
658+
659+
def test_well_posed_composite_differential_surface_form(self):
660+
options = {
661+
"particle phases": ("2", "2"),
662+
"surface form": "differential",
663+
}
664+
self.check_well_posedness(options)
665+
666+
def test_well_posed_composite_algebraic_surface_form(self):
667+
options = {
668+
"particle phases": ("2", "2"),
669+
"surface form": "algebraic",
670+
}
671+
self.check_well_posedness(options)

tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_newman_tobias.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ def test_well_posed_sei_VonKolzenberg2020_model(self):
5151
@pytest.mark.skip(reason="Test currently not implemented")
5252
def test_well_posed_sei_tunnelling_limited(self):
5353
pass # skip this test
54+
55+
@pytest.mark.skip(reason="Test currently not implemented")
56+
def test_well_posed_composite_differential_surface_form(self):
57+
pass # skip this test
58+
59+
@pytest.mark.skip(reason="Test currently not implemented")
60+
def test_well_posed_composite_algebraic_surface_form(self):
61+
pass # skip this test

0 commit comments

Comments
 (0)