# LSFEM for incompressible flow

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 14, 2010, 13:14 LSFEM for incompressible flow #1 New Member   Sébastien Join Date: Jan 2010 Posts: 2 Rep Power: 0 Hi all, I try to write a least square finite element code to solve the incompressible navier stokes equations. The equations in u,w,p formulation are a system of 8 first order ODE, they can be writed as A1 * du/dx + A2 * du/dy + A3 * du/dz + A * u with u={vx,vy,vz,wx,wy,wz,p} or in short L*u = F. The least square finite element formulation give for the element matrix and the element vector Ke = integral of { transpose (L*Nj) * (L*Ni)} Fe = integral of { transpose (L*Nj) * F } It look simple but It don't works when I put it in practice. That is what I do : For each element For i=1 to number of nodes in the element I compute L*Nj I compute the matrix vector product Fe = L*Nj * F I assemble this local vector to the global vector For j=1 to number of nodes in the element I compute L*Ni I compute the matrix product betxeen the transpose of L*Nj and L*Ni I assemble this local matrix to the global matrix Do you see my mistake ? Maybe do you know a public source code in free access from the web using the LS-FEM strategy ? Best regards, Sébastien