Yes, this works! Jonathon, thank you very much for your assistance and
patience answering newbie questions!
Do I use the reference below for citing use of FiPy?
J. E. Guyer, D. Wheeler & J. A. Warren,
"FiPy: Partial Differential Equations with Python," Computing in Science &
Engineering 11(3) pp. 6—15 (2009), doi:10.1109/MCSE.2009.52,
http://www.ctcms.nist.gov/fipy
________________________________
From: Jonathan Guyer <[email protected]>
To: FIPY list <[email protected]>
Sent: Wednesday, May 15, 2013 8:50 AM
Subject: Re: Transient Diffusion with Time Varying BC
On May 15, 2013, at 12:43 AM, Chuck Holbert <[email protected]> wrote:
> Now that you explain it, this is exactly what I need. I'm not fluent in
> programming so not sure how to implement these suggestions within FiPy. Can
> you point me to an example that I can use to get started? Any help will be
> greatly appreciated!!
>
> < Do you also want the concentration at the interface to decrease due to
> "forward" diffusion?
>
> Yes, I also want the concentration at the interface to decrease due to
> "forward" diffusion.
>
> < To make a finite reservoir, you should be able to have one or more cells at
> the left side that start with some amount of stuff in them and then have a
> (default) no-flux boundary condition at the left.
>
> How do I code this in FiPy? My starting concentration is 250 in the
> reservoir cell and 0 everywhere else.
reservoir = mesh.x < reservoir_width
phi = CellVariable(name="Concentration", mesh=mesh, value=0.)
phi.setValue(250., where=reservoir)
> < With an explicit, finite reservoir, I would be inclined to model the decay
> with an implicit source term that's only active in the reservoir cells.
>
> Can you provide guidance on how to implement this in FiPy? The decay is
> first order where the rate constant k is constant within each period (k =
> 0.05 for period 1, k = -1 for period 2, and k = -0.05 for period 3) .
k = Variable(0.05)
eq = TransientTerm() == DiffusionTerm(coeff=D) - ImplicitSourceTerm(coeff=k *
reservoir)
:
:
eq.solve(var=phi, dt=dt)
:
:
k.value = 1.
:
:
eq.solve(var=phi, dt=dt)
:
:
_______________________________________________
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 ]