Add tutorials for FESTIM 2.2-rc.2 features - #182
Merged
Conversation
Covers the four user-facing features of the 2.2-rc.2 release and moves the whole book onto the new API. New Fundamentals chapter "Drift terms" (content/drift/): - soret.md, electromigration.md: closed-slab redistribution validated against the analytical steady states, exp(Q*/kT) and the Boltzmann distribution - advection.md: the divergence form and OutflowBC, shown by running a channel with and without an outlet condition, plus a check that SurfaceFlux reports the total (drift-inclusive) flux New Fundamentals chapter "Manifold subdomains" (content/manifolds/): - manifold_basics.md: declaring a codim-1 subdomain, the bulk exchange pair and its units, codim-2 boundary conditions, trapping, derived quantities - pipe_wall.md: a coolant channel as a manifold, with advection along it and an OutflowBC at the outlet; pickup rate checked against the wall permeation New page species_reactions/generic_reactions.md: the ReactionBase / GenericReaction / ArrheniusReaction / DecayReaction hierarchy, rate coefficients as callables of T or of another species, and tritium decay checked against exp(-lambda t). post_process/exports.md rewritten around SpeciesExport/TemperatureExport and the format argument (vtx, vtkhdf, xdmf, checkpoint), including a single-file vtkhdf multi-material export and a checkpoint round-trip with read_function_from_file. initial_conditions/concentration.md now does its checkpoint round-trip through FESTIM rather than raw io4dolfinx. Deprecation sweep: F.Reaction -> F.ArrheniusReaction, VTX*/XDMFExport -> SpeciesExport/TemperatureExport, advection_terms -> drift_terms, model.method_interface -> Interface(method=...). task06 also needed a physics fix: drift is now assembled in divergence form, so its untagged right-hand boundary had become a closed end and hydrogen piled up against it. It now carries an OutflowBC. environment.yml: festim 2.2rc1 -> 2.2rc2 (a clean drop-in; no new packages, so no effect on the Binder image layer size). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Read the Docs build for this PR (34390215) was terminated by the inactivity watchdog while apt-get update hung, before the conda install or the book build ran. No code change; this empty commit just re-fires the webhook. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Read the Docs failed in conda env create with a Cython compile error in harmonic/model_legacy.pyx. harmonic 1.3.0 publishes only a cp311 macOS wheel and no Linux wheel at all, so pip falls back to its sdist, which no longer compiles on Linux/py3.12. 1.3.1 ships a cp312 manylinux wheel and needs no compilation. harmonic arrives transitively via autoemulate >=2.1. Nothing in the pip section had changed -- RTD's fresh resolve simply backtracked one release further than a local one does -- so this is a pre-existing break that affects main equally, not something this branch introduced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The harmonic>=1.3.1 floor turned the failure into ResolutionImpossible: harmonic cannot be satisfied alongside fenics-dolfinx 0.11.0 at any version. 1.3.1 conflicts outright, and 1.3.0 was only ever reachable as a backtrack candidate whose sdist no longer compiles on Linux/py3.12. harmonic enters via autoemulate >=2.1. pip used to escape the conflict by backtracking past autoemulate 2.1 to 2.0.0, which has no harmonic dependency -- that is the version this repo's working environment actually has. Pinning <2.1 states that outcome explicitly rather than relying on the resolver finding it, and avoids a long backtracking search on every env build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The checkpoint section ran a second model built on a freshly created mesh while its initial condition came from read_function_from_file, whose function lives on the mesh stored in the checkpoint. Interpolating between two distinct mesh objects raises RuntimeError in create_initial_conditions on dolfinx 0.11.0, which is what Read the Docs installs; it happened to be tolerated on the older dolfinx this was written against. The page now demonstrates the round-trip (checkpoint export plus read_function_from_file) and points at ic-functions for using the result, matching the structure it had before, with a warning documenting the mesh constraint. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removed, having shipped in 2.0 or 2.1: the Machine Learning page, custom derived quantities, exporting a custom field, exporting a reaction rate, and weakly enforced Dirichlet boundary conditions. Kept: gas enclosures and the pumped-interspace application built on them, which are 2.2 features. Added for 2.2: the Drift terms and Manifold subdomains chapters, the reworked reaction hierarchy, and the two new sections on selectable export formats. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Covers the four user-facing features of v2.2-rc.2, which the book had no page for, and moves the rest of the book onto the new API.
environment.yml:festim==2.2rc1→2.2rc2. A clean drop-in — no new packages, so no effect on the Binder image layer size.New chapter: Drift terms (
content/drift/)Nothing covered Soret or electromigration; advection appeared only inside two application pages.
soret.md— a closed slab in a temperature gradient, run with and without the term. Checked against the analytical steady statec ∝ exp(Q*/k_BT)(9e-8) and the inventory conserved to 6e-14.electromigration.md— a charge sweep overz ∈ {−1, 0, +1}, checked against the Boltzmann distribution (1e-5).advection.md— the divergence form andOutflowBC, taught by running one channel twice: with no outlet condition the concentration peaks at 15.5× the inlet value against the now-closed end; withOutflowBCit maxes at 1.0. Then a uniform-field case where the diffusive flux is identically zero, so theSurfaceFluxreading of ⅔·v_max·L_y is provably the drift contribution.New chapter: Manifold subdomains (
content/manifolds/)manifold_basics.md— declaring a codim-1 subdomain, the bulk exchange pair and its units, codim-2 boundary conditions, trapping, and derived quantities in all three places. A grain boundary carrying 4.5× what the whole square does.pipe_wall.md— a coolant channel as a manifold: advection along it, a codim-2 inlet and anOutflowBCoutlet. Pickup rate matches the wall permeation to 1.3%.Reactions and exports
species_reactions/generic_reactions.md— theReactionBase/GenericReaction/ArrheniusReaction/DecayReactionhierarchy, rate coefficients as callables ofTor of another species, and tritium → He-3 decay with T+He conserved to 1e-10.post_process/exports.mdrewritten aroundSpeciesExport/TemperatureExportand theformatargument (vtx / vtkhdf / xdmf / checkpoint), including a single-filevtkhdfmulti-material export and a checkpoint round-trip.initial_conditions/concentration.mdnow does its checkpoint round-trip through FESTIM instead of rawio4dolfinx.Deprecation sweep
F.Reaction→F.ArrheniusReaction,VTX*/XDMFExport→SpeciesExport/TemperatureExport,advection_terms→drift_terms,model.method_interface→Interface(method=...). No notebook emits aDeprecationWarningany more.One physics fix
task06was wrong under 2.2. Drift is now assembled in divergence form, so the boundary term constrains the total flux and an untagged boundary is a wall. Its right-hand boundary (id=3) was declared but never given a condition, and the flow leaves through it — so hydrogen was piling up against a closed end. It now carries anOutflowBC.cfd.mdneeded only the rename: the lid-driven cavity has Dirichlet BCs on all four sides and a divergence-free field, so its results are unaffected.Verification
surrogate.md,heat_transfer.md) or from untracked local scratch files — none from anything touched here.cfd.md, which needs the OpenFOAM cavity data that is untracked locally. Its change is the rename plus prose. Worth a run before merge, as it is the only untested file.jupyter-book buildwith execution on was not run (it force-executes the ML and CFD pages).Upstream note
FESTIM's
docs/source/userguide/subdomains.rstcarries a note claimingSurfaceFluxis diffusive-only on a manifold carrying anAdvectionTerm. That is stale:pipe_wall.mdmeasures +9.31e-3 at the manifold outlet, matchingv·c_out= 9.33e-3, where diffusive-only would give −1.8e-5 — opposite sign, 500× smaller. The note predates the drift work by two days (f26b6677vsf24bb099), and no matching warning exists in the source. Upstream's owntest_outlet_flux_of_a_manifold_carrying_advectioncannot catch it because it fixesc=0at the outlet.🤖 Generated with Claude Code