Skip to content

Add a docs example: axisymmetric swirl, a collapsing core - #63

Merged
xtalax merged 8 commits into
masterfrom
docs/axisym-swirl
Nov 5, 2026
Merged

xtalax merged 8 commits into
masterfrom
docs/axisym-swirl

Conversation

@xtalax-droid

@xtalax-droid xtalax-droid commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a docs page, "Axisymmetric swirl: a collapsing core": what a finite element run of our own axisymmetric-with-swirl Navier-Stokes discretization does, driven by a manufactured self-similar collapsing core with the exponents of the forced-blowup paper. It is our own discretization, nothing more: it does not reproduce, prove or disprove that paper, whose blowing-up flow is not even axisymmetric. The force is defined as the residual of our manufactured family and is ours.

What is in it: examples/axisym_swirl/ (mesh.geo graded toward the origin and parametrised by c through Gmsh's onelab, manufactured.jl with the exact field and the residual forces compiled with build_function(...; cse = true) and registered with @register_symbolic, axisym_swirl.jl with the PDESystem in (r, z), ibp = Dict(eq => Weighted(r)) on the three momentum equations, the continuity equation weighted as 0 ~ Dr(r*ur) + r*Dz(uz) paired with p, P2/P1 Taylor-Hood, natural = [Γaxis] for the axis, a pinned pressure and the r-weighted L2 error; figures.jl and checksum.jl render the two committed images and a checksum), test/NavierStokes/axisym_swirl.jl (c = 0.2 then 0.1 at tau_end = 0.1, asserting velocity rate above 2.7 and pressure rate above 1.7, plus the scalar Weighted(r) heat test with rate above 2.7; a freshness test compares a checksum of the example sources with the committed axisym_swirl.fnv1a, as in #59), docs/src/axisymmetric_swirl.md (entry after the Navier-Stokes example) and two committed images (268 KB mesh picture, 150 KB core picture: swirl at t = 0.5, 0.9 and 0.99 and the error staying flat as the core collapses).

All numbers on the page were measured by running the committed example on this host (UMFPACK, new_W_dt_cutoff = 0). Relative r-weighted L2 error, velocity / pressure: c = 0.1: 1.83e-4 / 1.95e-3 at t = 0.5, 1.78e-4 / 1.84e-3 at 0.9, 1.68e-4 / 1.92e-3 at 0.99; c = 0.05: 2.21e-5 / 4.76e-4, 2.14e-5 / 4.78e-4, 2.23e-5 / 4.86e-4; c = 0.025: 2.72e-6 / 1.19e-4, 2.68e-6 / 1.19e-4, 2.71e-6 / 1.19e-4. Observed rates between successive c: about 3.0 for velocity and 2.0 for pressure at every time. Cost: c = 0.1 has 4,870 cells and 32,324 unknowns (23.5 s, 2.7 GiB peak), c = 0.05 has 18,894 cells and 124,138 unknowns (101 s, 3.95 GiB), c = 0.025 has 75,004 cells and 490,169 unknowns (421 s, 9.49 GiB); 427 to 428 steps each, zero rejected steps and zero Newton failures; compile plus warm-up about 55 s per process.

Docs build: no solve is added to it (static code blocks executed by the tests, like the other pages) and the two images are committed, so the build delta is within noise (1m48.71 s with and without the page). The c = 0.1 run behind the figures takes about 2m19 including compile and is run by julia --project=docs examples/axisym_swirl/figures.jl; any edit to mesh.geo, manufactured.jl, axisym_swirl.jl or figures.jl (even a comment) changes the checksum and needs that one command or the freshness test fails.

Choices I want to be explicit about. (1) new_W_dt_cutoff = 0 is kept here, unlike #62's DFG example: at c = 0.05 the default cutoff gives a pressure error 22% worse at t = 0.5 (5.82e-4 against 4.76e-4) for only 16% less solve time. (2) UMFPACK is used at every size, not KLU, and its linear solves are checked: on the Newton matrix W at t = 0.5 extracted from the c = 0.05 and c = 0.025 runs (each solver alone in its own process), UMFPACK's default settings reach a relative residual of 6.4e-15 at 124,138 unknowns (1.1 s, 1.4 GiB) and 2.6e-14 at 490,169 unknowns (4.9 s, 4.0 GiB), about nine orders of magnitude below the spatial errors, so the linear solves do not contaminate the error table; KLU is both slower and less accurate here (8.0e-6 in 1015 s and 8.4 GiB at 124k; at 490k it was still factorizing at the 25-minute cap with at least 20 GiB, so no residual was obtained); earlier at 26k unknowns it took 181 s and 6.2 GiB against 17 s and 2.6 GiB, and at 32k it had not finished after 10 minutes. The measurement is one state (t = 0.5) for this system only and says nothing about other saddle-point matrices (the DFG matrices need the pivot-tolerance route); every step needed about one Newton iteration, so a linear solve error would not be iterated away, but here it is at rounding level; the right-hand side used is the residual at the accepted state with time advanced one step, not DFBDF's own Newton right-hand side (the page says so). The page also points at LinearSolve.jl PR #1414 (opt-in pivot_tolerance and strategy for UMFPACKFactorization, open when written) as the route for large problems once released. The script is examples/axisym_swirl/linear_residual.jl (not checksum-covered). (3) Weighted is imported as using PDEBase.StrongForm: Weighted (not exported or documented in this package yet). (4) The example's error function uses internals (sol.disc_data.space.dh, sol.original_sol) because there is no public error-norm API.

Local results on Julia 1.12.1: GROUP=NavierStokes passes (the new test 19/19 in 2m01, the DFG test 15/15), no boundary-completeness warning, Core and QA pass, the docs build exits 0, Runic clean, Codex approved. typos is not installed locally, so identifiers and prose were scanned by hand. Findings for separate work: Weighted export and docs; this is the first test of Navier-Stokes on P2/P1 triangles from Gmsh; long symbolic sources compile without common-subexpression elimination (the force is registered here as the workaround; fix proposed as its own PRs); the @profile segfault at 124k was not reproduced.


🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c

t and others added 3 commits November 5, 2026 05:36
…lor-Hood mesh

Axisymmetric-with-swirl Navier-Stokes in (r, z) with Weighted(r) momentum equations, P2/P1 triangles from Gmsh, and a manufactured self-similar core whose force is the residual of our own equations at that field.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A scalar Weighted(r) heat problem (rate about 3) and the swirl system at c = 0.2 and 0.1 (velocity rate above 2.7, pressure rate above 1.7), plus a freshness check of the committed figures.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
New docs page with the equations, driver, mesh, solve, measured convergence and cost tables, and limits. The two images are committed with a checksum of their sources; the docs build runs no solve.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master f39fd50... master / f39fd50...
construction/heat P1 10x10 7.47 ± 0.55 ms 7.36 ± 0.64 ms 1.01 ± 0.11
construction/heat P1 20x20 10.1 ± 0.58 ms 10.3 ± 0.66 ms 0.976 ± 0.084
time_to_load 5.52 ± 0.018 s 5.59 ± 0.051 s 0.988 ± 0.0095
Memory benchmarks
master f39fd50... master / f39fd50...
construction/heat P1 10x10 0.0393 M allocs: 2.12 MB 0.0393 M allocs: 2.12 MB 1
construction/heat P1 20x20 0.0702 M allocs: 4.73 MB 0.0702 M allocs: 4.73 MB 1
time_to_load 0.2 k allocs: 11.8 kB 0.2 k allocs: 11.8 kB 1

t and others added 2 commits November 5, 2026 06:48
linear_residual.jl saves the Newton matrix at t = 0.5 and factorizes it once with UMFPACK or KLU. UMFPACK reaches 6e-15 (124k unknowns) and 3e-14 (490k); KLU is 1000 times slower and far less accurate. The page states the measurements and points at LinearSolve PR 1414.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
It is the residual at the accepted state advanced one step, not DFBDF's own Newton right-hand side.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax

xtalax commented Nov 5, 2026

Copy link
Copy Markdown
Member

cite the paper, mention the provenance

@xtalax

xtalax commented Nov 5, 2026

Copy link
Copy Markdown
Member

include an animation

t and others added 2 commits November 5, 2026 19:56
Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The axisymmetric swirl page now cites the OpenAI preprint it takes its scalings from, says what comes from it and what is ours, and embeds an animation of the c = 0.1 run rendered by examples/axisym_swirl/animation.jl, with its own checksum checked by the NavierStokes test group.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax
xtalax marked this pull request as ready for review November 5, 2026 22:41
@xtalax
xtalax merged commit 11c6c6e into master Nov 5, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants