Heat Transfer: Finite Difference method using MATLAB

In summary, the conversation is about a problem statement and corresponding programs for a MATLAB assignment. The person is having trouble getting started and understanding how to implement the equations in MATLAB. They discuss the boundary conditions and finite difference equations for different parts of the problem. They also mention using a separate file, "Reader1," for help.
  • #1
aznkid310
109
1

Homework Statement



I have uploaded the problem statement and corresponding programs.

Reader is the problem statement
Reader1 is another file that is suppose to help

Homework Equations



I'm just having trouble getting started. I can do the analytical part on paper, but I don't know how to implement this in MATLAB.

In the program for problem 1:

What is the 'A' and 'C' matrix?

I can get some values on paper, but, for example, what is A(i, i+1)? I realize this this the temperature to the left of the node I am interested in, but do I type in some sort of equation?

Similarly for A(i,i), A(i, i-1), C(n)...

Is C(1) = -200 from my solution?

It seems I have to do what is says in the reader1 file, but I don't know how to use it


The Attempt at a Solution



For #1a:

T(x) = C1x + C2
Boundary Conditions: T(0) = 500
T(L = 1m) = 300

Thus T(x) = 500 - 200x

q = -kA(dT/dx) = 37200 Watts, where k = 186 W/m.k

energy balance for internal nodes: q1 + q2 +qV = 0

q1 = kA[ (T_i-1) - T_i]
q2 = kA[(T_i+1) - T_i]
qV = dx = internal heat generation assuming dy=dz = infinite

Finite Diff. eqn: (T_i-1) - (2T_i) + (T_i+1) = 0

For the left boundary node:

q_left side = 0 b/c T = 500k is constant?

therefore q_right side + qV = 0

q_right side = kA[(T_i+1) - T_i] and qV is the same from before

Right Boundary Node:

q_left side = kA[(T_i-1) - T_i] and qV stays the same

How is this implemented in MATLAB?

For #1b:

Boundary Conditions: T(0) = 500
-kA(dT/dx) @ x=1m = hA(Ts -T_inf) [Convective BC]

Assuming C1 is the same from part a (is this correct?): T_inf = 462.8 K
 

Attachments

  • reader.pdf
    99.8 KB · Views: 493
  • eme165project1BAR.m
    827 bytes · Views: 602
  • reader1.pdf
    267.8 KB · Views: 370
Last edited:
Physics news on Phys.org
  • #2
h = h_inf = 20 W/m^2.KFinite Diff. eqn: (T_i-1) - (2T_i) + (T_i+1) = 0For the left boundary node:q_left side = 0 b/c T = 500k is constant?therefore q_right side + qV = 0q_right side = kA[(T_i+1) - T_i] and qV is the same from beforeRight Boundary Node: q_left side = kA[(T_i-1) - T_i] and qV stays the sameq_right side = hA[T_s - T_inf]How is this implemented in MATLAB?
 
  • #3
(from previous calculations)

Finite Diff. eqn: (T_i-1) - (2T_i) + (T_i+1) = -hA(T_i - T_inf)

For the left boundary node:

q_left side = 0 b/c T = 500k is constant?

therefore q_right side + qV = 0

q_right side = -hA(T_i - T_inf) and qV is the same from before

Right Boundary Node:

q_left side = kA[(T_i-1) - T_i] and qV stays the same

To implement this in MATLAB, you would first need to define your variables and parameters, such as the length of the domain, the number of nodes, the thermal conductivity, and the boundary conditions. Then, you would need to create a loop that goes through each node and calculates the temperature values using the finite difference equations. This can be done by creating a matrix for the temperature values and using the A and C matrices to calculate the temperature values at each node. You can also use the built-in functions in MATLAB for matrix operations and solving systems of equations. It may also be helpful to plot the temperature distribution at each iteration to see how it changes over time. You can refer to the reader1 file for more guidance on how to set up the code.
 

FAQ: Heat Transfer: Finite Difference method using MATLAB

1. What is the Finite Difference method in heat transfer?

The Finite Difference method is a numerical technique used to solve partial differential equations, such as those involved in heat transfer problems. It involves dividing the problem domain into smaller regions and approximating the derivatives in the equations using the differences between values at adjacent points.

2. How is MATLAB used in heat transfer analysis?

MATLAB is a powerful tool for solving heat transfer problems using the Finite Difference method. It provides built-in functions for creating grids, solving equations, and visualizing results. It also allows for easy manipulation and analysis of data, making it ideal for studying heat transfer phenomena.

3. What are the advantages of using the Finite Difference method in MATLAB for heat transfer analysis?

One advantage is that it is a relatively simple method to implement, requiring only basic programming skills. It also allows for quick and accurate solutions to complex heat transfer problems. Additionally, MATLAB's built-in functions and visualization capabilities make it a convenient and efficient tool for heat transfer analysis.

4. Are there any limitations to using the Finite Difference method in MATLAB for heat transfer analysis?

One limitation is that it can only be used for problems with regular and well-defined geometries. It also requires a fine grid resolution to accurately capture steep temperature gradients, which can be computationally expensive for large problems. Additionally, the Finite Difference method may not be suitable for problems with highly nonlinear boundary conditions.

5. How can I improve the accuracy of my heat transfer analysis using the Finite Difference method in MATLAB?

To improve accuracy, you can refine the grid resolution to better capture temperature gradients. You can also use higher-order difference schemes and implement boundary conditions more accurately. Additionally, it is important to validate your results against analytical or experimental solutions and adjust parameters as needed.

Similar threads

Back
Top