Hello again,

I am having a bit of trouble manipulating a 2D cylindrical mesh and was
wondering if anyone has any helpful advice?

I want a mesh that is 1.5 meters in the z direction and has an inner radius
of 0.0046 m and an outer radius of 0.00635 m (to model the wall of a pipe).
This is what I have so far but it isn't quite right:

from fipy import *
z = 1.5
r_inner = 0.0046
r_outer = 0.00635
nx = 10
ny = 20
dx = (r_outer - r_inner) / nx
dy = z / ny
mesh = CylindricalGrid2D(dx=dx, dy=dy, nx=nx, ny=ny) + ((0.0046,),)
print mesh.getCellCenters()

I want the z axis to go from 0 to 1.5
The second term in the mesh line seems to translate the r AND z coordinates
outward when all I want it to do is translate the r coordinates. Is there a
way to do this the way I would like?

My other question is this:
Is there a way to access the radial distances from the origin for every
cell?  That isn't the best way to word the question, but to make it more
clear, I would like to be able to do something like:  pi * (r_outer**2 -
r_inner**2) for each cell.  I have tried as many of the mesh.get functions
as I could get my hands on, but haven't been successful yet. Can anyone
suggest something for me to use?

Thank you very much in advance,
Kendall
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to