Temperature around a hot dolphin in a flow field

From The FEniCS project

The temperature around a hot dolphin in surrounding cold water with a hot inflow boundary condition. The velocity field is obtained from a previously computed P2-P1 Taylor-Hood approximation of the Stokes equations (example below). The following code shows the implementation in FFC:

Image:Fenics-stokes-convection-diffusion.png
scalar = FiniteElement("Lagrange", "triangle", 1)
vector = FiniteElement("Vector Lagrange", "triangle", 2)

v = BasisFunction(scalar)

u1 = BasisFunction(scalar)
u0 = Function(scalar)
b = Function(vector)
f = Function(scalar)

c = 0.005
k = 0.05

a = v*u1*dx + 0.5*k*(v*dot(b, grad(u1))*dx + c*dot(grad(v), grad(u1))*dx)
L = v*u0*dx - 0.5*k*(v*dot(b, grad(u0))*dx + c*dot(grad(v), grad(u0))*dx) + v*f*dx

Contributed by Anders Logg

Personal tools