|
[Sponsors] |
Can we extract data along a line from the sampled surface |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 5, 2018, 15:07 |
Can we extract data along a line from the sampled surface
|
#1 |
Member
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12 |
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 |
|
March 7, 2018, 04:42 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
March 7, 2018, 11:58 |
|
#3 |
Member
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12 |
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 |
|
March 7, 2018, 13:33 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
March 7, 2018, 15:29 |
|
#5 |
Member
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12 |
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 |
|
March 7, 2018, 15:39 |
|
#6 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
You can compile Paraview with python capability -- then you can write a python script that iteratively loads/processes a vtk file.
Caelan |
|
March 11, 2018, 07:00 |
|
#7 |
Member
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12 |
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 |
|
March 13, 2018, 19:40 |
|
#8 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 15:01. |
|
March 17, 2018, 15:32 |
|
#9 |
Member
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12 |
Thanks Caelan, I will have a look!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 16:03 |
8x icoFoam speed up with Cufflink CUDA solver library | kmooney | OpenFOAM Running, Solving & CFD | 42 | November 6, 2012 12:37 |
[Gmsh] Conversion Error | nuovodna | OpenFOAM Meshing & Mesh Conversion | 14 | October 1, 2010 12:07 |
Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 15, 2003 00:19 |