0

I am currently writing a code in Python for flows through pipes. In this regard, I have to find a centre line passing thorough a 3D pipe geometry defined by a nastran mesh (cells with three or four edges whose coordinates i can access). I am using the pyNastran module in Python to get all the relevant data and functions. My question is what would be the most efficient way of finding the centre line of the pipe. The pipe is a 3d pipe with bends in all direction. ( I have all the coordinates of every single point on the mesh in an array)

1 Answers1

0

That is not so easy topic :-/ Problem is that center line is not local property.

For sure, each point on center line corresponds to one slice through pipe or simpler to one perimeter on pipe surface. For any kind of defining that relation on local characteristics, it is easy to find example with bendings or changing pipe diameter that produces 'strange' result.

One way to solve it is to look for topics that have similar properties that are needed here. Like we want slices to be 'parallel' and to uniformly pass through pipe. On one project we used heat diffusion/transfer to tackle a problem. Idea is to put boundary conditions, on one pipe side set boundary condition 1 and on the other side boundary condition 0. Heat will transfer from one side to the other and isoterm will have good properties.

After that, choose center line discterization (on [0-1]), for each point find isoterm on that temperature and find center of mass of that isoterm. Connecting these centers will produce center line.

It is possible to make diffusion on 3D (volume) and 2D (surface) case. It is probably faster to do it on surface.

Ante
  • 5,350
  • 6
  • 23
  • 46
  • Thanks for your answer. – outofplace Oct 13 '15 at 09:51
  • Thats what our starting point is too that each point on the centre line corresponds to one slice thorugh pipe and then we move along the pipe with certain time step and then get another slice and find its centre. But as there is only mesh data available and the cells are random size and can have both three edges and four edges. finding one slice is also coming up to be computationally intensive and then to find next slice in the right direction with all the diefferent cases makes it complicated.Thats why we are looking for more efficient way. Any Ideas? – outofplace Oct 13 '15 at 10:09
  • As I described (probably bad :-), solving heat diffusion on pipe, with boundary conditions, will generate isoterms that can be used to create central line. Check this [image](http://d1jqu7g1y74ds1.cloudfront.net/wp-content/uploads/2010/12/conductivity-580x280.jpe). Result of diffusion is temperature in each node. To find isoterm on some temperature, find edges where one node is colder and second hotter, and for each edge interpolate point on right temperature. Connecting points results in isoterm. – Ante Oct 15 '15 at 11:30