Skip to content

Commit 8fbced5

Browse files
authored
Fix psd 2 phases (#5415)
* Update secondary particle size calculations in battery geometry Now if >2 phases == true, the bounds of secondary phase PSD are correct * Update CHANGELOG with recent bug fixes and changes * Update bug fix entry in CHANGELOG.md * remove '-'
1 parent 67d3e78 commit 8fbced5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
2020

2121
- Fixed a bug in the exchange current density calculation for MSMR models. ([#5404](https://github.com/pybamm-team/PyBaMM/pull/5404))
2222
- Fixed a bug where when converting `ExpressionFunctionParameter` to source code, `Interpolant` objects were being reduced to just their input variable names (e.g., sto) instead of preserving the full constructor call with data arrays. ([#5393](https://github.com/pybamm-team/PyBaMM/pull/5393))
23+
- Fixed a bug when using 2 phases with particle size distribution the bounds of the particle size distribution were always taken from the primary phase. ([#5415](https://github.com/pybamm-team/PyBaMM/pull/5415))
2324

2425
## Breaking changes
2526

src/pybamm/geometry/battery_geometry.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ def battery_geometry(
8585
)
8686
phases = int(options.negative["particle phases"])
8787
if phases >= 2:
88+
R_min_n_sec = geo.n.sec.R_min
89+
R_max_n_sec = geo.n.sec.R_max
8890
geometry.update(
8991
{
9092
"negative primary particle size": {
9193
"R_n_prim": {"min": R_min_n, "max": R_max_n}
9294
},
9395
"negative secondary particle size": {
94-
"R_n_sec": {"min": R_min_n, "max": R_max_n}
96+
"R_n_sec": {"min": R_min_n_sec, "max": R_max_n_sec}
9597
},
9698
}
9799
)
@@ -109,13 +111,15 @@ def battery_geometry(
109111
)
110112
phases = int(options.positive["particle phases"])
111113
if phases >= 2:
114+
R_min_p_sec = geo.p.sec.R_min
115+
R_max_p_sec = geo.p.sec.R_max
112116
geometry.update(
113117
{
114118
"positive primary particle size": {
115119
"R_p_prim": {"min": R_min_p, "max": R_max_p}
116120
},
117121
"positive secondary particle size": {
118-
"R_p_sec": {"min": R_min_p, "max": R_max_p}
122+
"R_p_sec": {"min": R_min_p_sec, "max": R_max_p_sec}
119123
},
120124
}
121125
)

0 commit comments

Comments
 (0)