Skip to content
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

[Bug]: Unable to obtain the right results of "{Domain} electrode thickness change [m]". #3323

Closed
bobonice opened this issue Sep 12, 2023 · 3 comments · Fixed by #3329
Closed
Labels
bug Something isn't working

Comments

@bobonice
Copy link
Contributor

PyBaMM Version

v23.5

Python Version

3.11

Describe the bug

Unable to obtain the right results of "{Domain} electrode thickness change [m]".

For example, in the tutorial "Validating_mechanical_models_Enertech_DFN.ipynb” , the simulation and experimental results of 'thickness change [m]' in Figure 1 do not match at all.

image

It could be caused by the absence of dimension for the variable "electrode_thickness_change" in the class BaseMechanics (base_mechanics.py). In reference to the previous version, the bug could be fixed using the following code:

  • change the code on line 58 to:
    L0 = domain_param.L
    electrode_thickness_change = self.param.n_electrodes_parallel * v_change * L0
    or
  • change the lines 96-97 to:
    neg_thickness_change = variables["Negative electrode thickness change [m]"] * self.param.n.L
    pos_thickness_change = variables["Positive electrode thickness change [m]"] * self.param.p.L

After applying the above change, the new Figure 1 in the tutorial "Validating_mechanical_models_Enertech_DFN.ipynb” would be like this:
image

Steps to Reproduce

Perform the simulations which include the absolute thickness changes or run the code directly in the tutorial "Validating_mechanical_models_Enertech_DFN.ipynb”.

Relevant log output

No response

@bobonice bobonice added the bug Something isn't working label Sep 12, 2023
@rtimms
Copy link
Contributor

rtimms commented Sep 12, 2023

Good catch, thanks. I prefer the first solution. Could you open a PR with the fix?

bobonice pushed a commit to bobonice/PyBaMM that referenced this issue Sep 13, 2023
bobonice pushed a commit to bobonice/PyBaMM that referenced this issue Sep 13, 2023
@bobonice
Copy link
Contributor Author

Thank you for your prompt response and feedback. I have opened the PR#3329.

@brosaplanella brosaplanella linked a pull request Sep 15, 2023 that will close this issue
8 tasks
@brosaplanella
Copy link
Sponsor Member

This was fixed in #3329, so closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants