1

I would like to solve the diffusion equation in FiPy in spherical coordinates on a 1D grid. I would also like the left boundary to be at r=0.1, not r=0.

I can't find a module for 1D spherical symmetry; only cylindrical. I figure I do it with Grid1D and simply write the del^2 operator in spherical coordinates, then multiply through by r^2 (as mentioned here). However, I still don't know how to specify the locations of the boundaries.

Could someone advise me how to do this? Many thanks.

freitreppe
  • 11
  • 1

1 Answers1

1

All fipy meshes can be offset by a vector of appropriate dimension, e.g.,

>>> m = fp.Grid1D(nx=10, dx=.1) + [[1.5]]
>>> print m.x
[1.55 1.65 1.75 1.85 1.95 2.05 2.15 2.25 2.35 2.45]

A spherically symmetric mesh, mirrored on CylindricalUniformGrid1D, would be a welcome pull request.

jeguyer
  • 2,379
  • 1
  • 11
  • 15
  • Thanks for the response. I don't know exactly what you mean by a pull request - but yes, it would be handy for me at least. – freitreppe Sep 12 '18 at 07:48
  • A [pull request](https://help.github.com/articles/about-pull-requests/) is a way to contribute code to the fipy project – jeguyer Sep 13 '18 at 15:22