24 Jun 01:35
Re: Diffusion equation with a moving point source
From: Tony S Yu <tonyyu@...>
Subject: Re: Diffusion equation with a moving point source
Newsgroups: gmane.comp.python.fipy
Date: 2008-06-23 23:35:38 GMT
Subject: Re: Diffusion equation with a moving point source
Newsgroups: gmane.comp.python.fipy
Date: 2008-06-23 23:35:38 GMT
On Jun 23, 2008, at 2:19 PM, Jonathan Guyer wrote: > I would do it like this: > > xVar = CellVariable(mesh=mesh, value=x) > delta = 1. * ((xVar > x_s) & (xVar < x_s + 1)) Thanks. This is exactly what I was trying to do. >> But I believe this gives me an incorrect solution (checked against >> analytical solution) since the time integration would assume that >> the source has a fixed position during each time interval `dt`. > > The time integration is first order and the way I declare delta > above should have the exact same effect as moving delta.setValue > into the loop. Hmm, that makes sense. Somehow I think I should have realized that these were the same. > Do you get better agreement if you reduce the timestep? Yeah, smaller timesteps help; the convergence is a little slower than I imagined, though. I may have some other errors in my code that's causing problems (my actual code isn't the same as the example I gave). Thanks for your help! -Tony
RSS Feed