Jack001 |
February 4, 2016 17:16 |
Advice on post processing compressor blade data in paraview
I have a large data set of a 3D compressor blade that I wish to analyse. I am using paraview python scripting and I can see the data which is contained in a vtkMultiBlockDataSet object. This contains CellData arrays like:
- 'xCoord'
- 'yCoord'
- 'zCoord'
- 'pressure'
Now the problem is that these data points aren't ordered in any meaningful way. What I would like to do is to be able to select spanwise locations (constant radius) and chord wise locations (either suction side or pressure side) and plot the pressure there! I have been able to achieve this using python functions, but with great computational expense and data space! Basically what I do is convert the vtk data to numpy arrays using . This then allows me to post process the data so as to order into points increasing along span and chord, which is ultimately what I want. However I am guessing that if I can somehow do this calculations on the server side of paraview then maybe its more efficient? Here is an example of what I am doing atm:
Code:
reader = OpenDataFile(filename)
tsteps = reader.TimestepValues
for t in tsteps[0:1]:
UpdatePipeline(time = t)
multiBlock = servermanager.Fetch(reader)
cellData = multiBlock.GetBlock(0).GetCellData()
ctop = vtk.vtkCellDataToPointData()
ctop.SetInputDataObject(multiBlock)
ctop.Update()
cpData = ctop.GetOutputDataObject(0).GetBlock(0)
pointData = cpData.GetPointData()
X = vtk_to_numpy(pointData.GetArray('CoordX'))
Y = vtk_to_numpy(pointData.GetArray('CoordY'))
Z = vtk_to_numpy(pointData.GetArray('CoordZ'))
Pavg = vtk_to_numpy(pointData.GetArray('Pr'))
tslice = np.vstack((X,Y,Z,Pavg)).T
Now I can post process tslice so that points are ordered along span and chord. But the act of reading in all of the data is time consuming I figured it would be better to do this wihout having to 'save' the data to a numpy array!
|