On May 15, 2013, at 12:43 AM, Chuck Holbert <cfholb...@yahoo.com> 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
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to