Velocity field around a two-dimensional dolphin

From The FEniCS project

The velocity field for the flow around a two-dimensional dolphin obtained by a P2-P1 Taylor-Hood approximation of the Stokes equations. The following code shows the implementation in FFC:

Image:Fenics-taylor-hood.png
P1 = FiniteElement("Lagrange", "triangle", 1)
P2 = FiniteElement("Vector Lagrange", "triangle", 2)
TH = P2 + P1

(v, q) = BasisFunctions(TH)
(u, p) = BasisFunctions(TH)

f = Function(P2) 

a = (dot(grad(v), grad(u)) - div(v)*p + q*div(u))*dx
L = dot(v, f)*dx

Contributed by Anders Logg

Personal tools