[petsc-users] PF+Navier stokes

Barry Smith bsmith at petsc.dev
Mon Mar 22 13:56:30 CDT 2021


   Singular systems come up in solving PDEs almost always due to issues related to boundary conditions. For example all Neumann (natural) boundary conditions can produce singular systems. Direct factorizations generically will eventually hit a zero pivot in such cases and there is no universally acceptable approaches for what to do at that point to recover. If you think your operator is singular you should start by using MatSetNullSpace(), it won't "cure" the problem but is the tool we use to manage null spaces in operators.





> On Mar 22, 2021, at 9:04 AM, Sepideh Kavousi <skavou1 at lsu.edu> wrote:
> 
> Hello,
> I want to solve PF solidification+Navier stokes using Finite different method, and I have a strange problem. My code runs fine for some system sizes and fails for some of the system sizes. When I run with the following options:
> mpirun -np 2 ./one.out -ts_monitor -snes_fd_color -ts_max_snes_failures -1  -ts_type bdf -ts_bdf_adapt -pc_type bjacobi  -snes_linesearch_type l2 -snes_type ksponly -ksp_type gmres -ksp_gmres_restart 1001 -sub_pc_type ilu -sub_ksp_type preonly -snes_monitor -ksp_monitor -snes_linesearch_monitor -ksp_monitor_true_residual -ksp_converged_reason -log_view
> 
>     0 SNES Function norm 1.465357113711e+01
>     0 SNES Function norm 1.465357113711e+01
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     0 SNES Function norm 1.465357113711e+01
>     0 SNES Function norm 1.465357113711e+01
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     0 SNES Function norm 1.465357113711e+01
>     0 SNES Function norm 1.465357113711e+01
> ^C    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     0 SNES Function norm 1.465357113711e+01
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to SUBPC_ERROR
>     0 SNES Function norm 1.465357113711e+01
> 
> Even setting pc_type to LU does not solve the problem.
> 0 TS dt 0.0001 time 0.
> copy!
> copy!
> Write output at step= 0!
> Write output at step= 0!
>     0 SNES Function norm 1.465357113711e+01
>     0 SNES Function norm 1.465357113711e+01
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT
>     Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0
>                    PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT
> 
> I guess the problem is that in mass conservation I used forward discretization for u (velocity in x) and for the moment in x , I used forward discretization for p (pressure) to ensure non-zero terms on the diagonal of matrix. I tried to run it with valgrind but it did not output anything.  
> 
> Does anyone have suggestions on how to solve this issue? 
> Best,
> Sepideh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210322/79f1660b/attachment.html>


More information about the petsc-users mailing list