<div dir="ltr"><div dir="ltr">On Mon, Apr 6, 2020 at 2:06 PM Alexander B Prescott <<a href="mailto:alexprescott@email.arizona.edu">alexprescott@email.arizona.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>The non-linear boundary-value problem I am applying PETSc to is a relatively simple steady-state flow routing algorithm based on the continuity equation, such that Div(Q) = 0 everywhere (Q=discharge). I use a finite volume approach to calculate flow between nodes, with Q calculated as a piecewise smooth function of the local flow depth and the water-surface slope. In 1D, the residual is calculated as R(x_i)=Q_i-1/2 - Q_i+1/2.</div><div>For example, Q_i-1/2 at x[i]:</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>Q_i-1/2 proportional to sqrt(x[i-1] + z[i-1] - (x[i] + z[i])), if x[i-1]+z[i-1] > x[i]+z[i]</div><div>Q_i-1/2 proportional to -1.0*sqrt(x[i] + z[i] - (x[i-1] + z[i-1])), if x[i]+z[i] >
x[i-1]+z[i-1] </div></blockquote></div><div><br></div><div>Where z[i] is local topography and doesn't change over the iterations, and Q_i+1/2 is computed analogously. So the residual derivatives with respect to x[i-1], x[i] and x[i+1] are not continuous when the water-surface slope = 0.</div><div><br></div><div>Are there intelligent ways to handle this problem? My 1D trial runs naively fix any zero-valued water-surface slopes to a small non-zero positive value (e.g. 1e-12). Solver convergence has been mixed and highly dependent on the initial guess. So far, FAS with QN coarse solver has been the most robust.</div><div><br></div><div>Restricting x[i] to be non-negative is a separate issue, to which I have applied the SNES_VI solvers. They perform modestly but have been less robust.</div></div></blockquote><div><br></div><div>My understanding is that this is a shortcoming of the model, not the solver. However, I am Cc'ing Nathan since he knows</div><div>about these models.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Best,</div><div>Alexander</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:arial,sans-serif">Alexander</span><span style="font-family:arial,sans-serif"> </span><span style="font-family:arial,sans-serif">Prescott</span><br></div><div style="font-size:12.8px"><span style="font-family:arial,sans-serif"><a href="mailto:alexprescott@email.arizona.edu" target="_blank">alexprescott@email.arizona.edu</a></span></div><div style="font-size:12.8px"><div style="font-family:arial,sans-serif"><span>PhD</span> <span>Candidate</span>, The University of Arizona</div><div style="font-family:arial,sans-serif">Department of Geosciences</div><div style="font-family:arial,sans-serif">1040 E. 4th Street</div><div style="font-family:arial,sans-serif">Tucson, AZ, 85721</div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>