forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
li metal model runs with EC SEI but solver fails
- Loading branch information
1 parent
54c2288
commit 2af6a5c
Showing
19 changed files
with
319 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# | ||
# Subodels for a lithium metal electrode | ||
# | ||
import pybamm | ||
from .base_ohm import BaseModel | ||
|
||
|
||
class LithiumMetalSurfaceForm(BaseModel): | ||
"""Explicit model for potential drop across a lithium metal electrode. | ||
Parameters | ||
---------- | ||
param : parameter class | ||
The parameters to use for this submodel | ||
options : dict, optional | ||
A dictionary of options to be passed to the model. | ||
**Extends:** :class:`pybamm.electrode.ohm.BaseModel` | ||
""" | ||
|
||
def __init__(self, param, options=None): | ||
super().__init__(param, "Negative", options=options) | ||
|
||
def get_fundamental_variables(self): | ||
ocp_ref = self.param.U_n_ref | ||
pot_scale = self.param.potential_scale | ||
|
||
delta_phi = pybamm.Variable( | ||
"Lithium metal interface surface potential difference", | ||
domain="current collector", | ||
) | ||
variables = { | ||
"Lithium metal interface surface potential difference": delta_phi, | ||
"Lithium metal interface surface potential difference [V]": ocp_ref | ||
+ delta_phi * pot_scale, | ||
} | ||
|
||
return variables | ||
|
||
def get_coupled_variables(self, variables): | ||
param = self.param | ||
|
||
i_boundary_cc = variables["Current collector current density"] | ||
T_n = variables["Negative current collector temperature"] | ||
l_n = param.l_n | ||
delta_phi_s = i_boundary_cc * l_n / param.sigma_n(T_n) | ||
delta_phi_s_dim = param.potential_scale * delta_phi_s | ||
|
||
phi_s_cn = variables["Negative current collector potential"] | ||
delta_phi = variables["Lithium metal interface surface potential difference"] | ||
|
||
# Potentials at the anode/separator interface | ||
phi_s = phi_s_cn - delta_phi_s | ||
phi_e = phi_s - delta_phi | ||
|
||
variables.update( | ||
{ | ||
"Negative electrode potential drop": delta_phi_s, | ||
"Negative electrode potential drop [V]": delta_phi_s_dim, | ||
"X-averaged negative electrode ohmic losses": delta_phi_s / 2, | ||
"X-averaged negative electrode ohmic losses [V]": delta_phi_s_dim / 2, | ||
"Lithium metal interface electrode potential": phi_s, | ||
"Lithium metal interface electrolyte potential": phi_e, | ||
} | ||
) | ||
return variables | ||
|
||
def set_initial_conditions(self, variables): | ||
delta_phi = variables["Lithium metal interface surface potential difference"] | ||
delta_phi_init = self.param.U_n_init | ||
|
||
self.initial_conditions = {delta_phi: delta_phi_init} | ||
|
||
def set_algebraic(self, variables): | ||
sum_j = variables[ | ||
"Sum of x-averaged " | ||
+ self.domain.lower() | ||
+ " electrode interfacial current densities" | ||
] | ||
|
||
sum_j_av = variables[ | ||
"X-averaged " | ||
+ self.domain.lower() | ||
+ " electrode total interfacial current density" | ||
] | ||
delta_phi = variables["Lithium metal interface surface potential difference"] | ||
|
||
self.algebraic[delta_phi] = sum_j_av - sum_j | ||
|
||
|
||
class LithiumMetalExplicit(BaseModel): | ||
"""Explicit model for potential drop across a lithium metal electrode. | ||
Parameters | ||
---------- | ||
param : parameteslackr class | ||
The parameters to use for this submodel | ||
options : dict, optional | ||
A dictionary of options to be passed to the model. | ||
**Extends:** :class:`pybamm.electrode.ohm.BaseModel` | ||
""" | ||
|
||
def __init__(self, param, options=None): | ||
super().__init__(param, "Negative", options=options) | ||
|
||
def get_coupled_variables(self, variables): | ||
param = self.param | ||
|
||
i_boundary_cc = variables["Current collector current density"] | ||
T_n = variables["Negative current collector temperature"] | ||
l_n = param.l_n | ||
delta_phi_s = i_boundary_cc * l_n / param.sigma_n(T_n) | ||
delta_phi_s_dim = param.potential_scale * delta_phi_s | ||
|
||
phi_s_cn = variables["Negative current collector potential"] | ||
delta_phi = variables["Lithium metal interface surface potential difference"] | ||
|
||
phi_s = phi_s_cn - delta_phi_s | ||
phi_e = phi_s - delta_phi | ||
|
||
variables.update( | ||
{ | ||
"Negative electrode potential drop": delta_phi_s, | ||
"Negative electrode potential drop [V]": delta_phi_s_dim, | ||
"X-averaged negative electrode ohmic losses": delta_phi_s / 2, | ||
"X-averaged negative electrode ohmic losses [V]": delta_phi_s_dim / 2, | ||
"Lithium metal interface electrode potential": phi_s, | ||
"Lithium metal interface electrolyte potential": phi_e, | ||
} | ||
) | ||
|
||
return variables | ||
|
||
def set_boundary_conditions(self, variables): | ||
pass |
44 changes: 0 additions & 44 deletions
44
pybamm/models/submodels/electrode/ohm/li_metal_explicit.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.