# [OpenFOAM] How to extract the coordinate of every single streamline

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 August 5, 2020, 06:10 How to extract the coordinate of every single streamline #1 New Member   Xinyu Li Join Date: Aug 2020 Posts: 3 Rep Power: 2 Hi everyone, I plotted thousands of streamlines in Paraview as is shown in the following figure. [IMG]file:///Users/lixinyu/Downloads/%E5%9B%BE%E5%83%8F2020-8-4%20%E4%B8%8B%E5%8D%8811.43.JPG[/IMG] Now I need to know the coordinate of every points on every single streamline. If I plot spreadsheet directly, all I can get is the coordinate of all unordered points like the following figure. [IMG]file:///Users/lixinyu/Downloads/%E5%9B%BE%E5%83%8F2020-8-4%20%E4%B8%8B%E5%8D%8811.44.JPG[/IMG] Is it possible to extract the coordinate of all points of a streamline and then do that for every single streamline, just like the following figure which I selected manually which is impossible to operate when we have thousands of streamlines. [IMG]file:///Users/lixinyu/Downloads/%E5%9B%BE%E5%83%8F2020-8-4%20%E4%B8%8B%E5%8D%8811.46.JPG[/IMG] Thanks, Xinyu

 August 5, 2020, 07:21 #2 Senior Member   Mikko Join Date: Jul 2014 Location: The Hague, The Netherlands Posts: 235 Rep Power: 9 Hi Xinyu, I'm not sure exactly what you want to do (your figures are not working). Here is one way to deal with the streamlines in an ordered way. Apply CellDatatoPointData filter on the StreamTracer filter (interpolate the SeedIds to points) Export the pointdata as .csv file Use the .csv file. Here is an example script how to plot the data with numpy and matplotlib Code: ```import numpy as np import matplotlib.pyplot as plt data = np.genfromtxt('streamlines.csv', delimiter=',', names=True) streamline_ids = np.unique(data['SeedIds']).astype(int) # each loop plots one streamline. for i in streamline_ids: rows = np.where(data['SeedIds'] == i) plt.plot(data['Points0'][rows],data['Points1'][rows]) plt.show()``` Best, Mikko

 August 5, 2020, 07:30 #3 New Member   Xinyu Li Join Date: Aug 2020 Posts: 3 Rep Power: 2 Hi Mikko, Thanks for your reply. I'm a new member of CFD Online, so I'm not familiar with the operation. How can I insert images from my computer, so that I can upload the images to make my question clearer. When I click the button 'insert image' there is a window to ask for the URL of my image which I don't know. Cheers, Xinyu

 Tags coordinate files, streamline paraview

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Astan OpenFOAM Post-Processing 2 August 15, 2019 03:02 [ANSYS Meshing] Coordinate system Import to Fluent superduke1200 ANSYS Meshing & Geometry 4 December 16, 2018 03:41 ChanStormstout OpenFOAM 0 February 26, 2018 19:53 Ranjith Kumar J Main CFD Forum 1 January 6, 2017 12:14 Confused CFX 15 November 10, 2016 04:42

All times are GMT -4. The time now is 12:03.

 Contact Us - CFD Online - Privacy Statement - Top