Skip to content

Commit aa78954

Browse files
authored
Fix: correct temperature initialisation in lumped and x_full thermal … (#5248)
* Fix: correct temperature initialisation in lumped and x_full thermal models * docs(changelog): add entry for lumped thermal model domain and T_init fix * Remove domain from T_vol_av since it's a scalar (review fix)
1 parent b3c32b0 commit aa78954

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

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

5252
## Bug fixes
5353

54+
- Fixed domain handling and temperature initialization in the lumped thermal model to ensure consistent behavior with spatial `T_init`. ([#5248](https://github.com/pybamm-team/PyBaMM/pull/5248))
5455
- Fixed non-deterministic plotting CI issues ([#5150](https://github.com/pybamm-team/PyBaMM/pull/5150))
5556
- Fix non-deterministic ShapeError in 3D FEM gradient method ([#5143](https://github.com/pybamm-team/PyBaMM/pull/5143))
5657
- Fixes negative electrode boundary values for half-cell voltage contributions. ([#5139](https://github.com/pybamm-team/PyBaMM/pull/5139))

src/pybamm/models/submodels/thermal/lumped.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def set_rhs(self, variables):
8989

9090
def set_initial_conditions(self, variables):
9191
T_vol_av = variables["Volume-averaged cell temperature [K]"]
92-
self.initial_conditions = {T_vol_av: self.param.T_init}
92+
T_init_av = pybamm.x_average(self.param.T_init)
93+
self.initial_conditions = {T_vol_av: T_init_av}
9394

9495
def calculate_Q_cr_W(self, current, contact_resistance):
9596
Q_cr_W = current**2 * contact_resistance

src/pybamm/models/submodels/thermal/pouch_cell/x_full.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,8 @@ def set_initial_conditions(self, variables):
179179
T_cn = variables["Negative current collector temperature [K]"]
180180
T_cp = variables["Positive current collector temperature [K]"]
181181
T_init = self.param.T_init
182-
self.initial_conditions = {T_cn: T_init, T: T_init, T_cp: T_init}
182+
self.initial_conditions = {
183+
T_cn: pybamm.boundary_value(T_init, "left"),
184+
T: T_init,
185+
T_cp: pybamm.boundary_value(T_init, "right"),
186+
}

0 commit comments

Comments
 (0)