Boundary condition

Hello
Dear community FreeFem, I need your help to introduce the boundary condition U.N=0 on Gamma where U=(ux,uy,uz) is the velocity and N=(Nx,Ny,Nz) is the unit normal vector.
For U=0 we put +on(Gamma, ux=0,uy=0, uz=0) but I don’t know what to write for the condition U.N=0 !?
Thanks for your help!

The most simple is to put

 +int2d(Th,Gamma)(1e12*(ux*N.x+uy*N.y+uz*N.z)*(vx*N.x+vy*N.y+vz*N.z))

where (vx,vy,vz) is the test function.

It will work if your boundary is the union of a finite number of plane parts.
However it will give bad results if your boundary is really curved,
because then the normal changes direction from one boundary cell
to the other, and the condition uxN.x+uyN.y+uz*N.z=0
will impose more conditions because u is continuous from one boundary cell to the other, leading to u.N1=0 and u.N2=0 at the intersection of the two boundary cells with respective normals N1 and N2 (in 2d it would thus impose ux=uy=0).

A more involved answer is to take

 +int2d(Th,Gamma)((ux*N.x+uy*N.y+uz*N.z)*w)
 +int2d(Th,Gamma)(r*(vx*N.x+vy*N.y+vz*N.z))
 +int3d(Th)(1e-12*r*w)

where r is a new unknown (lagrange multiplier) and w is its associated test function.
This will work for a curved boundary.

1 Like