- You shoul dinitialize the arrays which are getting filled in a loop.
- You can define all the coordinate values in a text file and then load into matlab.
- Check are loops compulsory or it can be vectorized.
intensity plot x-y plane
26 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
M=1.4; %mach speed
l=1.68; %length , m
t=0.15 ; %thickness, m
dx=0.168; %delta x, m
dy=0.015; %delta y, m
dz=0.68668; %delta z, m
Ta=216.66; %free stream temperature, K
K=1.401; %specific heat ratio
pr=0.72178; %prandtl number
r=(pr)^(1/3); %recovery factor
Tstag=Ta*(1+((K-1)/2)*((M*(cosd(20)))^(2))); %stagnation temperature
Taw=Ta*(1+r*((K-1)/2)*M^(2)); %adiabatic wall temperaure
Ka=121.0 % Aluminum,Thermal Conductivity, W/m-k
Kt=6.7 %Titanium, Thermal Conductivity, W/m-k
Kc=30.758 %Carbon-carbon,Thermal Conductivity, W/m-k
%matrix 1x4 of each node
N_1=[ 0 21 0 0];
N_2=[ 0 30 21 0];
N_3=[ 0 44 30 0];
N_4=[ 0 54 44 0];
N_5=[ 0 60 54 0];
N_6=[ 0 0 60 0 ];
N_7=[ 0 0 56 60];
N_8=[0 0 48 56 ];
N_9=[0 0 36 48];
N_10=[0 0 29 36];
N_11=[0 0 0 29];
N_12=[21 37 0 0];
N_13=[ 37 49 0 0];
N_14=[49 57 0 0];
N_15=[ 57 61 0 0];
N_16=[61 0 0 0 ];
N_17=[59 0 0 61];
N_18=[53 0 0 59];
N_19=[ 43 0 0 53];
N_20=[29 0 0 43];
N_21=[2 22 12 1];
N_22=[ 30 23 37 21];
N_23=[ 31 24 38 22];
N_24=[32 25 39 23];
N_25=[33 26 40 24];
N_26=[34 27 41 25];
N_27=[35 28 42 26];
N_28=[36 29 43 27];
N_29=[ 10 11 20 28];
N_30=[ 3 31 22 2];
N_31=[44 32 23 30];
N_32=[ 45 33 24 31];
N_33=[ 46 34 25 32];
N_34=[ 47 35 26 33];
N_35=[ 48 36 27 34];
N_36=[ 9 10 28 35];
N_37=[ 22 38 13 12];
N_38=[ 23 39 49 37];
N_39=[ 24 40 50 30];
N_40=[ 25 41 51 39];
N_41=[26 42 52 40];
N_42=[27 43 53 41];
N_43=[28 20 19 42];
N_44=[ 4 45 31 3];
N_45=[54 46 32 44];
N_46=[ 55 47 33 45];
N_47=[ 56 48 34 46];
N_48=[ 8 9 35 47];
N_49=[ 38 50 14 13];
N_50=[ 39 51 57 49];
N_51=[ 40 52 58 50];
N_52=[ 41 53 59 51];
N_53=[ 42 19 18 52];
N_54=[ 5 55 45 4 ];
N_55=[ 60 7 55 5 ];
N_56=[ 7 8 47 55];
N_57=[ 50 58 15 14];
N_58=[51 59 61 57];
N_59=[ 52 18 17 58];
N_60=[ 6 7 55 5];
N_61=[58 17 16 15];
% 61x4 matrix of nodes
C=[N_1;N_2;N_3;N_4;N_5;N_6;N_7;N_8;N_9;N_10;N_11;N_12;N_13;N_14;...
N_15;N_16;N_17;N_18;N_19;N_20;N_21;N_22;N_23;N_24;N_25;N_26;N_27;N_28;N_29;...
N_30;N_31;N_32;N_33;N_34;N_35;N_36;N_37;N_38;N_39;N_40;N_41;N_42;N_43;...
N_44;N_45;N_46;N_47;N_48;N_49;N_50;N_51;N_52;N_53;N_54;N_55;N_56;N_57;N_58;...
N_59;N_60;N_61]
k=0.168:0.168:1.68; %distance from 0.168 to 1.68, increment of 0.168
for x=1:length(k) %for loop to find heat transfer coefficient at different distances
if k(x)>=0.03 && k(x)<=0.06
h(x)=1.437*k(x)^(-0.279)
elseif k(x)>=0.07 && k(x)<=0.83
h(x)=5.313*k(x)^(-0.121)
else k(x)>=0.85 && k(x)<=1.68
h(x)=(-2.0945)*k(x)+7.0609
end
end
h(x)
% for i=2:1:5
alr=Ka*(dy/dx) %Thermal Conductivity times y distance /x distance
alb=Ka*(dx/dy) %Thermal Conductivity times x distance /ydistance
N=zeros(1,61) %constant value matrixs
A=zeros(61,61); %61 x 61 matrix
for i=2:1:5 %for loop for node 2 to 5 to solve 61x61 matrix
A(i,i)=((h(i-1))*(dz))+(alb+alr)
A(i,C(i,2))=alr
A(i,C(i,3))=alb
N(i,1)=(h(i-1))*(dz)*Taw %solve for 61x1 matrix for constant vaule
end
for i=6 %solve for node 6
A(i,i)=2*(h(6)*dz/2)+alb
A(i,C(i,3))=alb
N(1,i)=2*(h(6)*dz/2)*Taw %solve for node 6 constant vaule
end
for i=7:1:10 %for loop for node 7 to 10 to solve 61x61 matrix
A(i,i)=(h(i-1)*(dz))+(alb+alr)
A(i,C(i,3))=alr
A(i,C(i,4))=alb
N(1,i)=(h(i-1)*(dz))*Taw %solve for 61x1 matrix for constant vaule
end
for i=11 %solve for node 6 for
A(i,i)=2*(h(10)*dz/2)+alr
A(i,C(i,4))=alr
N(1,i)=2*(h(10)*dz/2)*Taw
end
for i=12:1:15
A(i,i)=(h(i-11)*(dz))+(alb+alr)
A(i,C(i,1))=alr
A(i,C(i,2))=alb
N(1,i)=(h(i-11)*(dz))*Taw
end
for i=16
A(i,i)=2*(h(6)*dz/2)+alb
A(i,C(i,1))=alb
N(1,i)=2*(h(6)*dz/2)*Taw
end
for i=17:1:20
A(i,i)=(h(i-11)*(dz))+(alb+alr)
A(i,C(i,1))=alr
A(i,C(i,4))=alb
N(1,i)=(h(i-11)*(dz))*Taw
end
for i=21:1:61
A(i,i)=(2*alr)+(2*alb)
A(i,C(i,1))=alr
A(i,C(i,2))=alb
A(i,C(i,3))=alr
A(i,C(i,4))=alb
end
Ta1(1)=Tstag
Ta1(2:61)=N(2:61)*inv(A(2:61,2:61))
how to plot an intensity plot of temperaure in the x-y plane
0 Kommentare
Antworten (1)
KSSV
am 25 Apr. 2022
Read about pcolor, surf.
Your code is a mess, it needs lot of changes.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!