Zebo,

I have solved this type of problem by specifying v in an if statement
within the time-marching loop.  I am not sure if there is a more elegant or
efficient way of doing it.

for step in range(steps):    time += timeStep    if time < 0.5:
u.setValue((1.0,))    elif time < 1.0:        u.setValue((0.0,))
else:        u.setValue((-1.0,))    eqn.solve(dt=timeStep)
viewer.plot()


The whole script is at:

https://gist.github.com/klkuhlm/d97eb37da84ce7329de6

Kris




On Sun, Jun 1, 2014 at 4:16 PM, Zebo LI <[email protected]> wrote:

> Hello,
> I am working on a diffusion equation, but the convection velocity will
> change with time: v=v(t). So is there any way to deal with time-dependent
> convection term?
>
> best,
> Zebo
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>
_______________________________________________
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