Repository navigation
Electrode reactions as rate reactions, and a reusable half-cell - #18
Merged
Merged
Conversation
jorgensd
force-pushed
the
dokken/refactor-half-cell
branch
from
November 11, 2026 23:26
dc489fe to
88e1cf4
Compare
Adds additional features, e.g. fiber distance,. Moves the definition of hte redox reaction out of the core part of the library.
jorgensd
force-pushed
the
dokken/refactor-half-cell
branch
from
November 12, 2026 05:32
88e1cf4 to
1a2cbaa
Compare
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.
Reworks the kinetics of #17 , and restructures
RedoxHalfCellso that a full cell can build both of its sides from it.Electrode reactions are rate reactions
ElectrodeReactionis now aRateReaction. Its rate is the volumetric current over n F, and it adds the current exchange between the solid and electrolyte potentials. Every reaction in sumfem now states its species the same way, withreactantsandproductsand their coefficients.ButlerVolmer,MassTransferButlerVolmerandPistonVelocityButlerVolmertakereactantsandproductsby ion name. They default to the reduced and oxidized ions alone; e.g. VO²⁺ + H₂O → VO₂⁺ + 2H⁺ + e⁻ isreactants={"VO": 1, "H2O": 1},products={"VO2": 1, "H": 2}. Ions of the reaction other than the couple need fields.stoichiometryandothersarguments of the previous commit.ExchangeCurrentButlerVolmerkeeps its signature.RateReaction:ExchangeCurrentButlerVolmer, which only moves charge.RedoxCouplereactants/products.check(ions)rejects ions missing from the electrolyte and reactions that do not conserve charge.sumfem.electrochemistry, and documented on the API page.RedoxHalfCellRedoxHalfCell(domain, ions, reservoir, couple, electrode, ...). The couple replaces seven arguments._check_reservoir_create_fields_create_electrolyte_create_parameters_create_reaction_create_models_create_functionalsfiber_distance: kinetics limited by piston velocities, with or without flow.collector=Noneandmembrane=None: for a cell whose collector and membrane are resolved. It then puts no currents on those boundaries, andvoltageandbalance_currentsraise.phi_s,phi_landfields: existing fields to use, e.g. an electrolyte potential and water shared with a membrane.electrolyte_name: prefix of the electrolyte's parameters, so that two half-cells can coexist.<name>_, e.g.cell_reaction, so that two half-cells in one system do not collide.Demos
The 1D, 2D and 3D vanadium half-cells state their couple as a
RedoxCouple, and the 1D demo explains it.Tests
reactants/products.reference.COUPLE.