Hi Kris, Good to hear from you again and a very nicely coded example.
I think it's a solver issue. I tried the LU solver and it gives perfect results. See https://gist.github.com/wd15/affe4d82cc2a189d894a7d774e4bc00b. This might suggest that we need to change the default solver when using the central difference scheme. Cheers, Daniel On Mon, Apr 25, 2016 at 11:54 AM, Kris Kuhlman <kristopher.kuhl...@gmail.com> wrote: > I am trying to understand the convection terms available in fipy through a > simple steady-state problem. I am surprised at the divergence of the > CentralDifferenceConvectionTerm, is this to be expected? As the > discretization in the mesh is made finer, the solution gets worse!? > > The problem is: \frac{\partial^2 u}{\partial x^2} - v \frac{\partial > u}{\partial x} = 0 > > The script at the link below compares the solution using different > ConvectionTerms, and plots the figures attached for different values of nx. > For larger values of v, the solution diverges even more and becomes > oscillatory. > > https://gist.github.com/klkuhlm/07f9eaf52b24e103f60ae213c0944c21 > > Is this expected behavior? > > Kris > > > _______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]