Skip to content

NMC/Gr bug fix & Switch to cycle_counts vector#763

Merged
dguittet merged 14 commits into
patchfrom
batt_nmc_life
Feb 18, 2022
Merged

NMC/Gr bug fix & Switch to cycle_counts vector#763
dguittet merged 14 commits into
patchfrom
batt_nmc_life

Conversation

@dguittet

@dguittet dguittet commented Feb 17, 2022

Copy link
Copy Markdown
Collaborator

There was a bug in the calculation of the b1 coefficient in #748 that is fixed here. There were also some adaptations to get the Ua and Voc calculations to be more aligned. Many results in tests have changed.

This PR also changes the NMC/Gr life model to use the cycle_counts structure in the cycle model, rather than maintain its own cycle_DOD_range vector. However, the usage is slightly different from the cycle-calendar model. The latter is tracking a frequency table of cycles at the DODs given by the input cycle matrix for the whole simulation duration. Whereas the NMC/Gr model will be tracking each cycle separately (essentially the count is always 1 and the DODs are ordered by when the cycle is completed) and for one day at a time.

Needing to easily append new rows to the cycle_count matrix led to my switching that structure from a matrix_t to a 2d vector, so I also added some helper functions for translating between the two.

@dguittet dguittet added this to the 2021.12.02 Patch 1 milestone Feb 17, 2022
@dguittet dguittet requested a review from brtietz February 17, 2022 22:43
Comment thread shared/lib_battery_lifetime_calendar_cycle.h Outdated

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mechanism for cycle counting makes more sense to me, and actually clarifies some of the NMC code.

The major required change before merging is to re-work lib_battery_lifetime_nmc_test, BTMSTest to not have local paths. More comments are nice as you have time - I think the one in the calendar cycle header file will save head scratching later.

Comment thread shared/lib_util.h
Comment thread test/shared_test/lib_battery_lifetime_nmc_test.cpp Outdated
@dguittet

Copy link
Copy Markdown
Collaborator Author

I'm happy to add other comments where you think they would be helpful, any suggestions? I removed the BTMS test that was based on a bunch of large local files, which I had committed by accident.

@dguittet dguittet requested a review from brtietz February 17, 2022 23:12
@brtietz

brtietz commented Feb 17, 2022

Copy link
Copy Markdown
Collaborator

I'm happy to add other comments where you think they would be helpful, any suggestions? I removed the BTMS test that was based on a bunch of large local files, which I had committed by accident.

The other one that came to mind was indicating what the DOD indices are in the NMC and LMO/LTO cpp files the first time they are used ex: DOD[0] // cycle count. I agree that this is more useful than what I wrote, but there are advantages to enums sometimes. ;)

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, conditional on the tests passing.

@dguittet

Copy link
Copy Markdown
Collaborator Author

Thanks, I've replaced all implicit indexes with the ENUMs in the shared library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants