Chapter 4: Full SPM Implementation & Voltage Coupling
Connecting OCV, Diffusion, and BV into a complete SPM engine — understanding step() dataflow, voltage coupling, discharge curves, and C-rate analysis.
Learning Materials
Four-Session Structure
| Session |
Topic |
Core Activity |
Output |
| 4.1 |
step() Four-Step Dataflow |
Hand-derive current→flux→overpotential→diffusion→voltage |
step_dataflow.png |
| 4.2 |
Voltage Coupling & Code Practice |
Expand voltage formula → write spm_my.py from skeleton → validate |
spm_my.py (0 nV diff) |
| 4.3 |
Discharge Curves & C-rate |
Voltage breakdown chart + C-rate comparison chart |
spm_discharge.png |
| 4.4 |
Fully-Implicit Coupling |
Derive why diffusion is independent of η → intra-step iteration unnecessary |
Key insight |
Key Concepts Covered
- step() Four-Step Dataflow: $i_{app} \rightarrow j \rightarrow \eta \rightarrow c(r) \rightarrow V_{cell}$
- Voltage Coupling: $V_{cell} = U_p + \eta_p - U_n - \eta_n = (U_p-U_n) - (|\eta_p|+|\eta_n|)$
- Sign Convention: $j_n = -i_{app}/(a_{s,n} L_n F)$, $j_p = +i_{app}/(a_{s,p} L_p F)$
- Cross-Step Coupling: Diffusion does not depend on η within a step; coupling occurs across time steps
- C-rate Effect: arcsinh is sub-linear; higher C-rate → larger overpotential share of voltage drop
- Initial Concentration: At t=0, concentration is uniform throughout the particle (diffusion steady state)
Visualization Gallery
All SPM Equations Assembled
| Equation |
Formula |
Source |
| OCV |
$U(\theta) = f(\mathrm{SOC})$ |
Ch1 |
| Diffusion |
$\partial c / \partial t = D \cdot \nabla^2 c$ |
Ch2 |
| Butler-Volmer |
$j = j_0 \cdot [e^{\alpha F\eta/RT} - e^{-(1-\alpha)F\eta/RT}]$ |
Ch3 |
| Voltage Coupling |
$V_{cell} = U_p + \eta_p - U_n - \eta_n$ |
Ch4 |
Python Components Built
| Component |
Purpose |
Status |
SPMModelMy.__init__() |
Initialize grid, concentrations, diffusion matrices |
✅ Self-written |
step() |
Advance dt seconds through four steps |
✅ Self-written |
simulate() |
Time loop + result recording |
✅ Self-written |
build_diffusion_matrix() |
Diffusion matrix construction (Ch2 component) |
✅ |
solve_one_step() |
One-step diffusion (Ch2 component) |
✅ |
bv_overpotential() |
BV inversion (Ch3 component) |
✅ |
Next Chapter
→ Chapter 5: SPMe Model
Back to Roadmap
← Electrochemistry Study Home