Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1957 return heat source in isothermal models #1958

Merged
merged 8 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

## Bug fixes

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

# [v22.2](https://github.com/pybamm-team/PyBaMM/tree/v22.2) - 2022-02-28

## 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 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))
- 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.
* "compute heat source for isothermal models" : str
Whether to compute 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"],
"compute 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["compute 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'])
'compute 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 = {
"compute 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