|
[Sponsors] |
October 26, 2020, 12:10 |
MATLAB for Contour Plots of OpenFOAM Data
|
#1 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 6 |
Hi, I use the file 'surfaces' to extract 2D surfaces of the phase fraction from OpenFOAM transient results. I postprocess the data using MATLAB to plot contours of the phase fraction and make videos. I am wondering if I have to use the interpolation function 'griddata' to do so. The problem with 'griddata' is that it takes time to do the interpolation, e.g. a simulation with 100 time steps may take more than an hour to generate the video. Any suggestions?
|
|
October 27, 2020, 10:16 |
|
#2 |
Member
hulli graemer
Join Date: Oct 2014
Posts: 48
Rep Power: 11 |
Hi you can try to modify the code of the medical imaging toolbox (matlab file exchange) to read your vtk files into matlab ...
|
|
October 27, 2020, 10:18 |
|
#3 |
Member
hulli graemer
Join Date: Oct 2014
Posts: 48
Rep Power: 11 |
so you do not need to griddata actually it gives you the same as you would get from paraview ...
|
|
October 27, 2020, 10:39 |
|
#4 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 6 |
Hi, thank you. I will try that. Just to make sure, is the exact name of the toolbox "Medical Image Processing Toolbox"?
|
|
October 28, 2020, 03:52 |
|
#5 |
Member
hulli graemer
Join Date: Oct 2014
Posts: 48
Rep Power: 11 |
Hi, yes
what I did was I produced slices slicing my model using the surfaces /sample Dict function. Then I imported the vtk file using the function read_vtkMesh of the toolkit ... https://de.mathworks.com/matlabcentr...essing-toolbox Notice if you run it it will complain about some missing functions which you have to download, then you should be fine... using patch or trimesh you can visulaize the grid... I had to do some adjistments to visulaize the field since I was not able to read the fields ... However, I can DM you my script if you want ... Best H |
|
October 28, 2020, 09:57 |
|
#6 | |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 6 |
Quote:
|
||
September 11, 2021, 15:50 |
Use Python insted
|
#7 |
New Member
Edgar Alejandro Martínez Ojeda
Join Date: Jul 2019
Posts: 20
Rep Power: 6 |
Here I have a file to extract 2D results of the wake of a virtual turbine:
https://github.com/EdgarAMO/fluidfoam Video on YT: https://www.youtube.com/watch?v=wFZeFDUQflQ |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 07:31 |
Tecplot visualization OpenFoam data: Unable to load the solution data | ndtrong | Tecplot | 2 | July 30, 2017 11:45 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 09:28 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |