<div dir="ltr">I played with implicitly (BDF1 and BDF2) solving a linear advection equation before.<div>For spatial discretization, I used upwind donor cell method.<br><div>I did not give any specifications to the solver, so I suppose default works just fine. I did supply a Jacobian matrix for preconditioning purpose.</div></div><div><br></div><div>Here a screen shot of -snes_view and -ksp_view is attached.</div><div>Maybe PETSc team member could provide more useful info from this screenshot.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>-Ling</div><div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">SNES Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  type: newtonls</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  maximum iterations=50, maximum function evaluations=10000</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  tolerances: relative=1e-08, absolute=1e-50, solution=1e-08</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  total number of linear solver iterations=6</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  total number of function evaluations=11</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  norm schedule ALWAYS</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  SNESLineSearch Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    type: bt</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      interpolation: cubic</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      alpha=1.000000e-04</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    maxstep=1.000000e+08, minlambda=1.000000e-12</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    maximum iterations=40</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  KSP Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    type: gmres</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      happy breakdown tolerance 1e-30</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    maximum iterations=30, initial guess is zero</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    tolerances:  relative=0.001, absolute=1e-50, divergence=10000.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    left preconditioning</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    using PRECONDITIONED norm type for convergence test</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  PC Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    type: ilu</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      out-of-place factorization</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      0 levels of fill</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      tolerance for zero pivot 2.22045e-14</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      matrix ordering: natural</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      factor fill ratio given 1., needed 1.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        Factored matrix follows:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">          Mat Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            type: seqaij</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            rows=600, cols=600</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            package used to perform factorization: petsc</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            total: nonzeros=2994, allocated nonzeros=2994</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            total number of mallocs used during MatSetValues calls =0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">              not using I-node routines</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    linear system matrix followed by preconditioner matrix:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    Mat Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      type: mffd</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      rows=600, cols=600</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        Matrix-free approximation:</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">          err=1.49012e-08 (relative error in function evaluation)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">          Using wp compute h routine</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">              Does not compute normU</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    Mat Object: 1 MPI processes</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      type: seqaij</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      rows=600, cols=600</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      total: nonzeros=2994, allocated nonzeros=2994</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">      total number of mallocs used during MatSetValues calls =0</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        not using I-node routines</span></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 7, 2018 at 3:24 PM, Nishant Nangia <span dir="ltr"><<a href="mailto:nishantnangia329@gmail.com" target="_blank">nishantnangia329@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I want to implicitly solve a linear advection equation of the form:</div><div>dQ/dt + div(u*Q) = 0</div><div><br></div><div>for a scalar quantity Q, with some known velocity field u. Note that it is purely advection with no diffusion term. </div><div><br></div><div>Is there a recommended solver/preconditioner combination to solve something like this?</div><span class="HOEnZb"><font color="#888888"><div><div><div class="m_2133775890525799908gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br><b>Nishant Nangia</b><div>Northwestern University<br><div>Ph.D. Candidate | Engineering Sciences and Applied Mathematics<br></div></div><div><span style="font-family:arial;font-size:small">Tech L386</span><br></div></div></div></div></div></div>
</div></font></span></div>
</blockquote></div><br></div>