On May 16, 2012, at 5:05 PM, Matej Svejda wrote:

> Right know I'm
> solving it with FiPy in the following way:
> 
> eq = TransientTerm(coeff = C) == ImplicitDiffusionTerm() +
> ExponentialConvectionTerm(coeff=H.getFaceGradAverage())

I would use .getFaceGrad() here, not .getFaceGradAverage(). I didn't realize we 
even had such a function (for five years!), and contrary to its documentation, 
I think it has to be 1st order accurate, not 2nd. For what it's worth, it 
doesn't appear that we use it anywhere.


> So here's my question: Am I on the right track here? Is this the right
> way to solve my PDE? Is manually updating the variables for each
> timestep the way to go?

Manually updating phi as a result of your renormalization is probably 
necessary, although it's possible that you're not doing what you intend. If you 
show me the code for your update, I can check that it has the effect you want.

I don't think it should be necessary to manually update H if you define it as a 
Variable expression and if elapsed time is defined as a Variable. There are a 
number of ways that you might not be getting that, though, so it's again 
probably best to just show us the code you use to define and to update H.

That said, it's not the worst thing in the world to manually update H. It just 
clutters up your iteration loop.


> Any ideas on how to improve the accuracy?

Switching from .getFaceGradAverage() to .getFaceGrad() should help. 

Since you are renormalizing \phi, you should sweep the solution at each 
timestep, as you are effectively introducing a non-linearity, even though your 
equation is not explicitly non-linear.


_______________________________________________
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