CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to plot contour of alpha=0.5 in matlab (https://www.cfd-online.com/Forums/openfoam-post-processing/227057-how-plot-contour-alpha-0-5-matlab.html)

JM27 May 15, 2020 15:27

how to plot contour of alpha=0.5 in matlab
 
1 Attachment(s)
Hi,

I want to plot the bubble contour using alpha = 0.5 in order to compare the bubble shape at various times in my simulation. I want to do this in Matlab by plotting various times on the same plot.

I create the contour in Paraview and I save the coordinates of alpha=0.5 contour using File --> Save Data.

The problem is that when I plot the coordinates in Matlab the points are joined differently to what I see in Paraview (see attached image). I have tried sorting the data but Matlab just fills the whole shape of the bubble instead of showing only the outline.

Can someone please tell me how I can solve this problem or a better way to do this?

HPE May 15, 2020 17:49

Hi,

Not sure if you are aware of the current forum for the post - hence my message - might be better to raise this question in a MATLAB forum.

Hope you find solution to ur problem.

kerim May 16, 2020 21:25

Quote:

Originally Posted by JM27 (Post 770688)
Hi,

I want to plot the bubble contour using alpha = 0.5 in order to compare the bubble shape at various times in my simulation. I want to do this in Matlab by plotting various times on the same plot.

I create the contour in Paraview and I save the coordinates of alpha=0.5 contour using File --> Save Data.

The problem is that when I plot the coordinates in Matlab the points are joined differently to what I see in Paraview (see attached image). I have tried sorting the data but Matlab just fills the whole shape of the bubble instead of showing only the outline.

Can someone please tell me how I can solve this problem or a better way to do this?

Hi,
Have you used griddata function?

Bodo1993 October 26, 2020 12:55

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?


All times are GMT -4. The time now is 21:29.