On Apr 5, 2011, at 2:09 PM, Brad Reisfeld wrote:
> I am a novice user of FiPy and am interested in modeling
> reaction-diffusion phenomena in an axisymmetric cylindrical geometry.
Welcome.
> The cylinder comprises two concentric regions (a 'core' and
> 'annulus') that have different properties.
>
> What is the preferred method to deal with the two regions (and
> potentially different governing equations in the regions)?
> Is this possible with a single mesh?
There is no problem with defining spatially varying coefficients to your
equations in a single mesh:
mesh = CylindricalGrid2D(...)
R, Z = mesh.getFaceCenters()
R = FaceVariable(mesh=mesh, value=R)
eq = TransientTerm() == DiffusionTerm(coeff=DA * (R < r0) + DB * (R >= r0))
To change the equations completely in different domains, I would add the
equations together and set the appropriate coefficients to zero where they
don't apply. E.g, if
\frac{\partial\phi}{\partial t} == \nabla\cdot(D\nabla\phi) for r < r_0
and
\frac{\partial\phi}{\partial t} == K\phi for r \ge r_0
then I would be inclined to write
eq = TransientTerm() == DiffusionTerm(coeff=D * (R < r0)) +
ImplicitSourceTerm(coeff=K * (R >= r0))
> If not, could I create two
> 'CylindricalGrid2D' meshes, with the annular region utilizing the
> 'offset' argument from the core region? If two meshes are used, how
> does one assure continuity between quantities at the interface
> between the regions?
FiPy provides no facilities for doing this. You can certainly run separate
simulations on separate meshes, but you would be responsible for communicating
the boundary conditions between them. I would not find that an entertaining
exercise.