Hi Daniel, In your script, you are solving an steady state problem. Add a transient term, and preferably sweep to get the solution. Perhaps sth like this:
equation = (TransientTerm() == diffusion_term + source_term) timestep = <your time step> steps = 10 for step in range(steps) res = 1.e6 phi.updateOld() while res>1.e-5 res = equation.sweep(var = phi, dt = timestep) Kind regards, Ali On Thu, 2012-11-08 at 19:02 +0900, Daniel Farrell wrote: > Dear list, > > > I have an issue with a simple script, > (here https://gist.github.com/4037850). > > > When I choose flux=0 boundary conditions on both size of this 1D > diffusion problem, I don't think the results are correct. > > > Physically this describes something like the absorption and emission > of light. With the flux=0 constraints I would expect the value of phi > (in this case electron density) to build up inside the volume because > it cannot escape. However, the fipy solution for this case doesn't > look physical. I'm probably missing something! > > > Best regards, > > > Dan. > > > PS. Latex version of the equations http://imgur.com/mCcX2 . > > > > > > > > _______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]