Prev: help
Next: s-function builder
From: Ally on 13 May 2010 13:55 For a heat transfer class I have to do the following: This two dimensional wall is shown in Figure 1 along with the boundary conditions. It is required that a wall be designed such that the total heat rate at the south wall per unit depth of the wall is -1.0 W/m ≤Q ̇_S≤1.0 W/m (1) and the total heat rate out of the east wall is Q ̇_E≥145 W/m (2) The heat rates are given per unit depth because the depth dimension is in and out of the paper and is considered to be infinite. Thus all heat rates are for a unit depth of the wall. Assume that the thermal conductivity is uniform. Plots of the temperature in the wall as a function of the x-position (see Figure 1) should be made for y = 0, 10, 20, and 30 cm. Put all four of these curves on the same graph. Determine the total heat rate per unit depth for all four walls. This is the code i have writen to sole this...I dont understand how to get the plots Tn=100; hn=20; Te=20; he=15; Ts=70; hs=30; Tw=40; hw=20; H=0.2; L=.2; k=.002; I=21; J=21; %Geometry deltax=L/(I-1); deltay=L/(J-1); x=[0:0.1:L]; y=[0:0.1:H]; A=L*H; %Iterative loop T=ones(I,J)*Tw; Dum=1; while Dum==1 Told=T; %Numeric Equations %Interior Control Volumes for i=2,I-1; for j=2,J-1; T(i,j)=(k*deltay*T(i-1,j)+k*deltay*T(i+1,j)+k*deltax*T(i,j-1)-k*deltax*T(i,j+1))/(2*k*deltay+2*k*deltax); end end %East & West sides for j=2,J; T(1,j)=((T(1,j+1)+T(1,j-1))*k*deltax^2+2*hw*Tw*deltax*deltay^2+2*T(2,j)*k*deltay^2)/(2*(k*deltax^2+hw*deltax*deltay^2+k*deltay^2)); T(I,j)=((T(I,j+1)-T(I,j-1))*k*deltax^2+2*he*Te*deltax*deltay^2+2*T(I-1,j)*k*deltay^2)/(2*(k*deltax^2+he*deltax*deltay^2+k*deltay^2)); end %North & South for i=2,I; T(i,1)=(2*deltax^2*(hs*Ts*deltay+T(i,2)*k)+(T(i+1,1)+T(i-1,1))*k*deltay^2)/(2*(deltax^2*(hs*deltay+k)+k*deltay^2)); T(i,J)=(2*deltax^2*(he*Te*deltay+T(i,J-1)*k)+(T(i+1,J)+T(i-1,J))*k*deltay^2)/(2*(deltax^2*(he*deltay+k)+k*deltay^2)); end %Four Coners T(1,1)=(deltax^2*(hs*Ts*deltay+T(1,2)*k)+hw*Tw*deltax*deltay^2+T(2,1)*k*deltay^2)/(deltax^2*(hs*deltay+k)+hw*deltax*deltay^2+k*deltay^2); T(I,1)=(deltax^2*(hs*Ts*deltay+T(I-1,1)*k)+he*Te*deltax*deltay^2+T(I,2)*k*deltay^2)/(deltax^2*(hs*deltay+k)+he*deltax*deltay^2+k*deltay^2); T(1,J)=(deltax^2*(hn*Tn*deltay+T(2,J)*k)+hw*Tw*deltax*deltay^2+T(1,J-1)*k*deltay^2)/(deltax^2*(hn*deltay+k)+hw*deltax*deltay^2+k*deltay^2); T(I,J)=(deltax^2*(hn*Tn*deltay+T(I,J-1)*k)+he*Te*deltax*deltay^2+T(I-1,J)*k*deltay^2)/(deltax^2*(hn*deltay+k)+he*deltax*deltay^2+k*deltay^2); %Check for convergence Dum=0; for i=1,I; for j=1,J; if (abs((Told(i,j)-T(i,j))/T(i,j))>0.0000001) Dum=1; end end end end Tavge=(.5*T(I,1)+T(I,2)+T(I,3)+T(I,4)+T(I,5)+T(I,6)+T(I,7)+T(I,8)+T(I,9)+T(I,10)+T(I,11)+T(I,12)+T(I,13)+T(I,14)+T(I,15)+T(I,16)+T(I,17)+T(I,19)+T(I,20)+.5*T(I,J))/21 Qe=he*L*(Te-Tavge)
From: someone on 13 May 2010 14:57 "Ally " <nightstarabov(a)aol.com> wrote in message <hsheea$f7n$1(a)fred.mathworks.com>... > For a heat transfer class I have to do the following: > This two dimensional wall is shown in Figure 1 along with the boundary conditions. It is required that a wall be designed such that the total heat rate at the south wall per unit depth of the wall is > -1.0 W/m ≤Q ̇_S≤1.0 W/m (1) > and the total heat rate out of the east wall is > Q ̇_E≥145 W/m (2) > The heat rates are given per unit depth because the depth dimension is in and out of the paper and is considered to be infinite. Thus all heat rates are for a unit depth of the wall. Assume that the thermal conductivity is uniform. Plots of the temperature in the wall as a function of the x-position (see Figure 1) should be made for y = 0, 10, 20, and 30 cm. Put all four of these curves on the same graph. Determine the total heat rate per unit depth for all four walls. > > This is the code i have writen to sole this...I dont understand how to get the plots << snip... >> doc plot doc hold What don't you understand?
From: us on 13 May 2010 15:03 "Ally " <nightstarabov(a)aol.com> wrote in message <hsheea$f7n$1(a)fred.mathworks.com>... > For a heat transfer class I have to do the following: > This two dimensional wall is shown in Figure 1 along with the boundary conditions. It is required that a wall be designed such that the total heat rate at the south wall per unit depth of the wall is > -1.0 W/m ≤Q ̇_S≤1.0 W/m (1) > and the total heat rate out of the east wall is > Q ̇_E≥145 W/m (2) > The heat rates are given per unit depth because the depth dimension is in and out of the paper and is considered to be infinite. Thus all heat rates are for a unit depth of the wall. Assume that the thermal conductivity is uniform. Plots of the temperature in the wall as a function of the x-position (see Figure 1) should be made for y = 0, 10, 20, and 30 cm. Put all four of these curves on the same graph. Determine the total heat rate per unit depth for all four walls. > > This is the code i have writen to sole this...I dont understand how to get the plots a hint: - these will get you started... help line; help patch; us
|
Pages: 1 Prev: help Next: s-function builder |