FiPy 中的一维球形网格 [英] 1D spherical grid in FiPy
问题描述
我想在 FiPy 中在一维网格上的球坐标系中求解扩散方程.我还希望左边界为 r=0.1,而不是 r=0.
我找不到一维球对称模块;只有圆柱形.我想我是用 Grid1D 来做的,只需在球坐标中编写 del^2 运算符,然后乘以 r^2(如前所述 此处).但是,我仍然不知道如何指定边界的位置.
有人可以建议我怎么做吗?非常感谢.
所有 fipy 网格都可以通过适当维度的向量进行偏移,例如,
<预><代码>>>>m = fp.Grid1D(nx=10, dx=.1) + [[1.5]]>>>打印 m.x[1.55 1.65 1.75 1.85 1.95 2.05 2.15 2.25 2.35 2.45]球对称网格,镜像在 CylindricalUniformGrid1D,将是一个受欢迎的拉取请求.
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.
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.
这篇关于FiPy 中的一维球形网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!