And of course AFTER I compose this message, pretty soon I think I've
figured out the AdvectionTerm problem. I get good-looking results if I
just iterate the solver in a few "sweeps".
I would still be curious to hear if there's a different approach to
this "prefactor" issue besides manually re-arranging the terms as I've
done here.
Thanks,
Peter
On Mon, 2015-10-19 at 19:05 -0400, Peter Williams wrote:
> Hi,
>
> I'm trying to use fipy to solve some differential equations, and I'm
> not sure how to work with the particular equation I've got at hand.
> I'm a total newbie at this, so I'm probably doing something silly,
> but I can't figure out how to proceed so I thought I'd ask for some
> help.
>
> The attached Python file demonstrates my problem and what I've done
> so far. The key issue is that I have an equation with diffusion terms
> that have spatially-dependent prefactors; in the simplest case,
> something like
>
> > L^2 d/dL (L df/dL)
>
> where L is a spatial variable and I'm trying to determine f(L). As
> far as I can tell, this kind of term is not directly allowed by fipy,
> and I get a TermMultiplyError if I try to construct it.
>
> In the simplest case, demonstrated in the attachment, I can divide
> out the prefactor and fipy works great. However, in my full problem,
> there will be multiple diffusion terms (in multiple dimensions) with
> differing prefactors, so I won't be able to make them all disappear.
>
> I'm pretty sure that I can generically re-express any prefactored
> diffusion term as the sum of a prefactor-free diffusion term and an
> advection term. However, I've tried to implement this with fipy, and
> it doesn't work. The result from the solver is as if I didn't include
> the advection term at all. Again this is demonstrated in the attached
> file.
>
> So, I have two questions:
>
> (1) I'm probably doing something wrong with the advection term in the
> attached sample. Can anyone spot the problem?
>
> (2) It'd be nice not to have to do the error-prone elimination of my
> diffusion prefactors. Are there any ways to avoid this?
>
> Thanks for any tips,
>
> Peter
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy
> ]
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]