<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I found some discussions in the following link and  <a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2010-May/006422.html" id="LPlnk602984">
https://lists.mcs.anl.gov/pipermail/petsc-users/2010-May/006422.html</a> and the following paper:
<a href="https://www.sciencedirect.com/science/article/pii/S0021999107004330" id="LPlnk958734">
https://www.sciencedirect.com/science/article/pii/S0021999107004330</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
But I am engineer and the discussions are confusing for me. Would you please tell me what is the correct path to follow?<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Should I go ahead and apply SIMPLER algorithm for this problem, or I should learn to apply fieldsplit to determine individual preconditioning on each unknown?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Sepideh<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Sent:</b> Monday, March 22, 2021 9:15 AM<br>
<b>To:</b> Sepideh Kavousi <skavou1@lsu.edu><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] PF+Navier stokes</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Mon, Mar 22, 2021 at 10:04 AM Sepideh Kavousi <<a href="mailto:skavou1@lsu.edu">skavou1@lsu.edu</a>> wrote:<br>
</div>
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="background-color:rgb(0,255,0)">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</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="background-color:rgb(255,255,128)"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="background-color:rgb(255,255,255); color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span><span style="background-color:rgb(255,255,128)">
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">^C    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(12,136,42)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(12,136,42)">                   PC_FAILED due to SUBPC_ERROR
</span></div>
<div><span style="color:rgb(12,136,42)">    0 SNES Function norm 1.465357113711e+01</span>
</div>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="background-color:rgb(255,128,255)">Even setting pc_type to LU does not solve the problem.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="color:rgb(237,92,87)">0 TS dt 0.0001 time 0.</span>
<div><span style="color:rgb(237,92,87)">copy!</span></div>
<div><span style="color:rgb(237,92,87)">copy!</span></div>
<div><span style="color:rgb(237,92,87)">Write output at step= 0!</span></div>
<div><span style="color:rgb(237,92,87)">Write output at step= 0!</span></div>
<div><span style="color:rgb(237,92,87)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(237,92,87)">    0 SNES Function norm 1.465357113711e+01
</span></div>
<div><span style="color:rgb(237,92,87)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<div><span style="color:rgb(237,92,87)">                   PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT
</span></div>
<div><span style="color:rgb(237,92,87)">    Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0</span></div>
<span style="color:rgb(237,92,87)">                   PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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.  <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Does anyone have suggestions on how to solve this issue?</div>
</div>
</blockquote>
<div><br>
</div>
<div>Your subproblems in Block_jacobi are singular. With multiphysics problems like this, definition of blocks can be</div>
<div>tricky. I would first try to find a good preconditioner for this system in the literature, and then we can help you</div>
<div>try it out.</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>      Matt</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Sepideh<br>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="https://nam04.safelinks.protection.outlook.com/?url=http:%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&data=04%7C01%7Cskavou1%40lsu.edu%7Ce18d4d92dee141c0fb8d08d8ed3cf14b%7C2d4dad3f50ae47d983a09ae2b1f466f8%7C0%7C0%7C637520193296009424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AWCIKQQC65VDxZ%2BkufAE%2BgHb7aKd4FaISZYpCCgumgo%3D&reserved=0" originalsrc="http://www.cse.buffalo.edu/~knepley/" shash="MvkCnLyM2+uXwkD081Yc0v/H8xNcMQKn6OC+S9dz9n7pM5D1mOKBd2/xyGRwUH6Zsb4KPMiB9rTvzktAE5tsoAjRs4WGVuKU1sk6xFp17sW2jCvPYIDW5pnblHmhG7a/arE1NFl/9m5zyZJBMwKX6r/loehPBTiV3vYbWjkLuqM=" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>