I want someone who can help me to see a grid and airfoil in the same plot , here is my code

조회 수: 2 (최근 30일)
clear all;
close all;
clc;
Mi=0.5;
T=300;
P=1;
gamma = 1.4;
R=287;
vinf = sqrt(gamma*R*T)*Mi;
Nx = 100; % x dimension
Ny = 30; % y dimension
Nxy= Nx*Ny;
% step sizes
dx = 1;
dy = 1;
x = 1:dx:Nx; % x axis
y = 1:dy:Ny; % y axis
%set grid location
for i=
x(i)=single(i-1)*dx;
end
[xx,yy]=meshgrid(x,y); %develop grid based on 2 (x and y) arrays of different size
z=zeros(size(xx)); %generate z as a matrix of zeros (same size as meshgrid)
surf(xx,yy,z); %plots the 3 dimensions as a '2d plot' of meshgrid at z=0
view(1) %changes the 3d default view to a 2d for xy plane
hold on ;
% PLOT ARC
circx= linspace(0,1,40);
circy= sqrt(8.35^2 - (circx-.5).^2)-8.335;
plot(circx, circy) % Draw An Arc
axis([-0.5 1.25 -.1 .1]) % Set Axis Limits
hold off

채택된 답변

KSSV
KSSV 2020년 3월 18일
clear all;
close all;
clc;
Mi=0.5;
T=300;
P=1;
gamma = 1.4;
R=287;
vinf = sqrt(gamma*R*T)*Mi;
Nx = 100; % x dimension
Ny = 30; % y dimension
Nxy= Nx*Ny;
% step sizes
dx = 1;
dy = 1;
x = linspace(0,1,Nx); % x axis
y = linspace(0,1,Ny); % y axis
%set grid location
[xx,yy]=meshgrid(x,y); %develop grid based on 2 (x and y) arrays of different size
z=zeros(size(xx)); %generate z as a matrix of zeros (same size as meshgrid)
pcolor(xx,yy,z); %plots the 3 dimensions as a '2d plot' of meshgrid at z=0
% view(1) %changes the 3d default view to a 2d for xy plane
hold on ;
% PLOT ARC
circx= linspace(0,1,40);
circy= sqrt(8.35^2 - (circx-.5).^2)-8.335;
plot(circx, circy) % Draw An Arc
axis([-0.5 1.25 -.1 .1]) % Set Axis Limits
hold off

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Airfoil tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by