CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Can we extract data along a line from the sampled surface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By clapointe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2018, 14:07
Default Can we extract data along a line from the sampled surface
  #1
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Dear foamers,

Does anybody know how to extract data along a line from the sampled surface.

I can sample the plane for each time step, but I don't know how to sample a line from these planes. It seems the OpenFOAM's line sampling tool (singleGraph) only works for the data in the written-out time directories which is for the whole flow domain.

Anybody has any hint or solution?

Kind regards,
Yeru
shang is offline   Reply With Quote

Old   March 7, 2018, 03:42
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
You can extract data along a line using the sample utility. Examples are provided in the sampleDict here : https://github.com/OpenFOAM/OpenFOAM...tem/sampleDict.

Caelan
Tobi likes this.
clapointe is offline   Reply With Quote

Old   March 7, 2018, 10:58
Default
  #3
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Hi Caelan,

Thanks for that. But it is not what I want. Maybe I didn't explain myself clearly...

I know sample utility can sample line and surfaces. But I can only know which line I want to look into after the simulation. So what I am doing is to sample the most important surfaces/planes for each time step (they will be stored in directory "postProcessing" in various format, e.g. raw, vtk and foamFile). Then when I know which line to be analysed, I will (if I can) sample the line data from the stored sampled planes. This would save me from running my calculation again which would normally take 1 week or 2 since it is LES.

Do you know any way of doing that?

Many thanks,
Yeru
shang is offline   Reply With Quote

Old   March 7, 2018, 12:33
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Do you mean that you are only keeping the 2d slices and getting rid of the rest of the data? If so, I misunderstood. If you have a uniform grid, post processing in matlab or python is pretty straightforward. Otherwise I think paraview would be able to open vtk files for further analysis.

Caelan
clapointe is offline   Reply With Quote

Old   March 7, 2018, 14:29
Default
  #5
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Yes, only 2D slices. Sorry for confusing you.

My grid is not uniform. So I suppose I need creating an uniform grid in Matlab then mapping my 2D slice's result onto it. I am currently exploring this option, but not sure how big the effect of various interpolation procedures on the result. (from cell centre value in OpenFOAM -> point value on the sampled 2D slices -> point value in Matlab with different grid -> sample a line in Matlab). Therefore, I still prefer to use OpenFOAM or ParaView to do this job. But I will let you know if Matlab works well in this case.

I tried to use ParaView to visualise the 2D slice, it can show the contour and do line sampling. But it can only process a single vtk file for each time and I have to do it manually. So If I want to see how my flow field goes and process multiple vtk files, do you know how can I do it?

Thanks,
Yeru
shang is offline   Reply With Quote

Old   March 7, 2018, 14:39
Default
  #6
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
You can compile Paraview with python capability -- then you can write a python script that iteratively loads/processes a vtk file.

Caelan
clapointe is offline   Reply With Quote

Old   March 11, 2018, 06:00
Default
  #7
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Hey Caelan,

Sorry for my late response. I am pretty new to Python, any idea where I can start or if there is any existing code I can borrow?

Thanks,
Yeru
shang is offline   Reply With Quote

Old   March 13, 2018, 18:40
Default
  #8
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
This is a great resource for OpenFOAM : https://holzmann-cfd.com/community/t...ost-processing -- you should be able to find some example scripts for paraview as part of the blender tutorials.

Caelan

Last edited by Tobi; May 11, 2020 at 14:01.
clapointe is offline   Reply With Quote

Old   March 17, 2018, 14:32
Default
  #9
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Thanks Caelan, I will have a look!
shang is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
8x icoFoam speed up with Cufflink CUDA solver library kmooney OpenFOAM Running, Solving & CFD 42 November 6, 2012 11:37
[Gmsh] Conversion Error nuovodna OpenFOAM Meshing & Mesh Conversion 14 October 1, 2010 11:07
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19


All times are GMT -4. The time now is 15:39.