-
-
Notifications
You must be signed in to change notification settings - Fork 759
Porosity change with particle size distributions #5417
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
base: main
Are you sure you want to change the base?
Changes from 19 commits
425af11
6ba2cde
e893156
6c8cbfd
af64ddd
2d6d111
11c20cd
8d55d1b
5529bfd
58d9fd8
9526deb
f7799d9
9806aa5
6f6aa08
96c68b9
6ed2701
8ea44a3
a77bea3
86740f5
5d02e5e
293e654
8a739a4
41d2221
889ee8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,7 @@ def get_coupled_variables(self, variables): | |||||||||||||||||||||
| dom = domain.split()[0] | ||||||||||||||||||||||
| Domain = dom.capitalize() | ||||||||||||||||||||||
| SEI_option = getattr(self.options, dom)["SEI"] | ||||||||||||||||||||||
| plating_option = getattr(self.options, dom)["lithium plating"] | ||||||||||||||||||||||
| phases_option = getattr(self.options, dom)["particle phases"] | ||||||||||||||||||||||
| phases = self.options.phases[dom] | ||||||||||||||||||||||
| for phase in phases: | ||||||||||||||||||||||
|
|
@@ -42,40 +43,34 @@ def get_coupled_variables(self, variables): | |||||||||||||||||||||
| # `domain` has more than one phase | ||||||||||||||||||||||
| phase_name = phase + " " | ||||||||||||||||||||||
| pref = phase.capitalize() + ": " | ||||||||||||||||||||||
| a_k = variables[ | ||||||||||||||||||||||
| f"{Domain} electrode {phase_name}" | ||||||||||||||||||||||
| "surface area to volume ratio [m-1]" | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| if SEI_option == "none": | ||||||||||||||||||||||
| L_sei_0 = pybamm.Scalar(0) | ||||||||||||||||||||||
| V_bar_sei = pybamm.Scalar(0) | ||||||||||||||||||||||
| else: | ||||||||||||||||||||||
| V_bar_sei = pybamm.Parameter( | ||||||||||||||||||||||
| f"{pref}SEI partial molar volume [m3.mol-1]" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| if plating_option == "none": | ||||||||||||||||||||||
| V_bar_Li = pybamm.Scalar(0) | ||||||||||||||||||||||
| else: | ||||||||||||||||||||||
| L_sei_0 = pybamm.Parameter(f"{pref}Initial SEI thickness [m]") | ||||||||||||||||||||||
| L_sei_k = variables[f"{Domain} {phase_name}SEI thickness [m]"] | ||||||||||||||||||||||
| L_pl_k = variables[ | ||||||||||||||||||||||
| f"{Domain} {phase_name}lithium plating thickness [m]" | ||||||||||||||||||||||
| V_bar_Li = pybamm.Parameter( | ||||||||||||||||||||||
| "Lithium metal partial molar volume [m3.mol-1]" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| c_sei_k = variables[ | ||||||||||||||||||||||
| f"{Domain} {phase_name}SEI concentration [mol.m-3]" | ||||||||||||||||||||||
|
||||||||||||||||||||||
| V_bar_Li = pybamm.Parameter( | |
| "Lithium metal partial molar volume [m3.mol-1]" | |
| ) | |
| c_sei_k = variables[ | |
| f"{Domain} {phase_name}SEI concentration [mol.m-3]" | |
| V_bar_Li = self.param.V_bar_Li | |
| c_sei_k = variables[ | |
| f"{Domain} {phase_name}SEI concentration [mol.m-3]" | |
| f"{Domain} {phase_name}SEI concentration [mol.m-3]" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -339,13 +339,6 @@ def test_options(self): | |||||||||||||||||||||
| "plating porosity change" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| with pytest.raises(pybamm.OptionError, match=r"distributions"): | ||||||||||||||||||||||
| pybamm.BaseBatteryModel( | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "particle size": "distribution", | ||||||||||||||||||||||
| "lithium plating porosity change": "true", | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||
| # valid combination of particle size distribution and lithium plating porosity change | |
| pybamm.BaseBatteryModel( | |
| { | |
| "particle size": "distribution", | |
| "lithium plating": "reversible", | |
| "lithium plating porosity change": "true", | |
| } | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module header / class docstring still describes porosity change “as a multiple of SEI/plating thicknesses”, but the implementation now uses concentrations and partial molar volumes. Consider updating those docstrings/comments to match the new approach to avoid misleading documentation.