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

allow double-layer capacitance to depend on temperature #3174

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

## Breaking changes
## Features

- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044))
- Double-layer capacity can now be provided as a function of temperature ([#3174](https://github.com/pybamm-team/PyBaMM/pull/3174))

## Bug fixes

- Parameters in `Prada2013` have been updated to better match those given in the paper, which is a 2.3 Ah cell, instead of the mix-and-match with the 1.1 Ah cell from Lain2019.
- Error generated when invalid parameter values are passed.
- Thevenin() model is now constructed with standard variables: `Time [s], Time [min], Time [h]` ([#3143](https://github.com/pybamm-team/PyBaMM/pull/3143))
- Thevenin() model is now constructed with standard variables: `Time [s], Time [min], Time [h]` ([#3143](https://github.com/pybamm-team/PyBaMM/pull/3143))

## Breaking changes

- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044))

# [v23.5](https://github.com/pybamm-team/PyBaMM/tree/v23.5) - 2023-06-18

Expand All @@ -27,7 +31,7 @@

## Bug fixes

- Realign 'count' increment in CasadiSolver._integrate() ([#2986](https://github.com/pybamm-team/PyBaMM/pull/2986))
- Realign 'count' increment in CasadiSolver.\_integrate() ([#2986](https://github.com/pybamm-team/PyBaMM/pull/2986))
- Fix `pybamm_install_odes` and update the required SUNDIALS version ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958))
- Fixed a bug where all data included in a BPX was incorrectly assumed to be given as a function of time.([#2957](https://github.com/pybamm-team/PyBaMM/pull/2957))
- Remove brew install for Mac from the recommended developer installation options for SUNDIALS ([#2925](https://github.com/pybamm-team/PyBaMM/pull/2925))
Expand Down
6 changes: 5 additions & 1 deletion pybamm/models/submodels/electrode/ohm/li_metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def set_rhs(self, variables):
delta_phi = variables[
"Lithium metal interface surface potential difference [V]"
]
# temperature at the interface of the negative electrode with the separator
T = pybamm.boundary_value(
variables["Negative electrode temperature [K]"], "right"
)

C_dl = self.domain_param.C_dl
C_dl = self.domain_param.C_dl(T)

self.rhs[delta_phi] = 1 / C_dl * (i_cc - sum_j)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def set_rhs(self, variables):
f"X-averaged {domain} electrode surface potential difference [V]"
]

C_dl = self.domain_param.C_dl
T = variables[f"X-averaged {domain} electrode temperature [K]"]

C_dl = self.domain_param.C_dl(T)

self.rhs[delta_phi] = 1 / C_dl * (sum_a_j_av - sum_a_j)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def set_rhs(self, variables):

domain, Domain = self.domain_Domain

C_dl = self.domain_param.C_dl
T = variables[f"{Domain} electrode temperature [K]"]

C_dl = self.domain_param.C_dl(T)

delta_phi = variables[f"{Domain} electrode surface potential difference [V]"]
i_e = variables[f"{Domain} electrolyte current density [A.m-2]"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def set_rhs(self, variables):
f"X-averaged {domain} electrode surface potential difference [V]"
]

C_dl = self.domain_param.C_dl
T = variables[f"X-averaged {domain} electrode temperature [K]"]

C_dl = self.domain_param.C_dl(T)

self.rhs[delta_phi] = 1 / C_dl * (sum_a_j_av - sum_a_j)

Expand Down
14 changes: 10 additions & 4 deletions pybamm/parameters/lead_acid_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,6 @@ def _set_parameters(self):
self.DeltaV = self.DeltaVsurf + self.DeltaVliq

self.Q_max = pybamm.Parameter(f"{Domain} electrode volumetric capacity [C.m-3]")
self.C_dl = pybamm.Parameter(
f"{Domain} electrode double-layer capacity [F.m-2]"
)

# In lead-acid the current collector and electrodes are the same (same
# conductivity) but we correct here for Bruggeman. Note that because for
Expand All @@ -314,8 +311,17 @@ def _set_parameters(self):
# T_ref.
self.sigma_cc = self.sigma(main.T_ref) * (1 - self.eps_max) ** self.b_s

def C_dl(self, T):
"""Dimensional double-layer capacity [F.m-2]"""
inputs = {"Temperature [K]": T}
Domain = self.domain.capitalize()
return pybamm.FunctionParameter(
f"{Domain} electrode double-layer capacity [F.m-2]", inputs
)

def sigma(self, T):
"""Dimensional electrical conductivity"""
"""Dimensional electrical conductivity [S.m-1]"""

inputs = {"Temperature [K]": T}
Domain = self.domain.capitalize()
return pybamm.FunctionParameter(
Expand Down
12 changes: 8 additions & 4 deletions pybamm/parameters/lithium_ion_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ def _set_parameters(self):
# Tortuosity parameters
self.b_s = self.geo.b_s

self.C_dl = pybamm.Parameter(
f"{Domain} electrode double-layer capacity [F.m-2]"
)

# Mechanical parameters
self.nu = pybamm.Parameter(f"{Domain} electrode Poisson's ratio")
self.E = pybamm.Parameter(f"{Domain} electrode Young's modulus [Pa]")
Expand Down Expand Up @@ -342,6 +338,14 @@ def _set_parameters(self):
f"{Domain} electrode current-driven interface utilisation factor [m3.mol-1]"
)

def C_dl(self, T):
"""Dimensional double-layer capacity [F.m-2]"""
inputs = {"Temperature [K]": T}
Domain = self.domain.capitalize()
return pybamm.FunctionParameter(
f"{Domain} electrode double-layer capacity [F.m-2]", inputs
)

def sigma(self, T):
"""Dimensional electrical conductivity in electrode"""
inputs = {"Temperature [K]": T}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_prettify_print_name(self):
)

# Test subscripts
self.assertEqual(param.n.C_dl.print_name, r"C_{\mathrm{dl,n}}")
self.assertEqual(param.n.C_dl(0).print_name, r"C_{\mathrm{dl,n}}")

# Test bar
c_e_av = pybamm.Variable("c_e_av")
Expand Down
Loading