Hello everyone,

I am trying to solve a simple case, of a 3D laminar flow inside a pipe using PETSc, on FreeFEM++ v4.8. This is a part of the code used (I removed only the part with saving files):

```
> load "PETSc"
> macro dimension()3 //EOM
> macro def(j)[j, j#B, j#C, j#D] //EOM
> macro init(j)[j, j, j, j] //EOM
>
> include "macro_ddm.idp"
> load "iovtk"
> load "msh3"
> load "medit"
>
>
> mesh3 Th=readmesh3("....mesh");
> plot(Th, wait=true);
>
> func FES=[P2,P2,P2,P1];
> fespace XXXXFES(Th,FES);
> XXXXFES[u,v,w,p];
> XXXXFES[hx,hy,hz,q];
> XXXXFES[up,vp,wp,pp];
>
>
> real InletVel = 1;
> real dt = 0.01;
> int iter = 3;
> real Re = 1500.;
>
> i nt Wall = 3;
> int Inlet = 12;
> int Outlet = 10;
>
> [u,v,w,p]=[0.,0.,0.,0.];
>
> varf LNS ([u, v, w, p],[hx, hy, hz, q])
> = int3d(Th)(
> (1./dt)*(u*hx+v*hy+w*hz))
> +int3d(Th)(
> +(1./Re)*(dx(u)*dx(hx)+dy(u)*dy(hx)+dz(u)*dz(hx))
> +(1./Re)*(dx(v)*dx(hy)+dy(v)*dy(hy)+dz(v)*dz(hy))
> +(1./Re)*(dx(w)*dx(hz)+dy(w)*dy(hz)+dz(w)*dz(hz))
> -p*(dx(hx)+dy(hy)+dz(hz))
> -(dx(u)+dy(v)+dz(w))*q
> -1e-10*p*q
> )
> +int3d(Th)(
> +(1./dt)*convect([up,vp,wp],-dt,up)*hx
> +(1./dt)*convect([up,vp,wp],-dt,vp)*hy
> +(1./dt)*convect([up,vp,wp],-dt,wp)*hz
> )
>
> + on(Wall, u=0., v=0., w=0.)
> + on(Inlet, u=0., v=0., w=InletVel);
>
>
> string[int] Variables(2);
> Variables[0] = "Velocity";
> Variables[1] = "Pressure";
>
> Mat J;
> createMat(Th, J, FES);
> J = LNS(XXXXFES,XXXXFES, tgv=-1);
> real[int] Jrhs = LNS(0, XXXXFES, tgv=-1);
> set(J, sparams = "-ksp_type bicg -pc_type jacobi", fields = u[], names = Variables);
>
> int i;
> for(i = 0; i<=iter; i++)
> {
> up[] = u[];
> u[]=J^-1*Jrhs;
> }
```

When I set -nb 2 or more I get: FreeFEM+±mpi.exe aborted the job. abort code 50176059. I run it with -malloc_debug to see if it is a memory error and I get: FreeFEM+±mpi.exe aborted the job. abort code 70033056.

If I set -nb 1 It run but it seems that my loop is not correct as the velocity/pressure doesn’t update after each iteration.

Any guidance to fix this problem is appreciated. Thank you in advance!

Regards,

Robert