Skip to content

Short tutorials 10 to 14: Stokes, unsteady flow, linear solvers, third medium, staggered - #11

Merged
jmartfrut merged 4 commits into
mainfrom
short-tutorials-4
Dec 4, 2026
Merged

jmartfrut merged 4 commits into
mainfrom
short-tutorials-4

Conversation

@jmartfrut

@jmartfrut jmartfrut commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Short tutorials 10 to 14 (phase 3 of the plan), with the same rules as 1 to 9: weak forms written as integrals,
a sketch and a result figure, one final check that says what its reference is.

  1. Stokes flow around a cylinder (from E10): Taylor–Hood; the outflow equals the inflow.
  2. Unsteady flow around a cylinder (from E11): stabilised Navier–Stokes with BDF2 at Re = 20; drag within 3 %
    of the benchmark (−1.8 %, as in E11).
  3. Changing the linear solver (from E13): CG with GAMG of PETSc and the rigid-body modes; same solution as LU.
  4. Contact through a third medium (from E06), marked as advanced: the force peak of E06 on the same mesh.
  5. Solving two fields in turn (from E09), the StaggeredModel on E09's case and model; longer than the others
    (182 lines), as agreed, and marked as the most advanced; the tip of E09.

Also:

  • The CI job of the short tutorials runs with one thread: PETSc with several threads crashed on Linux. On the Mac
    the 14 short tutorials take the same time with 1 and 4 threads (about 4 min). The README and tutorial 12 say so
    for Linux users.
  • E09 drops the "Going further" suggestion of a converged loop (coupling_tol with IQN-ILS or Aitken), which does
    not finish with its solvers.

Checks: Pkg.test of the tutorials group at one thread with --depwarn=error (14 tutorials) and of E09; every
"Try it yourself" variant run once; the explicit forms equal HyperFEM's helpers (12, 13) or the values of the
validation examples (10, 11, 14) to round-off, compiled without falling back to Gridap; docs build OK.
Independent review in three rounds: no errors in the physics; fixed explanations (P1 Stokes variant, sign
convention of tutorial 14), a more robust check of the contact peak and details of texts and figures.

… third-medium contact

Four more short tutorials with explicit weak forms, a sketch and a result figure each, and one check: the mass
balance of the Stokes flow, the drag of the benchmark at Re = 20, the iterative solution against the direct one,
and the force peak of the third-medium contact of E06 on the same mesh.
Correct explanation of the P1 variant of the Stokes flow, a check of the contact peak with a margin, the start of
PETSc explained, the profiles of the Stokes figure ending on the cylinder, and clearer texts.
… at one thread in CI

Tutorial 14 solves the magnetic field, the beam and the vacuum of E09 in turn, with E09's model; it is longer
than the others and says so. Tutorial 13 says that it is an advanced tutorial and where its options are
documented. The CI job of the short tutorials runs with one thread, because PETSc with several threads crashed
on Linux.
Tutorial 14 explains the sign convention of the magnetisation as E09 does, states the one-pass variant by the
tip only, gives the applied field and checks the flag of solve!. A note on PETSc with threads on Linux in the
README and tutorial 12. E09 drops the suggestion of a converged loop (coupling_tol with IQN-ILS or Aitken),
which does not finish with its solvers.
@jmartfrut
jmartfrut merged commit a76b8c6 into main Dec 4, 2026
10 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.

1 participant