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) and Field(trial="p", test="q", order=1), write the scalar integrand in forward;

  • steady problems linearize convection with Picard (the lagged velocity enters as data), transient ones add a backward-Euler mass term and a forward_vector load;

  • boundary conditions go through assembler.layout masks and the unchanged Condenser.

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.

Taylor-Hood Stokes

Manufactured Stokes solution + convergence study — the mixed-assembly tutorial.

Taylor-Hood Stokes
Lid-Driven Cavity

Steady NS at Re=100, Picard iteration — in 2D and 3D with one dimension-generic weak form.

Lid-Driven Cavity
Cylinder Flow (Vortex Shedding)

Transient DFG benchmark: backward Euler, topological P2 on a gmsh mesh, vorticity via mixed load vectors.

Cylinder Flow (Vortex Shedding)
Flow Past Multiple Obstacles

Steady channel flow at Re=150 around six circular obstacles via MeshGen CSG.

Flow Past Multiple Obstacles
Rayleigh-Bénard Convection

Three-field Boussinesq system — velocity, pressure, and temperature in one block matrix.

Rayleigh-Bénard Convection
Taylor-Green Vortex

Decaying vortex with exact solution — the convergence-study showcase.

Taylor-Green Vortex (Convergence Study)