Skip to content

Commit a09f8f8

Browse files
Merge pull request #1686 from pybamm-team/issue-1685-lam
Issue 1685 lam
2 parents 3dd1255 + 917afa6 commit a09f8f8

File tree

7 files changed

+39
-32
lines changed

7 files changed

+39
-32
lines changed

examples/notebooks/models/submodel_loss_of_active_materials.ipynb

Lines changed: 15 additions & 17 deletions
Large diffs are not rendered by default.

pybamm/input/parameters/lithium_ion/negative_electrodes/graphite_Ai2020/parameters.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ Negative electrode cracking rate,[function]graphite_cracking_rate_Ai2020,,
4747
Negative electrode activation energy for cracking rate [J.mol-1],0,,
4848
,,,
4949
# Loss of active materials (LAM) model,,,
50-
Negative electrode LAM constant propotional term,0,,
50+
Negative electrode LAM constant proportional term [s-1],0,,
5151
Negative electrode LAM constant exponential term,2,,
5252
Negative electrode critical stress [Pa],60e6,,

pybamm/input/parameters/lithium_ion/positive_electrodes/lico2_Ai2020/parameters.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ Positive electrode cracking rate,[function]lico2_cracking_rate_Ai2020,,
4848
Positive electrode activation energy for cracking rate [J.mol-1],0,,
4949
,,,
5050
# Loss of active materials (LAM) model,,,
51-
Positive electrode LAM constant propotional term,1e-9,,
51+
Positive electrode LAM constant proportional term [s-1],2.78e-13,,
5252
Positive electrode LAM constant exponential term,2,,
5353
Positive electrode critical stress [Pa],375e6,,

pybamm/models/submodels/active_material/stress_driven_active_material.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ def get_coupled_variables(self, variables):
8888
# assuming the minimum hydrostatic stress is zero for full cycles
8989
stress_h_surf_min = stress_h_surf * 0
9090
j_stress_LAM = (
91-
-(beta_LAM / self.param.t0_cr)
92-
* ((stress_h_surf - stress_h_surf_min) / stress_critical) ** m_LAM
91+
-beta_LAM * ((stress_h_surf - stress_h_surf_min) / stress_critical) ** m_LAM
9392
)
9493

9594
deps_solid_dt = j_stress_LAM

pybamm/parameters/lithium_ion_parameters.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,17 @@ def _set_dimensional_parameters(self):
334334
self.m_LAM_n = pybamm.Parameter(
335335
"Negative electrode LAM constant exponential term"
336336
)
337-
self.beta_LAM_n = pybamm.Parameter(
338-
"Negative electrode LAM constant propotional term"
337+
self.beta_LAM_n_dimensional = pybamm.Parameter(
338+
"Negative electrode LAM constant proportional term [s-1]"
339339
)
340340
self.stress_critical_n_dim = pybamm.Parameter(
341341
"Negative electrode critical stress [Pa]"
342342
)
343343
self.m_LAM_p = pybamm.Parameter(
344344
"Positive electrode LAM constant exponential term"
345345
)
346-
self.beta_LAM_p = pybamm.Parameter(
347-
"Positive electrode LAM constant propotional term"
346+
self.beta_LAM_p_dimensional = pybamm.Parameter(
347+
"Positive electrode LAM constant proportional term [s-1]"
348348
)
349349
self.stress_critical_p_dim = pybamm.Parameter(
350350
"Positive electrode critical stress [Pa]"
@@ -859,6 +859,8 @@ def _set_dimensionless_parameters(self):
859859
self.c_p_0 = self.c_p_0_dim / self.c_p_max
860860
self.c_n_0 = self.c_n_0_dim / self.c_n_max
861861
self.t0_cr = 3600 / self.C_rate / self.timescale
862+
self.beta_LAM_n = self.beta_LAM_n_dimensional * self.timescale
863+
self.beta_LAM_p = self.beta_LAM_p_dimensional * self.timescale
862864
# normalised typical time for one cycle
863865
self.stress_critical_n = self.stress_critical_n_dim / self.E_n
864866
self.stress_critical_p = self.stress_critical_p_dim / self.E_p

pybamm/parameters/parameter_values.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,26 +373,30 @@ def check_parameter_values(self, values):
373373
"Parameters involving 'surface area density' have been renamed to "
374374
"'surface area to volume ratio' ('{}' found)".format(param)
375375
)
376-
if "reaction rate" in param:
376+
elif "reaction rate" in param:
377377
raise ValueError(
378378
"Parameters involving 'reaction rate' have been replaced with "
379379
"'exchange-current density' ('{}' found)".format(param)
380380
)
381-
for param in values:
382-
if "particle distribution in x" in param:
381+
elif "particle distribution in x" in param:
383382
raise ValueError(
384383
"The parameter '{}' has been deprecated".format(param)
385384
+ "The particle radius is now set as a function of x directly "
386385
"instead of providing a reference value and a distribution."
387386
)
388-
for param in values:
389-
if "surface area to volume ratio distribution in x" in param:
387+
elif "surface area to volume ratio distribution in x" in param:
390388
raise ValueError(
391389
"The parameter '{}' has been deprecated".format(param)
392390
+ "The surface area to volume ratio is now set as a function "
393391
"of x directly instead of providing a reference value and a "
394392
"distribution."
395393
)
394+
elif "propotional term" in param:
395+
raise ValueError(
396+
f"The parameter '{param}' has been renamed to "
397+
"'... proportional term [s-1]', and its value should now be divided"
398+
"by 3600 to get the same results as before."
399+
)
396400

397401
def process_model(self, unprocessed_model, inplace=True):
398402
"""Assign parameter values to a model.

tests/unit/test_parameters/test_parameter_values.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def test_check_parameter_values(self):
137137
pybamm.ParameterValues(
138138
{"Negative electrode surface area to volume ratio distribution in x": 1}
139139
)
140+
with self.assertRaisesRegex(ValueError, "propotional term"):
141+
pybamm.ParameterValues(
142+
{"Negative electrode LAM constant propotional term": 1}
143+
)
140144

141145
def test_process_symbol(self):
142146
parameter_values = pybamm.ParameterValues({"a": 4, "b": 2, "c": 3})
@@ -585,7 +589,7 @@ def test_process_integral_broadcast(self):
585589
auxiliary_domains={
586590
"secondary": "test sec",
587591
"tertiary": "test tert",
588-
"quaternary": "test quat"
592+
"quaternary": "test quat",
589593
},
590594
)
591595
func = pybamm.x_average(pybamm.FunctionParameter("func", {"var": var}))
@@ -598,7 +602,7 @@ def test_process_integral_broadcast(self):
598602
pybamm.FullBroadcast(
599603
pybamm.Scalar(2, name="func"),
600604
"test sec",
601-
{"secondary": "test tert", "tertiary": "test quat"}
605+
{"secondary": "test tert", "tertiary": "test quat"},
602606
).id,
603607
)
604608

0 commit comments

Comments
 (0)