Repository navigation
Add a Navier-Stokes showcase to the README and docs: vortex street figure and animation - #59
Merged
Merged
Conversation
…ndered by the docs build The README gains a second code block, the DFG channel at Reynolds number 100 started from rest, and embeds its figure and animation by the docs.sciml.ai assets URLs the heat gif uses. examples/ns_showcase.jl runs that block (extracted from the README, like the heat one) and records speed and vorticity with CairoMakie; docs/make.jl renders ns_showcase.png and ns_showcase.gif and the Navier–Stokes page embeds them. The Frontend README test runs the block and checks no slip, the inflow peak and the Strouhal number of the shed wake. The docs environment gains Ferrite, Gmsh, LinearSolve and SciMLBase, already in its manifest as indirect dependencies, because the block includes the example mesh generator and names the solver. 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>
…dered images The README gains a third code block, the plotting and animation, next to the simulation block, with the CairoMakie install line. examples/ns_showcase.jl runs both blocks as written and writes ns_showcase.gif, ns_showcase.png and a checksum of the two blocks into docs/src/assets. Those copies are committed and the README embeds them by raw.githubusercontent.com URLs, so the animation shows as soon as this merges. A Frontend test fails when the blocks change without the images being regenerated. The docs build re-runs the blocks into a scratch directory to check that they run, and the Navier–Stokes page shows the committed copies. 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 README embeds the heat gif by its raw.githubusercontent.com URL, like the Navier–Stokes images, so it shows without a docs deploy. docs/src/assets/showcase.gif is tracked with a checksum of README block 1 (showcase.fnv1a), written by examples/showcase.jl, whose default output is now docs/src/assets. The Frontend test checks both image sets against their README blocks. The docs build re-runs the heat block into a scratch directory and no longer writes to docs/src/assets. 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>
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>
…atural 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>
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.
Adds an end-to-end Navier-Stokes example to the README and the docs, with the code that makes the figure and the animation, and the rendered images committed so they display the moment this merges.
What it shows: the DFG channel at Reynolds number 100 (inflow peak 1.5, the 2D-2 inflow), started from rest and run to t = 6, with the same Q2/Q1 Taylor-Hood DAE as the Re 20 example (
h = 0.04, 16,430 dofs, tolerance 1e-6). A von Karman vortex street sheds from about t = 3; the Strouhal number measured from the cross-stream velocity at (0.6, 0.2) is 0.28 to 0.31 (benchmark value about 0.3). The Re 20 case (2D-1) is steady and never sheds, so the animation uses Re 100; at tolerance 1e-5 the steps are too coarse and the shedding is damped out.README: a "Navier-Stokes" section after the heat example holds the still figure and the animation, a scope paragraph, the simulation code block, and the plotting/animation code block (resampling with
sol(ts, xs, ys; dv),NaNinside the cylinder, then Makie). CairoMakie is not a dependency of FiniteElementMethod; the section says so and gives the install line (using Pkg; Pkg.add("CairoMakie")). The images usehttps://raw.githubusercontent.com/SciML/FiniteElementMethod.jl/master/docs/src/assets/ns_showcase.{png,gif}, so they resolve from the repository as soon as this merges, with no docs deploy needed. The gif is 2.64 MB (720 x 350 px, 90 frames at 18 fps, 5.0 s covering simulated time 0 to 6); the png is 196 KB. The heat gif is committed the same way:docs/src/assets/showcase.gif(1.57 MB) is tracked and the README embeds it byhttps://raw.githubusercontent.com/SciML/FiniteElementMethod.jl/master/docs/src/assets/showcase.gif(it used to be a docs.sciml.ai URL that resolved only after a docs deploy), so the whole README displays at merge.docs/make.jlrenders into a scratch directory for both gifs, so a docs build never dirties the tree, and the freshness checksum covers the heat block too (docs/src/assets/showcase.fnv1a; refresh withjulia --project=docs examples/showcase.jl, about 2 minutes).Single source: both code blocks are extracted from the README by block number.
examples/ns_showcase.jlruns blocks 2 and 3 in one module, the README test runs block 2 (the plotting block is only parsed in the test, because CairoMakie is not a test dependency), anddocs/make.jlre-runs both into a scratch directory so CI proves they run in the docs environment without dirtying the tree. The docs page and the README use the committed copies.Freshness:
docs/src/assets/ns_showcase.fnv1aholds an FNV-1a checksum of README blocks 2 and 3, written by the render script. The Frontend testset "README Navier-Stokes images are current" recomputes it and fails with "the README Navier-Stokes blocks changed; regenerate docs/src/assets/ns_showcase.gif, ns_showcase.png and ns_showcase.fnv1a withjulia --project=docs examples/ns_showcase.jlfrom the repository root", and checks the three files exist and that block 3 parses. Refresh by hand with that one command (about 3 minutes). The checksum covers the README blocks, not the gif bytes, so a different CairoMakie version could change the gif bytes while the checksum stays valid (two renders here were byte-identical).Other changes:
examples/readme_code.jlgainsblockandnameskeywords (defaults unchanged);docs/Project.tomladds Ferrite, Gmsh, LinearSolve and SciMLBase (already in the manifest indirectly);navier_stokes.mdembeds the images and describes the test; the two.gitignorelines for the NS assets are gone (docs/src/assets/showcase.gifstays ignored).Cost: the README simulation block about 150 s including compile, the figure about 22 s, the gif about 7 s; the docs build went from 114 s to about 271 s unloaded (+2.6 min); the Frontend group is about 2 minutes longer.
Honest scope: a showcase, not a validated 2D-2 run. Coarse mesh (blocky vortices), vorticity is a central difference of the sampled velocity (noisy near element edges), and only the Strouhal band is tested, not amplitude or lift oscillation. Only the Re 20 steady case is validated against drag, lift and pressure difference. Relation to #54 (merged): the showcase's open outflow has no condition for
uandv(onlyp = 0is set), which #54's completeness check reports, so README block 2 declares itnatural = [Γ_out]and thenavier_stokes.mdcode does the same (Γoutthere), exactly asexamples/dfg_cylinder/dfg_cylinder.jldoes on master. The README checksum changed accordingly (ns_showcase.fnv1a:143fc665d22ed918toa3eb010d9c375841); the re-render left the gif and png byte-identical.Local results on Julia 1.12.1: README test 6/6 (heat), 6/6 (NS) and 4/4 (images current); docs build exit 0; Runic 1.13 clean; Codex approved. The Downgrade job fails on every PR for a reason unrelated to this one (#61 fixes it).
🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c