On Jun 8, 2012, at 2:07 PM, Yun Tao wrote:

> Hm. Tried both with no success (please see attachment). I noticed that simply 
> just defining the equation with the convection above without running the 
> solver on it (eq2) would freeze up python, sometimes to the point of crashing 
> it. I've also tried using different convection terms, but it seems to make no 
> difference.

Sorry. I read your script too fast and didn't test what I wrote.

Use 

  eq2 = TransientTerm() == DiffusionTerm(coeff=D) + 
convection(coeff=numerix.tanh(pos))

Note: Use numerix, not numpy. Never use numpy directly with FiPy.

I am assuming you really wanted np.tanh(pos[1]) for the y component, not 
np.tanh(pos[0]) ? Correct? 

If you really wanted the latter, then you should be able to do

  eq2 = TransientTerm() == DiffusionTerm(coeff=D) + 
convection(coeff=numerix.tanh(pos[0]) * [[1], [1]])
  


_______________________________________________
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