Re: understanding convection terms

2016-04-27 Thread Daniel Wheeler
On Tue, Apr 26, 2016 at 10:57 AM, Kris Kuhlman
 wrote:
> Daniel,
>
> Thank you. I am a bit surprised that the CentralDifference basically matches
> the hybrid method, and is more accurate than upwind.

Remember that central difference is second order accurate. The other
schemes are first order. Of course it's unstable when the Peclet
number is above 2 that's why we use the other schemes. Basically, the
schemes (hybrid, exponential etc) are ways to swap between central
difference and upwind based on the local Peclet number.

-- 
Daniel Wheeler
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: understanding convection terms

2016-04-26 Thread Kris Kuhlman
Daniel,

Thank you. I am a bit surprised that the CentralDifference basically
matches the hybrid method, and is more accurate than upwind.

Kris



On Tue, Apr 26, 2016 at 8:22 AM, Daniel Wheeler 
wrote:

> 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
>  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 ]
>
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: understanding convection terms

2016-04-26 Thread Daniel Wheeler
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
 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 ]