Skip to content

Commit adda336

Browse files
rtimmsSaransh-cpp
authored andcommitted
#3611 use actual cell volume for average total heating (#3707)
* #3611 use actual cell volume for average total heating * #3611 changelog * #3611 account for number of electrode pairs * #3611 update variable names
1 parent f22f547 commit adda336

File tree

8 files changed

+606
-521
lines changed

8 files changed

+606
-521
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)
22

3-
## Bug Fixes
3+
## Bug fixes
44

55
- Fixed a bug where if the first step(s) in a cycle are skipped then the cycle solution started from the model's initial conditions instead of from the last state of the previous cycle ([#3708](https://github.com/pybamm-team/PyBaMM/pull/3708))
6+
- Fixed a bug where the lumped thermal model conflates cell volume with electrode volume ([#3707](https://github.com/pybamm-team/PyBaMM/pull/3707))
7+
8+
## Breaking changes
9+
- The parameters `GeometricParameters.A_cooling` and `GeometricParameters.V_cell` are now automatically computed from the electrode heights, widths and thicknesses if the "cell geometry" option is "pouch" and from the parameters "Cell cooling surface area [m2]" and "Cell volume [m3]", respectively, otherwise. When using the lumped thermal model we recommend using the "arbitrary" cell geometry and specifying the parameters "Cell cooling surface area [m2]", "Cell volume [m3]" and "Total heat transfer coefficient [W.m-2.K-1]" directly. ([#3707](https://github.com/pybamm-team/PyBaMM/pull/3707))
10+
611
# [v24.1rc0](https://github.com/pybamm-team/PyBaMM/tree/v24.1rc0) - 2024-01-31
712

813
## Features

docs/source/examples/notebooks/models/jelly-roll-model.ipynb

Lines changed: 11 additions & 8 deletions
Large diffs are not rendered by default.

docs/source/examples/notebooks/models/pouch-cell-model.ipynb

Lines changed: 10 additions & 21 deletions
Large diffs are not rendered by default.

docs/source/examples/notebooks/models/thermal-models.ipynb

Lines changed: 492 additions & 458 deletions
Large diffs are not rendered by default.

examples/scripts/thermal_lithium_ion.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
pybamm.set_logging_level("INFO")
77

88
# load models
9+
# for the full model we use the "x-full" thermal submodel, which means that we solve
10+
# the thermal model in the x-direction for a single-layer pouch cell
11+
# for the lumped model we use the "arbitrary" cell geometry, which means that we can
12+
# specify the surface area for cooling and total heat transfer coefficient
913
full_thermal_model = pybamm.lithium_ion.SPMe(
1014
{"thermal": "x-full"}, name="full thermal model"
1115
)
1216
lumped_thermal_model = pybamm.lithium_ion.SPMe(
13-
{"thermal": "lumped"}, name="lumped thermal model"
17+
{"cell geometry": "arbitrary", "thermal": "lumped"}, name="lumped thermal model"
1418
)
1519
models = [full_thermal_model, lumped_thermal_model]
1620

@@ -31,27 +35,43 @@
3135
}
3236
)
3337
# for the lumped model we set the "Total heat transfer coefficient [W.m-2.K-1]"
34-
# parameter as well as the "Cell cooling surface area [m2]" parameter. Since the "full"
35-
# model only accounts for cooling from the large surfaces of the pouch, we set the
36-
# "Surface area for cooling" parameter to the area of the large surfaces of the pouch,
37-
# and the total heat transfer coefficient to 5 W.m-2.K-1
38+
# parameter as well as the "Cell cooling surface area [m2]" and "Cell volume [m3]
39+
# parameters. Since the "full" model only accounts for cooling from the large surfaces
40+
# of the pouch, we set the "Surface area for cooling [m2]" parameter to the area of the
41+
# large surfaces of the pouch, and the total heat transfer coefficient to 5 W.m-2.K-1
3842
A = parameter_values["Electrode width [m]"] * parameter_values["Electrode height [m]"]
43+
contributing_layers = [
44+
"Negative current collector",
45+
"Negative electrode",
46+
"Separator",
47+
"Positive electrode",
48+
"Positive current collector",
49+
]
50+
total_thickness = sum(
51+
[parameter_values[layer + " thickness [m]"] for layer in contributing_layers]
52+
)
53+
electrode_volume = (
54+
total_thickness
55+
* parameter_values["Electrode height [m]"]
56+
* parameter_values["Electrode width [m]"]
57+
)
3958
lumped_params = parameter_values.copy()
4059
lumped_params.update(
4160
{
4261
"Total heat transfer coefficient [W.m-2.K-1]": 5,
4362
"Cell cooling surface area [m2]": 2 * A,
63+
"Cell volume [m3]": electrode_volume,
4464
}
4565
)
46-
params = [full_params, lumped_params]
66+
4767
# loop over the models and solve
68+
params = [full_params, lumped_params]
4869
sols = []
4970
for model, param in zip(models, params):
5071
sim = pybamm.Simulation(model, parameter_values=param)
5172
sim.solve([0, 3600])
5273
sols.append(sim.solution)
5374

54-
5575
# plot
5676
output_variables = [
5777
"Voltage [V]",

pybamm/models/full_battery_models/base_battery_model.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pybamm
66
from functools import cached_property
7-
import warnings
87

98
from pybamm.expression_tree.operations.serialise import Serialise
109

@@ -683,24 +682,6 @@ def __init__(self, extra_options):
683682
f"Possible values are {self.possible_options[option]}"
684683
)
685684

686-
# Issue a warning to let users know that the 'lumped' thermal option (or
687-
# equivalently 'x-lumped' with 0D current collectors) now uses the total heat
688-
# transfer coefficient, surface area for cooling, and cell volume parameters,
689-
# regardless of the 'cell geometry option' chosen.
690-
thermal_option = options["thermal"]
691-
dimensionality_option = options["dimensionality"]
692-
if thermal_option == "lumped" or (
693-
thermal_option == "x-lumped" and dimensionality_option == 0
694-
):
695-
message = (
696-
f"The '{thermal_option}' thermal option with "
697-
f"'dimensionality' {dimensionality_option} now uses the parameters "
698-
"'Cell cooling surface area [m2]', 'Cell volume [m3]' and "
699-
"'Total heat transfer coefficient [W.m-2.K-1]' to compute the cell "
700-
"cooling term, regardless of the value of the the 'cell geometry' "
701-
"option. Please update your parameters accordingly."
702-
)
703-
warnings.warn(message, pybamm.OptionWarning, stacklevel=2)
704685
super().__init__(options.items())
705686

706687
@property

pybamm/models/submodels/thermal/base_thermal.py

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,32 +179,74 @@ def _get_standard_coupled_variables(self, variables):
179179
Q = Q_ohm + Q_rxn + Q_rev
180180

181181
# Compute the X-average over the entire cell, including current collectors
182+
# Note: this can still be a function of y and z for higher-dimensional pouch
183+
# cell models
182184
Q_ohm_av = self._x_average(Q_ohm, Q_ohm_s_cn, Q_ohm_s_cp)
183185
Q_rxn_av = self._x_average(Q_rxn, 0, 0)
184186
Q_rev_av = self._x_average(Q_rev, 0, 0)
185187
Q_av = self._x_average(Q, Q_ohm_s_cn, Q_ohm_s_cp)
186188

187-
# Compute volume-averaged heat source terms
188-
Q_ohm_vol_av = self._yz_average(Q_ohm_av)
189-
Q_rxn_vol_av = self._yz_average(Q_rxn_av)
190-
Q_rev_vol_av = self._yz_average(Q_rev_av)
191-
Q_vol_av = self._yz_average(Q_av)
189+
# Compute the integrated heat source per unit simulated electrode-pair area
190+
# in W.m-2. Note: this can still be a function of y and z for
191+
# higher-dimensional pouch cell models
192+
Q_ohm_Wm2 = Q_ohm_av * param.L
193+
Q_rxn_Wm2 = Q_rxn_av * param.L
194+
Q_rev_Wm2 = Q_rev_av * param.L
195+
Q_Wm2 = Q_av * param.L
196+
# Now average over the electrode height and width
197+
Q_ohm_Wm2_av = self._yz_average(Q_ohm_Wm2)
198+
Q_rxn_Wm2_av = self._yz_average(Q_rxn_Wm2)
199+
Q_rev_Wm2_av = self._yz_average(Q_rev_Wm2)
200+
Q_Wm2_av = self._yz_average(Q_Wm2)
201+
202+
# Compute total heat source terms (in W) over the *entire cell volume*, not
203+
# the product of electrode height * electrode width * electrode stack thickness
204+
# Note: we multiply by the number of electrode pairs, since the Q_xx_Wm2_av
205+
# variables are per electrode pair
206+
n_elec = param.n_electrodes_parallel
207+
A = param.L_y * param.L_z # *modelled* electrode area
208+
Q_ohm_W = Q_ohm_Wm2_av * n_elec * A
209+
Q_rxn_W = Q_rxn_Wm2_av * n_elec * A
210+
Q_rev_W = Q_rev_Wm2_av * n_elec * A
211+
Q_W = Q_Wm2_av * n_elec * A
212+
213+
# Compute volume-averaged heat source terms over the *entire cell volume*, not
214+
# the product of electrode height * electrode width * electrode stack thickness
215+
V = param.V_cell # *actual* cell volume
216+
Q_ohm_vol_av = Q_ohm_W / V
217+
Q_rxn_vol_av = Q_rxn_W / V
218+
Q_rev_vol_av = Q_rev_W / V
219+
Q_vol_av = Q_W / V
192220

193221
variables.update(
194222
{
223+
# Ohmic
195224
"Ohmic heating [W.m-3]": Q_ohm,
196225
"X-averaged Ohmic heating [W.m-3]": Q_ohm_av,
197226
"Volume-averaged Ohmic heating [W.m-3]": Q_ohm_vol_av,
227+
"Ohmic heating per unit electrode-pair area [W.m-2]": Q_ohm_Wm2,
228+
"Ohmic heating [W]": Q_ohm_W,
229+
# Irreversible
198230
"Irreversible electrochemical heating [W.m-3]": Q_rxn,
199231
"X-averaged irreversible electrochemical heating [W.m-3]": Q_rxn_av,
200232
"Volume-averaged irreversible electrochemical heating "
201233
+ "[W.m-3]": Q_rxn_vol_av,
234+
"Irreversible electrochemical heating per unit "
235+
+ "electrode-pair area [W.m-2]": Q_rxn_Wm2,
236+
"Irreversible electrochemical heating [W]": Q_rxn_W,
237+
# Reversible
202238
"Reversible heating [W.m-3]": Q_rev,
203239
"X-averaged reversible heating [W.m-3]": Q_rev_av,
204240
"Volume-averaged reversible heating [W.m-3]": Q_rev_vol_av,
241+
"Reversible heating per unit electrode-pair area " "[W.m-2]": Q_rev_Wm2,
242+
"Reversible heating [W]": Q_rev_W,
243+
# Total
205244
"Total heating [W.m-3]": Q,
206245
"X-averaged total heating [W.m-3]": Q_av,
207246
"Volume-averaged total heating [W.m-3]": Q_vol_av,
247+
"Total heating per unit electrode-pair area [W.m-2]": Q_Wm2,
248+
"Total heating [W]": Q_W,
249+
# Current collector
208250
"Negative current collector Ohmic heating [W.m-3]": Q_ohm_s_cn,
209251
"Positive current collector Ohmic heating [W.m-3]": Q_ohm_s_cp,
210252
}

pybamm/parameters/geometric_parameters.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,19 @@ def _set_parameters(self):
4242
self.r_inner = pybamm.Parameter("Inner cell radius [m]")
4343
self.r_outer = pybamm.Parameter("Outer cell radius [m]")
4444
self.A_cc = self.L_y * self.L_z # Current collector cross sectional area
45-
self.A_cooling = pybamm.Parameter("Cell cooling surface area [m2]")
46-
self.V_cell = pybamm.Parameter("Cell volume [m3]")
45+
46+
# Cell surface area and volume (for thermal models only)
47+
cell_geometry = self.options.get("cell geometry", None)
48+
if cell_geometry == "pouch":
49+
# assuming a single-layer pouch cell for now, see
50+
# https://github.com/pybamm-team/PyBaMM/issues/1777
51+
self.A_cooling = 2 * (
52+
self.L_y * self.L_z + self.L_z * self.L + self.L_y * self.L
53+
)
54+
self.V_cell = self.L_y * self.L_z * self.L
55+
else:
56+
self.A_cooling = pybamm.Parameter("Cell cooling surface area [m2]")
57+
self.V_cell = pybamm.Parameter("Cell volume [m3]")
4758

4859

4960
class DomainGeometricParameters(BaseParameters):

0 commit comments

Comments
 (0)