Repository navigation
Include contact resistance heating in lumped total heating - #5890
chenyi6758-source wants to merge 5 commits into
Conversation
|
Thanks for picking this up. A few things before this can close #5879:
This is the same kind of bug as #5820 (an electrical loss that never reaches the heat source), which #5841 and #5875 address for the SEI film and side reactions. |
|
One more on the implementation: please compute the new totals before the dict and drop the comments, e.g. Q_W = variables["Total heating [W]"] + Q_cr_W
Q_vol_av = variables["Volume-averaged total heating [W.m-3]"] + Q_cr_vol_avthen put |
Added contact resistance heating calculation to total heating.
rtimms
left a comment
There was a problem hiding this comment.
Thanks for the update — moving the heat into BaseThermal is the right direction, and x-full and the pouch models now heat up. A few things are still open from my earlier comments, plus two new issues from the last commit. I checked with an energy balance: temperature held at ambient, R_c 0 → 0.05 Ω, extra "Total heating [W]" over ∫I²R_c dt. The ratio is 1.818 for lumped and 0.818 for x-full and x-lumped 1+1D/2+1D.
- Lumped now double counts. The
lumped.pyadditions are still there on top of theBaseThermalterm, so both the totals and the temperature equation get the contact heat twice. Please revertlumped.pytomain, except removeQ_cr_vol_avfromset_rhs, since it's now insideQ_vol_av. Keep the"Lumped contact resistance heating"variables. - Volume normalisation. The heat is spread over the electrode stack but divided by
V_cell, so onlyL_x·L_y·L_z·n / V_cellof I²R ends up in the model. Divide by the stack volume and broadcast overQ.domain, so half-cells work too:and move theV_stack = self.param.n_electrodes_parallel * self.param.L_y * self.param.L_z * self.param.L_x Q_cr = I**2 * self.param.R_contact(T_vol_av) / V_stack Q = Q + pybamm.FullBroadcast(Q_cr, Q.domain, "current collector")
# Compute the X-average…comment back above the averaging code. - Tests (still needed).
test_temperature_dependent_contact_resistance[x-full]now fails: it compares.entriesfrom two solves with different step counts. Usesol["Contact overpotential [V]"](t)instead. Please also add an energy-balance test liketest_sei_film_heatingin #5841, over lumped, x-full and x-lumped 1+1D/2+1D, asserting that the extra heat equals ∫I²R_c dt. With 1 and 2 applied, I get 1.000 for all of them. - CHANGELOG / description. This now covers every thermal option, so "Closes #5879" is fine. Please update the bullet and drop the "bit-identical" note.
|
Thanks @chenyi6758, this is what I was after. With the heat added in
|
Closes #5879.
The temperature equation in
Lumped.set_rhsincludes the contact resistance heat, but "Total heating [W]" (and the volume-averaged total) did not, so the reported total was missing the I^2R term.This folds the contact resistance heat into the two total-heating variables and drops the now-duplicated term from
set_rhs. The temperature trajectory is unchanged (verified bit-identical before/after with R_c = 0.05); with "contact resistance" off the added terms are zero.