Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code needs input to solve problem-------------------------------------------------- %% Program details % skeleton code is developed to carry out finite difference analysis of 2D % steady state

image text in transcribed

Code needs input to solve problem--------------------------------------------------

%% Program details % skeleton code is developed to carry out finite difference analysis of 2D % steady state heat transfer of square frame. You can modify this according % to your problem statement. You're also welcome to write on your own.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % School of Mechanical and Materials Engineering % % Washington State University, Pullman % % Finite Difference Code for 2D Steady State HEat Transfer % % ME 313: Engineering Analsysis (Spring 2020) % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% clear; % close; % clc; % % format short g

%% 2D Steady State Heat Transfer

% % y-direction (j) % | % | 2D steady state % | heat transfer of % a | square frame % | % | % |_ _ _ _ _ _ _ _ _ _ _ x-direction (i) % a % FD formulation: T(i,j-1)+T(i-1,j)-4T(i,j)+T(i+1,j)+T(i,j+1) = 0

%% Section 1 - defining variables

% %define Tin, Tout, a, b, h as variables with values given in the problem % Tin = ; % ... % ... % ... (continue)

% %calculate no of points in x and y direction in symmetric half section % NX = ; %no of points in x-direction % NY = ; %no of points in y-direction % NN = ; %total no of points in the domain

% define A matrix and B vector using zeros function % A is finite difference co-efficient matrix, B is constant vector

% A = ; % B = ;

% %Inline function to calculate row and column position from 2D grid index % rc = @(i,j) ((j-1)*NX+i);

%% Section 2- populating finite difference matrix and vector % %populating finite difference coefficient matrix

% for j = 2:NY-1 % for i = 2:NX-1 % % % calculate current x and y coordinate based on the current index % xi = ; % yi = ; % r = rc(i,j); %calulates row no in A mat and B vector for corresponding node % % if %both xi and yi are inside cavity, assign T = Tin % % else %apply finite difference form of governing eqn % A(r,rc(i-1,j) = 1; % A(r,rc(i,j-1) = 1; % ... % ... % ... % B(r) = 0; % end % % end % end

%% Section 3- applying boundary condition % %applying boundary condition along x axis % for i = 1:NX % j = 1; %for y = 0 % % % j = NY; %for y = a % xi = ; %calculate x coordinate % % if %use symmetry condition if xi is within frame % % else % % end % % end

% %applying boundary condition along y axis % for j = 2:NY-1 %j = 1 and NY are avoided as they have taken care with x boundary condition % i = 1; %for x = 0 % % % i = NX; %for x = a % yi = ; %calculate y-coordinate % % if %use symmetry condition if yi is within frame % % else % % end % end

%% Section 4- solution and post processing % z = A\B; % T2 = zeros(NX,NY);

% for i = 1:NX % for j = 1:NY % T2(i,j) = ; % end % end

% figure(1) % contourf(X,Y,T2,Tin-Tout,'edgecolor','none'); %define X and Y % g=colorbar; % ylabel(g,'Temperature [C]') % caxis([Tout Tin]) % colormap(jet); % title(''); % xlabel(''); % ylabel('');

%% Section 5- Linear plot of temperature distribution

%% Section 6- 1D Steady State Heat Transfer

%define necessary constants

%populate coefficient matrix and vector

%solve for 1D temperature distribution

%plot temperature distribution

1. Download the MATLAB file, Lab4Skeleton.m, available on Blackboard. This file will allow you to analyze steady-state heat transfer problem using finite difference method. Make a copy of skeleton.m and rename the file. A square frame shown in the figure below (a = 36 cm, b= 6 cm) is carrying hot water inside (Tin = 90 C) and has a prescribed temperature at outside boundary (Tout= 10 C). Formulate finite difference scheme and write a MATLAB program to solve for the steady state temperature distribution using following step sizes: (55 points) a-b , hu=15 ,h2 = a-b , 30 3 a-b 60 Tout = 10C Tin 90C (a) Make contour plot showing the temperature distribution for three different cases of step size. Discuss the difference between your results. (b) Using line plot compare the effect of step size on steady-state temperature distribution along y = 9 cm and y = 18 cm for step sizes hi and h3. (c) Formulate finite difference scheme for 1D steady-state heat transfer of the same problem considering length of the rod as 7. Compare your result with y = 18 cm for step size h2. 1. Download the MATLAB file, Lab4Skeleton.m, available on Blackboard. This file will allow you to analyze steady-state heat transfer problem using finite difference method. Make a copy of skeleton.m and rename the file. A square frame shown in the figure below (a = 36 cm, b= 6 cm) is carrying hot water inside (Tin = 90 C) and has a prescribed temperature at outside boundary (Tout= 10 C). Formulate finite difference scheme and write a MATLAB program to solve for the steady state temperature distribution using following step sizes: (55 points) a-b , hu=15 ,h2 = a-b , 30 3 a-b 60 Tout = 10C Tin 90C (a) Make contour plot showing the temperature distribution for three different cases of step size. Discuss the difference between your results. (b) Using line plot compare the effect of step size on steady-state temperature distribution along y = 9 cm and y = 18 cm for step sizes hi and h3. (c) Formulate finite difference scheme for 1D steady-state heat transfer of the same problem considering length of the rod as 7. Compare your result with y = 18 cm for step size h2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions