Dear Fipy developers and users,

I have a strange PDE in 2D "dphi/dt = Laplacian(phi) + Laplacian(phi**2) + Laplacian(phi**3)", which I implement in the following way, but raise typeerror "The value of an `_OperatorVariable` cannot be assigned". Can anyone help me? Thanks.


dx = 0.1
dy = dx
nx = 100
ny = nx
mesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny)
x = mesh.cellCenters[0]
y = mesh.cellCenters[1]

phi = CellVariable(mesh=mesh, hasOld=1, value=x*y)

eq = TransientTerm(var=phi, coeff=1.) == ImplicitDiffusionTerm(var=phi, coeff=1.) + ImplicitDiffusionTerm(var=phi**2, coeff=1.) + ImplicitDiffusionTerm(var=phi**3, coeff=1.)

viewer = Viewer(vars=phi)

for step in range(10):

phi.updateOld()

res = 1.e5

while res > 1.e-1:

res = eq.sweep(dt=1.e-3)

viewer.plot()


Regards
Ronghai
_______________________________________________
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