Skip to content

Commit

Permalink
Merge pull request #1958 from pybamm-team/issue-1957-q-iso
Browse files Browse the repository at this point in the history
#1957 return heat source in isothermal models
  • Loading branch information
rtimms authored Mar 9, 2022
2 parents fb76610 + 2de921e commit abba68e
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

## Features

- Added an option "calculate heat source for isothermal models" to choose whether or not the heat generation terms are computed when running models with the option `thermal="isothermal"` ([#1958](https://github.com/pybamm-team/PyBaMM/pull/1958))

## Bug fixes

- Fixed a bug where isothermal models did not compute any heat source terms ([#1958](https://github.com/pybamm-team/PyBaMM/pull/1958))

## Breaking changes

- Dropped support for Windows 32-bit architecture ([#1964](https://github.com/pybamm-team/PyBaMM/pull/1964))
Expand All @@ -8,7 +16,7 @@

## Features

- Isothermal models now compute heat source terms (but the temperature remains constant). The models now also account for current collector heating when `dimensionality=0` [#1929](https://github.com/pybamm-team/PyBaMM/pull/1929))
- Isothermal models now calculate heat source terms (but the temperature remains constant). The models now also account for current collector heating when `dimensionality=0` ([#1929](https://github.com/pybamm-team/PyBaMM/pull/1929))
- Added new models for power control and resistance control ([#1917](https://github.com/pybamm-team/PyBaMM/pull/1917))
- Initial concentrations can now be provided as a function of `r` as well as `x` ([#1866](https://github.com/pybamm-team/PyBaMM/pull/1866))

Expand Down
6 changes: 6 additions & 0 deletions pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class BatteryModelOptions(pybamm.FuzzyDict):
model with prescribed cell volume and cross-sectional area, and
(if thermal effects are included) solves a lumped thermal model
with prescribed surface area for cooling.
* "calculate heat source for isothermal models" : str
Whether to calculate the heat source terms during isothermal operation.
Can be "true" or "false". If "false", the heat source terms are set
to zero. Default is "false" since this option may require additional
parameters not needed by the electrochemical model.
* "convection" : str
Whether to include the effects of convection in the model. Can be
"none" (default), "uniform transverse" or "full transverse".
Expand Down Expand Up @@ -164,6 +169,7 @@ class BatteryModelOptions(pybamm.FuzzyDict):
def __init__(self, extra_options):
self.possible_options = {
"cell geometry": ["arbitrary", "pouch"],
"calculate heat source for isothermal models": ["false", "true"],
"convection": ["none", "uniform transverse", "full transverse"],
"current collector": [
"uniform",
Expand Down
36 changes: 36 additions & 0 deletions pybamm/models/submodels/thermal/isothermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,39 @@ def get_fundamental_variables(self):
)

return variables

def get_coupled_variables(self, variables):
if self.options["calculate heat source for isothermal models"] == "true":
variables.update(self._get_standard_coupled_variables(variables))
else:
ieh = "irreversible electrochemical heating"
variables.update(
{
"Ohmic heating": pybamm.Scalar(0),
"Ohmic heating [W.m-3]": pybamm.Scalar(0),
"X-averaged Ohmic heating": pybamm.Scalar(0),
"X-averaged Ohmic heating [W.m-3]": pybamm.Scalar(0),
"Volume-averaged Ohmic heating": pybamm.Scalar(0),
"Volume-averaged Ohmic heating [W.m-3]": pybamm.Scalar(0),
"Irreversible electrochemical heating": pybamm.Scalar(0),
"Irreversible electrochemical heating [W.m-3]": pybamm.Scalar(0),
"X-averaged " + ieh: pybamm.Scalar(0),
"X-averaged " + ieh + " [W.m-3]": pybamm.Scalar(0),
"Volume-averaged " + ieh: pybamm.Scalar(0),
"Volume-averaged " + ieh + "[W.m-3]": pybamm.Scalar(0),
"Reversible heating": pybamm.Scalar(0),
"Reversible heating [W.m-3]": pybamm.Scalar(0),
"X-averaged reversible heating": pybamm.Scalar(0),
"X-averaged reversible heating [W.m-3]": pybamm.Scalar(0),
"Volume-averaged reversible heating": pybamm.Scalar(0),
"Volume-averaged reversible heating [W.m-3]": pybamm.Scalar(0),
"Total heating": pybamm.Scalar(0),
"Total heating [W.m-3]": pybamm.Scalar(0),
"X-averaged total heating": pybamm.Scalar(0),
"X-averaged total heating [W.m-3]": pybamm.Scalar(0),
"Volume-averaged total heating": pybamm.Scalar(0),
"Volume-averaged total heating [W.m-3]": pybamm.Scalar(0),
}
)

return variables
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

PRINT_OPTIONS_OUTPUT = """\
'cell geometry': 'pouch' (possible: ['arbitrary', 'pouch'])
'calculate heat source for isothermal models': 'false' (possible: ['false', 'true'])
'convection': 'none' (possible: ['none', 'uniform transverse', 'full transverse'])
'current collector': 'uniform' (possible: ['uniform', 'potential pair', 'potential pair quite conductive'])
'dimensionality': 0 (possible: [0, 1, 2])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ def test_well_posed(self):
options = {"thermal": "isothermal"}
self.check_well_posedness(options)

def test_well_posed_isothermal_heat_source(self):
options = {
"calculate heat source for isothermal models": "true",
"thermal": "isothermal",
}
self.check_well_posedness(options)

def test_well_posed_2plus1D(self):
options = {"current collector": "potential pair", "dimensionality": 1}
self.check_well_posedness(options)
Expand Down

0 comments on commit abba68e

Please sign in to comment.