← Back to team overview

dolfin team mailing list archive

Stokes form and viscosity

 

Hi everybody

I try to do a Stokes problem with viscosity and use this form

P1 = FiniteElement("Lagrange", "triangle", 1)
P2 = FiniteElement("Vector Lagrange", "triangle", 2)
linear_scalar = FiniteElement("Lagrange", "triangle", 1)
TH = P2 + P1

(v, q) = BasisFunctions(TH)
(U, P) = BasisFunctions(TH)
nu = Function(linear_scalar)
f = Function(P2)

a = nu*(dot(grad(U), grad(v)) - P*div(v) + div(U)*q)*dx
L = dot(f, v)*dx

it gives the right velocities but fails to produce right pressures. I use the same direct solver as in the stokes demo

 Stokes2D_vd::BilinearForm a(nu);
 Stokes2D_vd::LinearForm L(f);
 PDE pde(a, L, mesh, bc);

 // Compute solution
 Function U;
 Function P;
 pde.solve(U, P);

any idea why this does not give the right pressure?

I also used an iterative solver with a different form:

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

which worked but failed to converge for denser meshes.

thanks for all comments and help

Alex