Yes. I did include it.

I think I've solved the problem. There was a major mistake in my equation - a - term became a + term..., and I was quite blind. I still need to check with other people to see whether to plot looks correct.

One side note: I tried using the viewer as the manual described. However every time I call viewer.view, it first pops out the graph for a sec, then terminates with the error message:

AttributeError: Matplotlib1DViewer instance has no attribute 'view'
Fatal Python error: pyEval_RestoreThread: NULL state

Not sure if this has anything to do with my not installing certain modules? I used pylab plotter instead and it worked well, so there shouldn't be a problem with the variable to plot.

And thanks for the prompt replies! fipy is really great!

Elizabeth

Jonathan Guyer wrote:


On Apr 30, 2007, at 1:33 PM, Elizabeth Tseng wrote:


\frac{\partial C}{\partial t} = A * C + B - C


eq_C = ImplicitSourceTerm(coeff = <some coeff> * A) + <some coeff> * B - <some coeff> * C

eq_C is missing a TransientTerm in what you've written here. Do you have it in your actual code?


Also, you should be able to roll the "- <some coeff> * C" into your ImplicitSourceTerm, although you may know that's undesirable based on its sign.



What I did is increment the time variable by dt at each time step, and sweep for a number of times. Obviously I've listed something wrong because some of the values I get are negative....Also I noticed that the residual from the sweeping doesn't converge.....

Other than the missing TransientTerm above, I don't see anything obviously wrong with what you're describing. You've implemented your time-dependent boundary condition the way I would do it.


One possibility (it just bit me a couple of weeks ago) is that when you are sweeping, you need to do two things:

1) Declare each of your CellVariables A, B, and C with "hasOld=1".
2) Be sure to call A.updateOld(), B.updateOld(), C.updateOld() at the begging of each time step (not each sweep).

These two steps are easy to forget (which says our design is bad), and the results can be really confusing.


Other than that, I don't see any obvious problems from the snippets you've posted here.

- Jon


--Jonathan E. Guyer, PhD
Metallurgy Division
National Institute of Standards and Technology
<http://www.metallurgy.nist.gov/>





Reply via email to