Hi,

I'm having some problems with solving a PDE using FiPy. The equation
is of the form:

C * \frac{\partial \varphi(\alpha, t)}{\partial t} = \frac{\partial^2
\varphi(\alpha, t)}{\partial \alpha^2} + \frac{\partial}{\partial
\alpha}  (\frac{\partial H(\alpha, t)}{\partial \alpha} *
\varphi(\alpha, t))

Where C is a constant and H(\alpha, t) is a (rather complicated)
function, defined piecewise on each interval of \alpha. Right know I'm
solving it with FiPy in the following way:

eq = TransientTerm(coeff = C) == ImplicitDiffusionTerm() +
ExponentialConvectionTerm(coeff=H.getFaceGradAverage())

And then I simply iterate over the time-interval using
eq.solve(var=phi, boundaryConditions=bcs, dt=timeStepDuration). For
each time-step I update the CellVariable H manually (since I couldn't
manage for it to be updated automatically by updating the
time-variable). I also perform a "normalization" after each time step
of the solution phi, since it represents a probability distribution
and therefore the integral over a given interval has to be one. When
not doing the normalization the integral goes towards zero, even
though it shouldn't. The normalization I also do by simply manually
changing the value of the CellVariable phi.

My problem is that why I get numerically stable results, they are not
very accurate. And the accuracy doesn't improve noticeably if I use
smaller intervals timeStepDuration or a finer Mesh for phi.

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? Any ideas on how to improve the accuracy?

Thank you in advance and greetings from Germany,
Matej
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to