On Jul 24, 2012, at 8:14 AM, Yun Tao wrote:

> I encountered an interesting problem when I tried to vary the convection 
> coefficient as a function of time steps. 
:
:
> There must be a better way to varying the coefficient. I've spent days 
> testing out dynamics under seasonal convection strength (c = F(dx*steps)) 
> only to realize that the steady-states I kept getting have all been due to 
> the coefficient not feeding through.

The semantics of Python are such that 

c = place_holder_num
c = 2.
c = 0.

creates three different objects and labels each of them 'c' in succession, 
discarding the previous ones. The FiPy equation refers to the one that existed 
when the equation was declared (the first one) and has no way of knowing that 
you've declared some new thing and called it 'c'.

The way to handle this is with a FiPy Variable. This is illustrated with a 
time-dependent boundary condition in 
http://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.mesh1D.html
(about half-way down).


_______________________________________________
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