The definition of the SPMe remains a sticking point in PyBaMM. Even though the cited article for its definition is the Marquis et al (2019) paper, the actual implementation is a bit different (more accurate) as some terms have been "unlinearised"*. As part of improving the Creating Models notebooks (#3844) I wanted to write a BasicSPMe file and document the SPMe definition better. However, I have also noticed that the current approach falls somewhat in the middle: some terms are unlinearised and some are not. The marginal cost of doing the SPMe fully "unlinearised". All this discussion pertains to composite_conductivity.py
*by "unlinearised" I mean that some terms in the asymptotic expansion get later grouped again in their nonlinear form.
\phi_\mathrm{e,const} = - \overline{\Delta \phi}_\mathrm{n} + \overline{\phi}_\mathrm{n} - \frac{R T}{F} \frac{1}{L_\mathrm{n}} \int_0^{L_\mathrm{n}} \int_0^x \chi(c_\mathrm{e,n}) \frac{\partial \log c_\mathrm{e,n}}{\partial s} \mathrm{d} s \mathrm{d} x + \frac{1}{L_\mathrm{n}} \int_0^{L_\mathrm{n}} \int_0^x \frac{i_\mathrm{e,n}}{\kappa_\mathrm{e,eff}(c_\mathrm{e,n})} \mathrm{d} s \mathrm{d} x
\phi_\mathrm{e,n} = \phi_\mathrm{e,const} + \frac{R T}{F} \int_0^x \chi(c_\mathrm{e,n}) \frac{\partial \log c_\mathrm{e,n}}{\partial s} \mathrm{d} s - \int_0^x \frac{i_\mathrm{e,n}}{\kappa_\mathrm{e,eff}(c_\mathrm{e,n})} \mathrm{d} s
\phi_\mathrm{e,s} = \phi_\mathrm{e,n} ( x = L_\mathrm{n}) + \frac{R T}{F} \int_{L_\mathrm{n}}^x \chi(c_\mathrm{e,s}) \frac{\partial \log c_\mathrm{e,s}}{\partial s} \mathrm{d} s - \int_{L_\mathrm{n}}^x \frac{i_\mathrm{e,s}}{\kappa_\mathrm{e,eff}(c_\mathrm{e,s})} \mathrm{d} s
\phi_\mathrm{e,p} = \phi_\mathrm{e,s} ( x = L_x - L_\mathrm{p}) + \frac{R T}{F} \int_{L_x - L_\mathrm{p}}^x \chi(c_\mathrm{e,p}) \frac{\partial \log c_\mathrm{e,p}}{\partial s} \mathrm{d} s - \int_{L_x - L_\mathrm{p}}^x \frac{i_\mathrm{e,p}}{\kappa_\mathrm{e,eff}(c_\mathrm{e,p})} \mathrm{d} s
I suggest moving to this version, which I believe is the most general one (I have dropped T dependence from parameters for simplicity, but will be accounted for). The version is taken from Brosa Planella & Widanage (2022), but the derivation is not explained with a lot of detail as the focus was the side reaction. My older paper Brosa Planella et al (2021) has a lot more detail but still assumes $\chi$ to be constant. This would make the integrated conductivity model redundant so we can get rid of it.
The definition of the SPMe remains a sticking point in PyBaMM. Even though the cited article for its definition is the Marquis et al (2019) paper, the actual implementation is a bit different (more accurate) as some terms have been "unlinearised"*. As part of improving the Creating Models notebooks (#3844) I wanted to write a BasicSPMe file and document the SPMe definition better. However, I have also noticed that the current approach falls somewhat in the middle: some terms are unlinearised and some are not. The marginal cost of doing the SPMe fully "unlinearised". All this discussion pertains to
composite_conductivity.py
*by "unlinearised" I mean that some terms in the asymptotic expansion get later grouped again in their nonlinear form.
Current implementation
Proposed implementation
I suggest moving to this version, which I believe is the most general one (I have dropped T dependence from parameters for simplicity, but will be accounted for). The version is taken from Brosa Planella & Widanage (2022), but the derivation is not explained with a lot of detail as the focus was the side reaction. My older paper Brosa Planella et al (2021) has a lot more detail but still assumes $\chi$ to be constant. This would make the integrated conductivity model redundant so we can get rid of it.