On May 6, 2010, at 10:55 AM, Igor wrote:
> what if Term coefficient is time dependent function (for instance,
> velocity in ConvectionTerm)?:
>
> ConvCoeff = FaceVariable(mesh=mesh, value=v(x,t), rank 1)
>
> In the problem, it should be updated each time-step.
More convoluted, but this should give you an idea, depending on what v(x, t),
looks like
from fipy import *
t = Variable()
mesh = Grid2D(nx=10, ny=10)
X, Y = mesh.getFaceCenters()
ConvCoeff = (FaceVariable(mesh=mesh, value=[[1],[0]], rank=1) * X * cos(t * pi
/ 100)
+ FaceVariable(mesh=mesh, value=[[0],[1]], rank=1) * Y * sin(t *
pi / 100))
viewer = Viewer(vars=ConvCoeff)
while True:
t.setValue(t() + 1)
viewer.plot()