Repository navigation
Conversation
sumfem.electrochemistry
jorgensd
force-pushed
the
dokken/full-cell-v2
branch
from
November 12, 2026 12:45
ee16501 to
5e1a5be
Compare
Move units declarations to si units.
…ur problem describes), materials (electrolyte, electrode and what couples them) and models (the various UFL forms)
jorgensd
force-pushed
the
dokken/full-cell-v2
branch
from
November 12, 2026 13:18
5e1a5be to
96c06df
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the first full cell. The cell now runs with flow through the electrodes and tanks, through a pluggable flow component. A new demo runs the full 2D cell of Shah et al. (2008), corrected.
sumfem.electrochemistryis reorganised into three layers, and every material property can be coupled to another model.Flow and tanks
FlowSpecadds the flow of the electrolytes to aFullCell: the inlet velocity, the outlet pressure, and a tank ratio, the tank volume over the electrode's pore volume.full-cell-flow.FullCell.update_tanks(disc, dt)takes a step of Shah's eq. 33 after each time step, using the fluxes of that step (full-cell-tank).FullCellmethods:amount(an ion's amount in an electrode and its tank) andstate_of_charge(tank included).Pluggable flow through the electrodes (
models/electrode_flow.py)ElectrodeFlowis an abstract component, created by the cell from aFlowSetup. It provides:velocity(side);models, which may include time derivatives;pressureon the electrodes and the membrane, which the membrane'sSchloeglFlowshares;conditions()andinitialize().DarcyFlowis the default, with the Kozeny–Carman permeability of each electrode.FlowSpec.modeltakes anyElectrodeFlow, so Brinkman–Forchheimer, transient Stokes or transient Darcy flow can plug in. The docstring shows a transient Darcy flow as a subclass of a few lines.Shah et al.'s cell in 2D (
examples/electrochemistry/vanadium_full_cell_2d.py)sumfem.electrochemistryin three layersmaterials/:Electrolyte,Ion,RedoxCouple,PorousElectrode,Region.models/: transport, conduction, kinetics, membranes, and the electrode flow.cells/:RedoxHalfCell,FullCell, and the specs (HalfCellSpec,MembraneSpec,FlowSpec).Each layer imports only from those before it. Every name is still imported from
sumfem.electrochemistry, and the API page follows the layers.Inputs can come from other models
PorousElectrode, every field ofHalfCellSpecfrom the porosity on, the couple's rate constant, formal potential and transfer coefficients, and the electrolyte's temperature, density and viscosity. Each is either a UFL expression, such as a field of another PDE, used as given, or the default of a parameter.sumfem.symbolic.expression_or_parameter.RedoxHalfCell.equilibrium_potentialandinitializeaverage expressions over the electrode.Core additions and moves
sumfem.symbolic:expression_or_parameter, with the type aliasesExpressionOrValueandExpressionOrDefault.sumfem.symbolic.si: the unitsCONCENTRATION,DENSITY,DIFFUSIVITY,PERMEABILITYandVISCOSITY. They replace copies inmodels/flow.pyand the electrochemistry modules.Domain.interfaces_of(measure): used byRateReactionandMembraneProtonFlux, which checks that the membrane is on the "−" side of its face.RedoxHalfCell: gainsreservoir_concentrationandequilibrium_potential.Tests
expression_or_parameterandDomain.interfaces_of.Not in this PR
InterfaceLagrangeMultiplier, which is also where the Donnan jump enters.🤖 Generated with Claude Code