Skip to content

test: check analytical SEI growth across simulation restarts - #6011

Open
lishi-01 wants to merge 2 commits into
pybamm-team:mainfrom
lishi-01:codex/sei-solvent-diffusion-pr
Open

lishi-01 wants to merge 2 commits into
pybamm-team:mainfrom
lishi-01:codex/sei-solvent-diffusion-pr

Conversation

@lishi-01

Copy link
Copy Markdown

Description

Refs #6006.

Analytical regression tests are added for solvent-diffusion-limited SEI growth. Film thickness and lithium loss are checked against the integrated growth law. An experiment step change and a new Simulation using starting_solution are covered.

Four cases are tested: SPM and DFN at 298.15 K and 318.15 K. OKane2022 parameters and fixed reaction area are used. A non-unit lithium-to-SEI molar ratio is applied. This makes missing conversion factors detectable.

Expected values are calculated from the input parameters and geometry. The evaluated SEI current and RHS are not used. Values are compared at fixed absolute times through the interpolating solution interface.

A one-line reset is also added to the existing default-citations test. Its order dependency was reproduced on the earlier main baseline, 8c6816d27. Only two existing tests were needed. The reset gives that test the initial citation state it expects. This change can be reviewed independently of the SEI cases.

The citation reset and the SEI regression tests are kept in separate commits.

Type of change

Tests only. No existing defect in the SEI growth equations is claimed.

Validation

Both test changes were replayed onto main commit 63476bc4951c1f91ec7b95f24fd3132dfe45550f. The tested branch head is ce141e7b3215c4d0ea7bad3b932a80c11841d1ed. Ubuntu on WSL2 and Python 3.12.3 were used.

The official solver wheel from main CI run 41065835434 was used. Its source commit matches this baseline. The installed native binary was checked against the wheel. The new shared CasADi and matrix-fill interfaces were present.

  • All 21 configured pre-commit hooks passed.
  • The full unit and integration session passed: 6100 passed, 47 skipped, and 41 subtests passed.
  • Doctests passed: 71 passed and 3 skipped.
  • The strict HTML documentation build passed with -W --keep-going, without warnings.
  • All six focused cases passed: four SEI cases and the two citation tests in the previously failing order.

The 47 unit and integration skips follow existing conditions:

Count Reason
28 The optional pydiffsol backend is not installed.
13 Existing model tests are marked as unimplemented or unsupported.
3 LaTeX rendering tools are not installed.
1 A local-only legacy serialisation fixture is absent. The tracked coarse fixture passed.
1 The test requires JAX to be absent, but JAX is installed.
1 The attribute check requires Python 3.13; this run uses 3.12.

Three doctest groups are explicitly marked with +SKIP. No cases were skipped by the network precheck in this run.

Earlier process-local mutation checks are described in #6006. An incorrect diffusion coefficient, a missing temperature factor and an incorrect stoichiometric factor were detected. Those checks predate this rebase. They assess mathematical implementation consistency under the stated assumptions.

Points for discussion

These cases use the default legacy experiment path. Feedback on unified-mode coverage and the test location is welcome, as discussed in #6006.

Reset the global citation state before checking defaults. This prevents earlier model construction from making the test depend on execution order.
Compare SEI thickness and lithium loss with the integrated growth law for SPM and DFN at two temperatures. Cover an experiment step change and continuation through starting_solution.

Refs pybamm-team#6006.
@lishi-01
lishi-01 marked this pull request as ready for review October 31, 2026 02:55
@lishi-01
lishi-01 requested a review from a team as a code owner October 31, 2026 02:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T02:56:43.998215Z
We couldn’t complete this review. Comment @codex review to try again.
ce141e7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant