Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1289 +/- ##
=======================================
Coverage 96.14% 96.15%
=======================================
Files 57 57
Lines 5165 5177 +12
=======================================
+ Hits 4966 4978 +12
Misses 199 199
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hhy2022
marked this pull request as ready for review
November 5, 2026 16:38
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.
Description
Summary
The symmetry term of weakly enforced Dirichlet BCs (Nitsche) is now written like the bulk diffusion term in cylindrical and spherical coordinates:
n·grad(v)n·grad(v)(unchanged)n·grad(v)r n·grad(v / r)n·grad(v)r**2 n·grad(v / r**2)This follows the diffusion term in
HydrogenTransportProblem.create_formulationandfestim.drift.drift_form.DirichletBCBase.weak_formulationtakes a newcoordinate_systemargument (default cartesian), passed by bothHydrogenTransportProblemandHydrogenTransportProblemDiscontinuous.Related Issues
Fixes #1278
-m c v·grad(w/m)instead of-c v·grad(w).Motivation and Context
In cylindrical coordinates, conservation comes from the test function
v = r, which is in the P1 space. The bulk termr grad(u)·grad(v/r)vanishes for it, but the symmetry termn·grad(v)does not (grad(r) = 1), so particles are not conserved when a weakly enforcedHenrysBC/SievertsBCis coupled to an enclosure.With the MWE posted in #1278 (largest relative change of the total number of H atoms):
Type of Change
Testing
pytest)Code Quality Checklist
ruff format .)ruff check .)Documentation
Additional Notes
Spherical is not exact, and cannot be with P1 elements. Conservation would need
v = r**2in the test space. The remaining drift is the same as withSurfaceReactionBC(no Nitsche) and is O(h^2):SurfaceReactionBCThe spherical symmetry term is changed for consistency with the bulk term.
With assistance from AI.