CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   How to digitize a complex pressure distribution plot (https://www.cfd-online.com/Forums/main/247454-how-digitize-complex-pressure-distribution-plot.html)

Deltahawk February 6, 2023 03:40

How to digitize a complex pressure distribution plot
 
2 Attachment(s)
Hi everyone,

I'm trying to digitise the total/stagnation pressure distributions of a boundary layer ingesting engine. I have a lot of experimental and computational data from past work but I'm struggling to convert it into a vtk format. My current approach is creating a csv file with engauge by manually drawing lines along each pressure contour line but the limitation is that it only creates separate lines when the contours are uniformly distributed or almost flat and the majority of my dataset is highly distorted.

I'm using a simple MATLAB code which converts a csv file into a vtk file however, it only works when it has the same x-coordinate for every line. Since most of the pressure distributions at high angles of attack are non-uniform, engauge is not able to capture these contours separately and I can't create a suitable csv file for MATLAB to convert.

I looked everywhere for a similar software to engauge but every other approach gives me separate x values for each line. Is there any other way I could digitize this data? I though of changing the MATLAB script to accept separate x values but I'm not sure how to go about it.

Hopefully it makes sense. I uploaded an example of what I'm digitizing.

Thank you in advance.

FMDenaro February 6, 2023 11:35

Sorry, I am not sure to understand the format of your initial data.

Matlab is good for many matrix manipulation, also for graphic data but depending on your initial data maybe Tecplot could be of some help.

sbaffini February 6, 2023 16:24

I have no idea how you can accurately extract contour values from any location in the plot, but let us assume that you can, so that you have scattered data as follows:

Z1, Y1, f1
Z2, Y2, f2
...
Zn, Yn, fn

where the f are the value you are extracting and the (z,y) couples are the location where they are being extracted from.

What you can do with this data, if the (z,y) couples are scattered (i.e., with no particular order or distribution), is:

1) Do a delaunay triangulation and either just come out with the data on the resulting unstructured triangular grid or use it to reinterpolate the data linearly on whatever other grid

2) Directly interpolata the data to the desired grid

The latter option involves putting up your data structure for an N nearest neighbor search and being able to interpolate from N scattered points, say with an RBF. The RBF route may work also with all the points, so with no need of any data structure, but you'll need to work more on the resulting system solution.

I'm pretty sure that someone has already done this with Matlab and most or all the pieces are out there, whatever route you choose

FMDenaro February 6, 2023 17:51

Quote:

Originally Posted by sbaffini (Post 844039)
I have no idea how you can accurately extract contour values from any location in the plot, but let us assume that you can, so that you have scattered data as follows:

Z1, Y1, f1
Z2, Y2, f2
...
Zn, Yn, fn

where the f are the value you are extracting and the (z,y) couples are the location where they are being extracted from.

What you can do with this data, if the (z,y) couples are scattered (i.e., with no particular order or distribution), is:

1) Do a delaunay triangulation and either just come out with the data on the resulting unstructured triangular grid or use it to reinterpolate the data linearly on whatever other grid

2) Directly interpolata the data to the desired grid

The latter option involves putting up your data structure for an N nearest neighbor search and being able to interpolate from N scattered points, say with an RBF. The RBF route may work also with all the points, so with no need of any data structure, but you'll need to work more on the resulting system solution.

I'm pretty sure that someone has already done this with Matlab and most or all the pieces are out there, whatever route you choose




Paolo I was thinking to Tecplot because of the unstructured data, the list being exactly what you wrote. Then, would be easy to work for each triangular element and getting isovalue line



f(x,y)=a+b*x+c*y ->y(x)= (f_v -a -b*x)/c

sbaffini February 7, 2023 11:45

Quote:

Originally Posted by FMDenaro (Post 844044)
Paolo I was thinking to Tecplot because of the unstructured data, the list being exactly what you wrote. Then, would be easy to work for each triangular element and getting isovalue line



f(x,y)=a+b*x+c*y ->y(x)= (f_v -a -b*x)/c

I haven't used Tecplot in maybe 2 decades, so I don't know if it does what he needs. But I think that he has the opposite problem: the data extraction from the figure actually provided the isolines (or some other scrambled set of data), but he needs to convert them in a more common format for visualization.

If Tecplot can digest a scattered set of points with data and come up with the resulting contours then, I guess, it is the simplest route.

My original suggestion came from the fact that, in the past, I worked with MATLAB on the wasp .map file format for terrains, which is just a collection of isolines, hence I know that it is doable in MATLAB very easily. In my case I wanted to get an STL file of the terrain surface, but the matter is pretty much the same.

FMDenaro February 7, 2023 11:57

Let see more details from the authors about his real goal.

Anyway, I think that it is a simple task using the linear law y(x;f_v) to extract the required set of data representing the isolines.


All times are GMT -4. The time now is 16:11.