Fluid Mechanics¶
A family of worked incompressible-flow examples in examples/fluid/,
from a manufactured Stokes problem with a convergence study to
Rayleigh-Bénard convection coupling momentum and energy. They are all
built on Taylor-Hood P2-P1 mixed assembly: a quadratic velocity and
a linear pressure declared on one
MixedElementAssembler, so the pair is inf-sup
(LBB) stable and the weak form is the whole discretization — no
SUPG/PSPG stabilization, no tau tuning.
The recipe is shared across the family (read Taylor-Hood Stokes first, then the rest are physics and boundary-condition variations):
declare
Field(trial="u", test="v", order=2, components=d)andField(trial="p", test="q", order=1), write the scalar integrand inforward;steady problems linearize convection with Picard (the lagged velocity enters as data), transient ones add a backward-Euler mass term and a
forward_vectorload;boundary conditions go through
assembler.layoutmasks and the unchangedCondenser.
On generated order-2 meshes the velocity nodes coincide with the mesh
points; on linear gmsh/MeshGen meshes (cylinder,
obstacles) the quadratic space is created topologically — no
re-meshing at order 2. See Mixed Assembly for
the machinery.
Manufactured Stokes solution + convergence study — the mixed-assembly tutorial.
Steady NS at Re=100, Picard iteration — in 2D and 3D with one dimension-generic weak form.
Transient DFG benchmark: backward Euler, topological P2 on a gmsh mesh, vorticity via mixed load vectors.
Steady channel flow at Re=150 around six circular obstacles via MeshGen CSG.
Three-field Boussinesq system — velocity, pressure, and temperature in one block matrix.
Decaying vortex with exact solution — the convergence-study showcase.