Repository navigation
Temperature as a known or unknown expression/coefficient/field - #26
Merged
jorgensd merged 1 commit intoNov 12, 2026
Merged
Conversation
jorgensd
force-pushed
the
dokken/temperature-dependent-electrolyte-concentrations
branch
2 times, most recently
from
November 12, 2026 10:47
314e414 to
0cdd5fc
Compare
jorgensd
force-pushed
the
dokken/temperature-dependent-electrolyte-concentrations
branch
from
November 12, 2026 11:42
0cdd5fc to
bc911ec
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.
Temperature as a UFL expression
Electrolyte(temperature=...)now takes either:"<name>.T", as before, so it acts as a known coefficient;densityandviscosityalready worked this way.Electrolyte.Treturns a UFL expression instead of aParameter.Where the temperature enters:
F/(RT);nF/(RT);With a temperature field, all of these, and their Jacobians, depend on it.
ProtonExchangeMembrane(temperature=...)accepts an expression too and passes it to its electrolyte.Not yet temperature-dependent: the diffusivities and rate constants. An Arrhenius law would be the next step for full thermal coupling.
Tests
test_conduction_and_transport_at_the_temperature_of_a_heat_equation(test_electrochemistry_from_ufl.py) compares the model with plain UFL on five cell types, residuals and Jacobians.test_the_temperature_can_be_the_field_of_a_heat_equation(test_electrolyte.py) checks three things for a temperature field in kelvin:"e.T"is no longer a parameter;Other changes to the electrolyte
Electrolytedocstring is restructured. It first says what an electrolyte is: a dilute, electroneutral solution whose ions move independently, with their concentrations and the temperature as its state. It then gives what the class computes, before the parameters it creates.electroneutrality(electrolyte-current, which stateselectrolyte-currentmoves fromElectrolyteConductiontoElectrolyte, which computes it. Its label is unchanged.ElectrolyteConductionnow states only charge conservation,conductivity,diffusion_currentandcurrent_densityrefer to these displays instead of repeating the formulas in plain text.vanadium-electroneutrality, since it is the vanadium instance of the general law, and refers to the general one.