2D Contour plot with multiple files

조회 수: 1 (최근 30일)
Usama Bin Khalid
Usama Bin Khalid 2022년 11월 12일
편집: Usama Bin Khalid 2022년 11월 15일
hello, i have a list of data files. like 50-60 basically representing CAD. each files consists of columns of different variables. among which one is "x" which represents radius and the other one is mass fraction of "Hiroy SOOT". the latter quantity changes in each file. I want to make a contour plot of Hiroysoot mass. (can be calculated for each col file by multiplying Hiroy soot column with MASS column). X-axis being CAD progression, y-axis being the radius with accumulated hiroy soot plotted as a contour. Basicallly the accumulated soot at each CAD along radius. The files are attached below.
any idea will be appreciated.
  댓글 수: 7
Usama Bin Khalid
Usama Bin Khalid 2022년 11월 12일
Hello DGM yes you are right, it's related to combustion . The picture I attached is as a reference from exp data.. The data now I have is from 3D CFD. Like you said your second point I want the 2D representation of accumulated soot along the radius for each CAD ( for each cad the the data can be summed and saved along the radius ) AND then combine then to make smooth contour which can be called as map not a contour.. I hope this clarifies the problem. I think it can be done with MESHGRID but I lack the excat sequence of how it can be done ....
Usama Bin Khalid
Usama Bin Khalid 2022년 11월 15일
편집: Usama Bin Khalid 2022년 11월 15일
Hello, i figured out the way how to do it, first i attach the data files on the link
i create the slice for one of the files, by using the script. with this the contour is created as shown below. NOW What i want is to divide this picture into equal circular portions (we can call them rings of width 0.5mm) and then calculate the average of the plotted contour in each ring (by summing the whole mass present in each ring and diving by area of each ring). In this way i will get a vector of averaged values of each ring along the radius.
By doing the same procedure then for other files, we can merge all together and create the plot where we have files names (CAD) along x-axis, radius on y axis and contour in between as per picture i uploaded earlier..
So, i need now help for splitting the image into rings and the calculating the average value of quantity in each ring then plotting it along radius..Finally merging the data of all files to create a 2D map.
%(Radius can be calculated from X and Y given in files). then image should be split in circular portions along radius......
any help will be appreciated. thanks
clear all
cd 'C:\Users\VK\Downloads\output'
data=readtable('tt000045_+3.60647e+02.dat');
data=table2array(data);
datasort=data;
resolution=0.0002;
range=[0 0.00005];
F=scatteredInterpolant(datasort(:,1),datasort(:,2),datasort(:,6),'linear','none');
[X,Y]=meshgrid(min(datasort(:,1)):resolution:max(datasort(:,1)),min(datasort(:,2)):resolution:max(datasort(:,2)));
data2plot=F(X,Y); %this data2plot should be divided into rings in my opinion
imshow(data2plot,range);colormap("hot")
contourf(X,Y,data2plot,5);
xlim([-0.03255 0.03255])
ylim([-0.03255 0.03255])
colormap("jet");
colorbar;
set(gca,'fontweight','bold','fontsize',12)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by