On Sat, Aug 2, 2014 at 2:52 AM, Yun Tao <[email protected]> wrote:

> Hi FiPy,
>
> I've been solving transient solutions on a uniform 2D grid for a
> convection-diffusion equation that initially centers around some arbitrary
> position, e.g., (1,1), and moves towards the origin. However, I just
> discovered that if I inverse the process and simulates a movement starting
> from the origin towards (1,1), with everything else kept the same, the
> solution blows up. Sample scripts are attached here. Note that only lines
> 31 & 62 are different between the two.
>

It seems like the CFL number is too large. I fixed the code so it runs at a
CFL of about 0.1.

    https://gist.github.com/wd15/22d739ee506f5ebf07eb

I checked for the first 1000 steps.


>
> How could this be?
>

I think you were assuming that the velocity is "c" which would make your
CFL=0.5. However the real velocity is

    b*numerix.tanh(alpha*r)*pos/r

which is quite a bit different from "c". I used this expression to
calculate the max velocity anywhere within the domain and made sure that
the CFL is 0.1.

Why does repositioning the normal distribution matter? It is probably to do
with the fact that the larger velocity regions change position in relation
to the regions of higher gradient in phi.


> I also tried reducing the time step increment in the unstable example but
> without any success..
>

How low did you reduce the time step? I calculated that the time step
should be 6.71e-5 (for a CFL of 0.1). You were using 0.02.

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

Reply via email to