Skip to content

Commit

Permalink
Merge branch 'Single-layer-SEI-pybamm-team#2333' of https://github.co…
Browse files Browse the repository at this point in the history
  • Loading branch information
GBlanka committed Oct 20, 2023
2 parents 93d01f6 + 91ae167 commit 346cb15
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pybamm/models/submodels/interface/sei/base_sei.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def __init__(self, param, domain, options, phase="primary", cracks=False):
num_sei_layers = self.options.get("number of SEI layers")

# Flag to indicate single layer SEI
self.single_layer_sei = num_sei_layers == "1"
if num_sei_layers == "1":
self.single_layer_sei = True
else:
self.single_layer_sei = False

def get_coupled_variables(self, variables):
# Update some common variables
Expand Down Expand Up @@ -94,8 +97,6 @@ def _get_standard_thickness_variables(self, L_inner, L_outer):
}
)
# Get variables related to the total thickness
# In case of single layer SEI
# Inner layer is usually set to zero
L_sei = L_outer
if not self.single_layer_sei:
L_sei = L_inner + L_outer
Expand Down Expand Up @@ -179,6 +180,7 @@ def _get_standard_concentration_variables(self, variables):
# Case for single layer SEI:
if self.single_layer_sei:
L_sei = variables[f"{Domain} outer {reaction_name}thickness [m]"]

n_SEI = L_sei * L_to_n_outer # single layer SEI concentration

# Case for two layer SEI
Expand All @@ -194,7 +196,6 @@ def _get_standard_concentration_variables(self, variables):

n_SEI = n_inner + n_outer # SEI concentration

# Same calculation for both cases
n_SEI_xav = pybamm.x_average(n_SEI)
n_SEI_av = pybamm.yz_average(n_SEI_xav)

Expand Down Expand Up @@ -268,7 +269,6 @@ def _get_standard_concentration_variables(self, variables):

n_SEI_cr = n_inner_cr + n_outer_cr # SEI on cracks concentration

# Same calculation for both cases
n_SEI_cr_xav = pybamm.x_average(n_SEI_cr)
n_SEI_cr_av = pybamm.yz_average(n_SEI_cr_xav)

Expand Down Expand Up @@ -343,7 +343,6 @@ def _get_standard_reaction_variables(self, j_inner, j_outer):
The variables which can be derived from the SEI currents.
"""
domain, Domain = self.domain_Domain
# Case for a single layer
if self.single_layer_sei:
j_sei = j_outer
j_sei_xav = pybamm.x_average(j_sei)
Expand Down

0 comments on commit 346cb15

Please sign in to comment.