-
-
Notifications
You must be signed in to change notification settings - Fork 572
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 SEI layers choice #3920
Allow SEI layers choice #3920
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3920 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 257 257
Lines 21245 21277 +32
========================================
+ Hits 21157 21189 +32
Misses 88 88 ☔ View full report in Codecov by Sentry. |
b539f61
to
6b593d0
Compare
@lorenzofavaro This was being worked on by another person. Did you ask @GBlanka if they were still working on it? In general you don't want to take over the work of another developer unless they were not interested in continuing |
You're right, I forgot to specify this in the PR description but I asked her about it on another platform (on Github she's no longer active) and she confirmed that she was no longer interested in working on the PR #3457. Edit: She just closed her pull request. |
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.
Looks good to me except a few comments. I'm wondering whether it would be cleaner to have entirely separate classes for double-layer or single-layer SEIs. There are a lot of if statements now in sei_growth.py
L_sei = L_outer | ||
variables = {f"{Domain} outer {self.reaction_name}thickness [m]": L_outer} | ||
|
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.
I wouldn't add outer thickness in the single-layer case, only total thickness
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.
or just call it "SEI thickness" (not outer or total)
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.
Right, we could rename it to just SEI thickness
.
This renaming also apply to the other parameters in the single-layer case, right?
Ex:
f"X-averaged {domain} electrode outer {self.reaction_name}interfacial current density [A.m-2]"
would become:
f"X-averaged {domain} electrode {self.reaction_name}interfacial current density [A.m-2]"
j_sei = 0 | ||
if self.double_layer_sei: | ||
eta_inner = delta_phi - phase_param.U_inner | ||
j_sei = ( | ||
(eta_inner < 0) * phase_param.kappa_inner * eta_inner / L_sei_inner | ||
) |
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.
electron-migration limited should still work with the single sei layer, we would just assume that the single layer is the inner layer
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.
we would just assume that the single layer is the inner layer
In the single-layer case we usually assume that the layer to be used is the outer layer right? Should we make an exception for this case and continue with the previous assumption in the remaining code?
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.
If we just make it a separate file it will be easier as there won't be a need for an exception
@tinosulzer Could we think of adding two classes After that, update the function Edit: updated UML |
NoSEI and ConstantSEI should only have the single-SEI case (as it's pointless to model a double-layer SEI if it's not there or constant). TotalSEI is an aggregator anyway so that should deal with both single and double cases. That only leaves SEIGrowth and DoubleLayerSEIGrowth. In fact we may want to put the "double" option inside the SEI option e.g. "solvent-diffusion limited" and "solvent-diffusion limited (double-layer)" Btw, thanks for your work on this and sorry for changing the specs along the way, it just became clearer when thinking about it more |
The other (simpler) option is to just get rid of double layer SEI, which is just confusing and hard to parameterize. Thoughts @rtimms @brosaplanella @DrSOKane ? |
I would happily remove the double layer stuff. If people really really want it they can implement as a custom submodel or basic model. |
I agree with Rob. In fact, I believe that most of the 2 layer models can be hacked into a single layer model just by adjusting the parameters. Related to this, I am not sure if it would be better to split the various models into classes rather than have a single class with several if statements. |
There's pros and cons to separating into different classes. I think a good middle ground is to have different submodel classes when the variables in |
@lorenzofavaro the conclusion is let's just go ahead and get rid of the double SEI entirely. It should make the changes much cleaner |
Hi @lorenzofavaro! Any updates on this? |
Hi @lorenzofavaro! Any updates on this? Otherwise we can take this over as we need this feature for some work we are doing with @kawaMANMI. |
Description
Currently, the default for SEI is one inner and one outer layer.
Continuing the work of #3457, this change is to include an option to have a single layer SEI model, rather than just the 2-layer version.
Closes #2333
Type of change
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)